mirror of
https://github.com/ocornut/imgui.git
synced 2026-10-29 07:54:40 +00:00
Estimating width of SeparatorText #9554
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#9554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
xx
Back-ends:
xx
Compiler, OS:
xx
Full config/build information:
No response
Details:
I am using a SeparatorText on a small screen (mobile device) and the text gets truncated. This is fine. However, I would like to supply the shorter text myself instead of just relying on "..."
This is the actual problem I'd like to solve, but it doesn't look like there is a way to supply custom truncation text.
As a second approach, I would like to know whether the SeparatorText was going to be truncated, and supply shorter text for the label myself.
What is a good way to estimate the width of the SeparatorText, horizontal bars and everything? I would like to compare that with available width, and supply different text accordingly.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
Honestly if I were you I would simply patch the code in
TreeNodeBehavior():I am not ready to apply this to all widgets as for perf/api reason I am not happy with the current ellipsis rendering logic but it should be reworked during 1.93.x.
Sorry, I just realized I was pasting the wrong widget name. I meant I am using SeparatorText (not CollapsingHeader).
I'm wondering about estimating the width of SeparatorText, so that I may supply different, shorter text if it is going to be truncated.
(I edited CollapsingHeader -> SeparatorText in my original post)
You can infer it from the code
SeparatorTextEx():Thank you, I will take a look