Other/future projects • Re: GTK2 revival
Regarding the theming engines: I'm not at home right now, but this will be the next thing I'm going to take care of.
While we are on this topic, gtk2-engines has a theme (Redmond) I've been using for 10-15 years and it's had an insane bug this whole time where disabled checkboxes always show as checked. After reporting it a few times throughout the years, I finally just tried to tackle it myself and managed to fix the bug. I also finally found the best place to report the bug (with patch code now!) which got rebuffed since gtk2 is apparently too old for the maintainers to give a crap about even though I served them up the fix on a platter.
So, if you're going to work on theme engines, do please give this a look and fix the Redmond theme for everyone.
https://bugs.debian.org/cgi-bin/bugrepo ... ug=1135360
Source file to modify: /gtk2-engines-2.20.2/engines/redmond/src/redmond_gtk2_drawing.c
Existing code comment:
CODE:
/*********************************************** * redmond_draw_check - * * the Function used to draw all check boxes. * * Redmond Check box has essentially 3 looks - * * Normal/Prelight - * base[NORMAL] fill, fg[NORMAL] check * * Selected/Active - * bg[NORMAL] fill, fg[NORMAL] check * * Insensitive - * bg[NORMAL] fill, fg[INSENSITIVE] check * * The Shadow Always draws with a state NORMAL. ***********************************************/
Proposed replacement code comment:
CODE:
/*********************************************** * redmond_draw_check - * * the Function used to draw all check boxes. * * Redmond Check box has 6 states represented with 5 visual combinations - * * Enabled, Unchecked – base[NORMAL] fill, no check mark * Enabled, Checked – base[NORMAL] fill, fg[NORMAL] check mark * Enabled, Active, Unchecked – bg[NORMAL] fill, no check mark * Enabled, Active, Checked – bg[NORMAL] fill, fg[NORMAL] check mark * Disabled, Unchecked – bg[NORMAL] fill, no check mark * Disabled, Checked – bg[NORMAL] fill, fg[INSENSITIVE] check mark * * The Shadow always draws with a state NORMAL. ***********************************************/
Existing code:
CODE:
if ((shadow == GTK_SHADOW_ETCHED_IN) || (state == GTK_STATE_INSENSITIVE)) { /* force insensitive color for inconsistent checkboxes */ do_redmond_draw_check (cr,&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE], x + 2, y + 2, width - 4, height - 4); } else if (shadow == GTK_SHADOW_IN) { do_redmond_draw_check (cr,&redmond_style->color_cube.fg[GTK_STATE_NORMAL], x + 2, y + 2, width - 4, height - 4); }
Proposed replacement code:
CODE:
if (shadow == GTK_SHADOW_ETCHED_IN) { /* inconsistent – always show check */ do_redmond_draw_check (cr,&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE], x + 2, y + 2, width - 4, height - 4); } else if (shadow == GTK_SHADOW_IN) { /* checked – draw check */ if (state != GTK_STATE_INSENSITIVE) do_redmond_draw_check (cr,&redmond_style->color_cube.fg[GTK_STATE_NORMAL], x + 2, y + 2, width - 4, height - 4); else do_redmond_draw_check (cr,&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE], x + 2, y + 2, width - 4, height - 4); } /* unchecked (shadow == GTK_SHADOW_OUT) – nothing to do */
Discussion in the ATmosphere