mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-01 05:10:41 +00:00
Custom TreeNode Icons (replace triangles) #6730
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#6730
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:1.89.8
Branch: imgui-master
Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp (or specify if using a custom engine/back-end)
Compiler: Visual Studio 2019
Operating System: windows10
My English is not good, this is the translation of sorry.
I've looked through the questions, but I can't find them.
BeginnerDear ImGui ,I want to replace the triangle in front of the "ImGui::TreeNode" ,I have tried using "ImFontConfig.GlyphOffset = ImVec2(-18,3); // 设置字体偏移 "to block,But if the icon is translucent, it will not look good
Standalone, minimal, complete and verifiable example: (see https://github.com/ocornut/imgui/issues/2261)
The triangle is just a real geometric triangle being rendered, it is not from the font. There is a way if you don't mind making custom versions of functions, but it isn't elegant. You could make a custom copy of
TreeNode, from there call a custom copy ofTreeNodeBehavior. In that custom version, look for calls toRenderArrowand replace them. I don't recommend doing this as it would make updating to newer versions of the library more difficult, but if you really must replace the arrow you can.Thank you for your suggestion, is there a function with similar function (click to expand the subitem), and then it only shows text without the icon
Linking to #6517 #6090 #2431 #2235