GTK chameleon should provide support for theming LabelBox
|Assignee:||Zbigniew Rebacz||% Done:|
It seems that LabelBox colors is not emulated when GTK styling is on.
This is my solution (well tested - please reed comment - CtrlLib/ChGtk.cpp):
GtkWidget *label = gtk_label_new("Ch"); Setup(label); Color labelColor = ChGtkColor(0, label); SColorLabel_Write(labelColor); gtk_widget_destroy(label); GtkWidget *frame = gtk_frame_new(""); Setup(frame); /* GtkWidget *frameLabel = gtk_frame_get_label_widget((GtkFrame*)frame); // <- Default GTK label (We don't need this). We will use label color to emulate this!!! Setup(frameLabel); // <- For some reason it causes IDE crash, but without calling this emulation will failed (Text always black). */ Color frameColor = ChGtkColor(4, frame); // <- Why "4"? I don't know, but it works perfect on light/dark theme. "1, 2, 3" doesn’t work at all! LabelBoxColor_Write(frameColor); LabelBoxTextColor_Write(labelColor); // <- We are using labelColor from labelWidget. gtk_widget_destroy(frame);
To apply patch please use diff version (without unnecessary comments). Of course I enclose several examples. Final version is similar to Windows version.
#3 Updated by Miroslav Fidler almost 9 years ago
- Assignee changed from Miroslav Fidler to Zbigniew Rebacz
the reason I have not accepted this patch is that my experience tells me that it is likely to be broken with some theming engine not tested yet.
Correct theming of LabelBox is hardly something that gets noticed by regular user. Broken theming of LabelBox would get noticed.
Little gain, potential big pain.
BTW, over last 2 years I was actually removing some chameleon theming as I gradually found hard to resolve bugs with specific engine. I am afraid theming will always be a compromise...
#4 Updated by Zbigniew Rebacz almost 9 years ago
- Status changed from Patch ready to In Progress
- Priority changed from High to Normal
I think I will find better solution. Please notice that GTK style supplies more information about colors like "fg", "bg", "mid", "text", "light", "dark". Maybe we can use it to achieve better theming? We are always using fg.
Here is documantation:
This task can be done in next release (Now it has normal priority).