Bug #986

GTK chameleon should provide support for theming LabelBox

Added by Zbigniew Rebacz about 9 years ago. Updated about 9 years ago.

Status:RejectedStart date:02/16/2015
Priority:NormalDue date:
Assignee:Zbigniew Rebacz% Done:

0%

Category:CtrlLibSpent time:-
Target version:-

Description

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.

LabelBoxChGtk.diff Magnifier - Pure version (745 Bytes) Zbigniew Rebacz, 02/16/2015 06:00 PM

LabelBoxColorEmulation.png - GeoFun example (251 KB) Zbigniew Rebacz, 02/16/2015 06:00 PM

NativeFrame.png (7.6 KB) Zbigniew Rebacz, 02/16/2015 06:00 PM

History

#1 Updated by Zbigniew Rebacz about 9 years ago

It should be feature instead of bug.

#2 Updated by Zbigniew Rebacz about 9 years ago

  • Priority changed from Normal to High

#3 Updated by Miroslav Fidler about 9 years ago

  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

Hi,

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...

Mirek

#4 Updated by Zbigniew Rebacz about 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:
https://developer.gnome.org/pygtk/stable/class-gtkstyle.html

This task can be done in next release (Now it has normal priority).

#5 Updated by Zbigniew Rebacz about 9 years ago

  • Assignee changed from Zbigniew Rebacz to Miroslav Fidler

The only thing we can truly emulate is LabelBoxTextColor (In this certain situation there is not compromise). What do you thing? If not just reject this task.

#6 Updated by Zbigniew Rebacz about 9 years ago

  • Status changed from In Progress to Rejected
  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

Also available in: Atom PDF