Skip to content

Add a color flag for symbols #1706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aiekick opened this issue Mar 28, 2018 · 7 comments
Closed

Add a color flag for symbols #1706

aiekick opened this issue Mar 28, 2018 · 7 comments
Labels

Comments

@aiekick
Copy link
Contributor

aiekick commented Mar 28, 2018

I need to have a color for symbol, like triangle or bullet different of text, for this particular theme i use :

sdfmesher_msvc_x64_debug_2018-03-28_23-37-47

because the white color with orange bg is not readable, so i need different color for text and symbol in this particular theme.

but i think, this color flag for symbol may be cool and not useless :)

for the moment i have created a color flag "ImGuiCol_Symbol" i used in the two function :

  • RenderTriangle
  • RenderBullet

because for the moment the color used for symbol is the color flag of the text.

what do you think of it ?

@ocornut ocornut added the style label Mar 28, 2018
@ocornut
Copy link
Owner

ocornut commented Mar 28, 2018

I think the request (as you define it) is undesirable, Your picture shows the word "Console" in black and that suggests that the change you/we want has nothing to do with Symbols, but rather being able to redefine the main text color depending on the background color.

This is discussed in #1223, #511, #1055

I apologize that I've been delaying this, I believe the style/coloring system needs a focused rework rather than incremental addition of extra enums because the addition of new enums may never end and has the unobvious side-effect that it would actually break code.

If I naively add e.g. ImGuiCol_ButtonText then PushStyleColor(ImGuiCol_Text) here would break. While I'm not against occasional breakage, the amount of possible enums would potentially skyrocket. My intended solution is to have an implicit inheritance tree, where undefined colors inherit from their parent. I may be able to tackle that in the following few months, in the meanwhile you'll need to either use PushStyleCol(ImGuiCol_Text), either use background colors that are usable with the same single text color, add patch your local copy of imgui adding ImGuiCol_ButtonText, ImGuiCol_HeaderText, etc.

@aiekick
Copy link
Contributor Author

aiekick commented Mar 28, 2018

i not speak about the text color, but about what i supposed to be a symbol and not a char.

here the triangle in the combo. if i define a text color as white in the combo, the text in the combo with gray bg will be white ( ok) but the traingle on the bg orange will be also white and here its my problem.

so i have defined a color flag for symbol, like that i can separate text and symbols :)

i have not the problem for button, i modified the color with a pushStyleColor, but for combo, he cant work as i explained because, the color flag used for render triangle is the text color flag :)

in my style i defined my ImGuiCol_Symbol value to be the same as "ImGuiCol_Text value. like that for some controls i can modify symbol color as needed with the pushStyleColor.

@ocornut
Copy link
Owner

ocornut commented Mar 28, 2018

i not speak about the text color, but about what i supposed to be a symbol and not a char.

We are trying to avoid this distinction as icon fonts are commonly used. You can see in your screenshot that you have exactly the same problem with the word "Console" and you manually solved it with PushStyleCol.

Here the triangle in the combo. if i define a text color as white in the combo, the text in the combo with gray bg will be white ( ok) but the traingle on the bg orange will be also white and here its my problem.

I understand, but your problem is that you want to change the color used when displaying something over the orange/button background. Your problem is unrelated to "symvols". ImGuiCol_Symbol doesn't solve the problem in a general manner since you could have a different background for headers and for buttons and then which color should symbol uses?

i have not the problem for button, i modified the color with a pushStyleColor, but for combo, he cant work as i explained because, the color flag used for render triangle is the text color flag :)

You are offering to solve half of the problem for a certain use case and leave other use cases either unsolved either requiring manual intervention. I'm just saying we need to solve this in a more general way, and will solve it eventually and I have an idea of how to get there but it will take some work.

@aiekick
Copy link
Contributor Author

aiekick commented Mar 28, 2018

ok ok :)

@ocornut
Copy link
Owner

ocornut commented Jun 25, 2018

Closing this now. It's a useful use case to keep in mind when redesigning the colors/styles system. Thanks!

@ocornut ocornut closed this as completed Jun 25, 2018
@aiekick
Copy link
Contributor Author

aiekick commented Jun 27, 2018

maybe you can define a function callback pointer of the method RenderBullet and RenderArrow. like that we can implement our function ?

@aiekick
Copy link
Contributor Author

aiekick commented Feb 12, 2021

in fact the other issue i opened some days ago (#3798) is related to this (i forgot the original post haha)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants