{"thread":{"id":"54690","subject":"[PATCH 0/1] git-gui: fix colored label backgrounds on Mac","startedAt":"2020-11-22T19:46:11Z","lastAt":"2020-12-17T19:04:15Z","messageCount":7,"participants":["Stefan Haller","Pratyush Yadav"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"410496","messageId":"20201122194537.41870-1-stefan@haller-berlin.de","threadId":"54690","inReplyTo":null,"subject":"[PATCH 0/1] git-gui: fix colored label backgrounds on Mac","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2020-11-22T19:45:36Z","receivedAt":"2020-11-22T19:46:11Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"Here's another attempt at fixing the colored label backgrounds when using themed\nwidgets on Mac. I sent a different approach a few weeks ago, which was to make\nthe gui.usettk option default to off on Mac. This was clearly not a good\nsolution. This time I'm presenting an approach that is a little less drastic;\nit's still not ideal, but I feel it's an acceptable compromise.\n\nAnother problem that is improved by this is dark mode on Mac: in that mode the\nlabel text was almost invisible, because it was black on a very dark grey\nbackground.\n\nStefan Haller (1):\n  git-gui: fix colored label backgrounds when using themed widgets\n\n lib/themed.tcl | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\n--\n2.29.0.18.gf8c967e53c\n\n"},{"id":"410497","messageId":"20201122194537.41870-2-stefan@haller-berlin.de","threadId":"54690","inReplyTo":"20201122194537.41870-1-stefan@haller-berlin.de","subject":"[PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2020-11-22T19:45:37Z","receivedAt":"2020-11-22T19:46:11Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"The aqua theme on Mac doesn't support changing the background color for labels\nand frames [1]. Since the red, green, and yellow backgrounds of the labels for\nunstaged and staged files and the diff pane are so important design elements of\ngit gui's main window, it's not acceptable for them to have grey backgrounds on\nMac.\n\nTo work around this, simply use non-themed widgets for all labels on Mac. This\nis not a big problem because labels don't look extremely different between the\nthemed and non-themed versions. There are subtle differences, but they are not\nas bad as having the wrong background color.\n\n[1] https://stackoverflow.com/a/6723911\n\nSigned-off-by: Stefan Haller <stefan@haller-berlin.de>\n---\n lib/themed.tcl | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/lib/themed.tcl b/lib/themed.tcl\nindex 83e3ac7..02aae90 100644\n--- a/lib/themed.tcl\n+++ b/lib/themed.tcl\n@@ -174,7 +174,7 @@ proc InitEntryFrame {} {\n\n proc gold_frame {w args} {\n \tglobal use_ttk\n-\tif {$use_ttk} {\n+\tif {$use_ttk && ![is_MacOSX]} {\n \t\teval [linsert $args 0 ttk::frame $w -style Gold.TFrame]\n \t} else {\n \t\teval [linsert $args 0 frame $w -background gold]\n@@ -183,7 +183,7 @@ proc gold_frame {w args} {\n\n proc tlabel {w args} {\n \tglobal use_ttk\n-\tif {$use_ttk} {\n+\tif {$use_ttk && ![is_MacOSX]} {\n \t\tset cmd [list ttk::label $w -style Color.TLabel]\n \t\tforeach {k v} $args {\n \t\t\tswitch -glob -- $k {\n--\n2.29.0.18.gf8c967e53c\n\n"},{"id":"411093","messageId":"20201201200634.bazwncj7yyp7vksn@yadavpratyush.com","threadId":"54690","inReplyTo":"20201122194537.41870-2-stefan@haller-berlin.de","subject":"Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-12-01T20:06:34Z","receivedAt":"2020-12-01T20:07:36Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi Stefan,\n\nThanks for the patch.\n\nOn 22/11/20 08:45PM, Stefan Haller wrote:\n> The aqua theme on Mac doesn't support changing the background color for labels\n> and frames [1]. Since the red, green, and yellow backgrounds of the labels for\n> unstaged and staged files and the diff pane are so important design elements of\n> git gui's main window, it's not acceptable for them to have grey backgrounds on\n> Mac.\n\nI unfortunately don't have access to a Mac machine to I can't test this \npatch.\n\nWere the colors fine before c02efc1 (git-gui: improve dark mode support, \n2020-09-26)? From what I understand that patch should not affect the \ncolors of the \"Staged Changes\" or the \"Unstaged Changes\" parts.\n\nIf the colors were fine earlier then we need to figure out why colors \nfrom the theme are being used even when we hard-code green or red when \ncreating those labels.\n\nCan you give it a try on a commit before c02efc1 and see what happens?\n \n> To work around this, simply use non-themed widgets for all labels on Mac. This\n> is not a big problem because labels don't look extremely different between the\n> themed and non-themed versions. There are subtle differences, but they are not\n> as bad as having the wrong background color.\n\nAgreed. Though I certainly wish we didn't have to do this.\n \n> [1] https://stackoverflow.com/a/6723911\n> \n> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>\n> ---\n>  lib/themed.tcl | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/lib/themed.tcl b/lib/themed.tcl\n> index 83e3ac7..02aae90 100644\n> --- a/lib/themed.tcl\n> +++ b/lib/themed.tcl\n> @@ -174,7 +174,7 @@ proc InitEntryFrame {} {\n> \n>  proc gold_frame {w args} {\n>  \tglobal use_ttk\n> -\tif {$use_ttk} {\n> +\tif {$use_ttk && ![is_MacOSX]} {\n>  \t\teval [linsert $args 0 ttk::frame $w -style Gold.TFrame]\n>  \t} else {\n>  \t\teval [linsert $args 0 frame $w -background gold]\n> @@ -183,7 +183,7 @@ proc gold_frame {w args} {\n> \n>  proc tlabel {w args} {\n>  \tglobal use_ttk\n> -\tif {$use_ttk} {\n> +\tif {$use_ttk && ![is_MacOSX]} {\n>  \t\tset cmd [list ttk::label $w -style Color.TLabel]\n>  \t\tforeach {k v} $args {\n>  \t\t\tswitch -glob -- $k {\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"411149","messageId":"c8cbdfa1-f3f3-725a-124d-6f70b96767d1@haller-berlin.de","threadId":"54690","inReplyTo":"20201201200634.bazwncj7yyp7vksn@yadavpratyush.com","subject":"Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2020-12-02T08:52:12Z","receivedAt":"2020-12-02T08:53:12Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"On 01.12.20 21:06, Pratyush Yadav wrote:\n> Hi Stefan,\n> \n> Thanks for the patch.\n> \n> On 22/11/20 08:45PM, Stefan Haller wrote:\n>> The aqua theme on Mac doesn't support changing the background color for labels\n>> and frames [1]. Since the red, green, and yellow backgrounds of the labels for\n>> unstaged and staged files and the diff pane are so important design elements of\n>> git gui's main window, it's not acceptable for them to have grey backgrounds on\n>> Mac.\n> \n> I unfortunately don't have access to a Mac machine to I can't test this \n> patch.\n\nI could send screenshots if that helps.\n\n> Were the colors fine before c02efc1 (git-gui: improve dark mode support, \n> 2020-09-26)? From what I understand that patch should not affect the \n> colors of the \"Staged Changes\" or the \"Unstaged Changes\" parts.\n> \n> If the colors were fine earlier then we need to figure out why colors \n> from the theme are being used even when we hard-code green or red when \n> creating those labels.\n> \n> Can you give it a try on a commit before c02efc1 and see what happens?\n\nNo, the colors were wrong on Mac for the past ten years, all the way\nback to when ttk widgets were introduced in c80d7be5e1 (\"git-gui: use\nthemed tk widgets with Tk 8.5\", 2010-01-26).\n\nIt is simply not possible to change the background color of a ttk button\nor label on Mac; c02efc1 doesn't have anything to do with this.\n\n-Stefan\n\n\n>> To work around this, simply use non-themed widgets for all labels on Mac. This\n>> is not a big problem because labels don't look extremely different between the\n>> themed and non-themed versions. There are subtle differences, but they are not\n>> as bad as having the wrong background color.\n> \n> Agreed. Though I certainly wish we didn't have to do this.\n>  \n>> [1] https://stackoverflow.com/a/6723911\n>>\n>> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>\n>> ---\n>>  lib/themed.tcl | 4 ++--\n>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/lib/themed.tcl b/lib/themed.tcl\n>> index 83e3ac7..02aae90 100644\n>> --- a/lib/themed.tcl\n>> +++ b/lib/themed.tcl\n>> @@ -174,7 +174,7 @@ proc InitEntryFrame {} {\n>>\n>>  proc gold_frame {w args} {\n>>  \tglobal use_ttk\n>> -\tif {$use_ttk} {\n>> +\tif {$use_ttk && ![is_MacOSX]} {\n>>  \t\teval [linsert $args 0 ttk::frame $w -style Gold.TFrame]\n>>  \t} else {\n>>  \t\teval [linsert $args 0 frame $w -background gold]\n>> @@ -183,7 +183,7 @@ proc gold_frame {w args} {\n>>\n>>  proc tlabel {w args} {\n>>  \tglobal use_ttk\n>> -\tif {$use_ttk} {\n>> +\tif {$use_ttk && ![is_MacOSX]} {\n>>  \t\tset cmd [list ttk::label $w -style Color.TLabel]\n>>  \t\tforeach {k v} $args {\n>>  \t\t\tswitch -glob -- $k {\n> \n"},{"id":"411559","messageId":"20201206130711.halhskksavsvojm2@yadavpratyush.com","threadId":"54690","inReplyTo":"c8cbdfa1-f3f3-725a-124d-6f70b96767d1@haller-berlin.de","subject":"Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-12-06T13:07:11Z","receivedAt":"2020-12-06T13:08:19Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 02/12/20 09:52AM, Stefan Haller wrote:\n> On 01.12.20 21:06, Pratyush Yadav wrote:\n> > Hi Stefan,\n> > \n> > Thanks for the patch.\n> > \n> > On 22/11/20 08:45PM, Stefan Haller wrote:\n> >> The aqua theme on Mac doesn't support changing the background color for labels\n> >> and frames [1]. Since the red, green, and yellow backgrounds of the labels for\n> >> unstaged and staged files and the diff pane are so important design elements of\n> >> git gui's main window, it's not acceptable for them to have grey backgrounds on\n> >> Mac.\n> > \n> > I unfortunately don't have access to a Mac machine to I can't test this \n> > patch.\n> \n> I could send screenshots if that helps.\n\nYes, that would be helpful.\n \n> > Were the colors fine before c02efc1 (git-gui: improve dark mode support, \n> > 2020-09-26)? From what I understand that patch should not affect the \n> > colors of the \"Staged Changes\" or the \"Unstaged Changes\" parts.\n> > \n> > If the colors were fine earlier then we need to figure out why colors \n> > from the theme are being used even when we hard-code green or red when \n> > creating those labels.\n> > \n> > Can you give it a try on a commit before c02efc1 and see what happens?\n> \n> No, the colors were wrong on Mac for the past ten years, all the way\n> back to when ttk widgets were introduced in c80d7be5e1 (\"git-gui: use\n> themed tk widgets with Tk 8.5\", 2010-01-26).\n> \n> It is simply not possible to change the background color of a ttk button\n> or label on Mac; c02efc1 doesn't have anything to do with this.\n\nOk. Thanks for the clarification. Will apply the patch.\n \n> -Stefan\n> \n> \n> >> To work around this, simply use non-themed widgets for all labels on Mac. This\n> >> is not a big problem because labels don't look extremely different between the\n> >> themed and non-themed versions. There are subtle differences, but they are not\n> >> as bad as having the wrong background color.\n> > \n> > Agreed. Though I certainly wish we didn't have to do this.\n> >  \n> >> [1] https://stackoverflow.com/a/6723911\n> >>\n> >> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>\n> >> ---\n> >>  lib/themed.tcl | 4 ++--\n> >>  1 file changed, 2 insertions(+), 2 deletions(-)\n> >>\n> >> diff --git a/lib/themed.tcl b/lib/themed.tcl\n> >> index 83e3ac7..02aae90 100644\n> >> --- a/lib/themed.tcl\n> >> +++ b/lib/themed.tcl\n> >> @@ -174,7 +174,7 @@ proc InitEntryFrame {} {\n> >>\n> >>  proc gold_frame {w args} {\n> >>  \tglobal use_ttk\n> >> -\tif {$use_ttk} {\n> >> +\tif {$use_ttk && ![is_MacOSX]} {\n> >>  \t\teval [linsert $args 0 ttk::frame $w -style Gold.TFrame]\n> >>  \t} else {\n> >>  \t\teval [linsert $args 0 frame $w -background gold]\n> >> @@ -183,7 +183,7 @@ proc gold_frame {w args} {\n> >>\n> >>  proc tlabel {w args} {\n> >>  \tglobal use_ttk\n> >> -\tif {$use_ttk} {\n> >> +\tif {$use_ttk && ![is_MacOSX]} {\n> >>  \t\tset cmd [list ttk::label $w -style Color.TLabel]\n> >>  \t\tforeach {k v} $args {\n> >>  \t\t\tswitch -glob -- $k {\n> > \n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"411720","messageId":"55dfab3f-e031-615f-435a-aad78d0a0c73@haller-berlin.de","threadId":"54690","inReplyTo":"20201206130711.halhskksavsvojm2@yadavpratyush.com","subject":"Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2020-12-08T15:20:56Z","receivedAt":"2020-12-08T15:21:40Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"On 06.12.20 14:07, Pratyush Yadav wrote:\n> On 02/12/20 09:52AM, Stefan Haller wrote:\n>> On 01.12.20 21:06, Pratyush Yadav wrote:\n>>> Hi Stefan,\n>>>\n>>> Thanks for the patch.\n>>>\n>>> On 22/11/20 08:45PM, Stefan Haller wrote:\n>>>> The aqua theme on Mac doesn't support changing the background color for labels\n>>>> and frames [1]. Since the red, green, and yellow backgrounds of the labels for\n>>>> unstaged and staged files and the diff pane are so important design elements of\n>>>> git gui's main window, it's not acceptable for them to have grey backgrounds on\n>>>> Mac.\n>>>\n>>> I unfortunately don't have access to a Mac machine to I can't test this \n>>> patch.\n>>\n>> I could send screenshots if that helps.\n> \n> Yes, that would be helpful.\n\nHere are some screenshots; with and without the patch, with and without\nttk, and in light mode and dark mode.\n\n   https://cp.sync.com/dl/1cf0e2cd0/dynix3qc-ev5q8crr-sp2kjxuy-h4pcwr68\n\n-Stefan\n"},{"id":"412495","messageId":"20201217190317.pbsozw7kl5vxtwmi@yadavpratyush.com","threadId":"54690","inReplyTo":"20201122194537.41870-2-stefan@haller-berlin.de","subject":"Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-12-17T19:03:17Z","receivedAt":"2020-12-17T19:04:15Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 22/11/20 08:45PM, Stefan Haller wrote:\n> The aqua theme on Mac doesn't support changing the background color for labels\n> and frames [1]. Since the red, green, and yellow backgrounds of the labels for\n> unstaged and staged files and the diff pane are so important design elements of\n> git gui's main window, it's not acceptable for them to have grey backgrounds on\n> Mac.\n> \n> To work around this, simply use non-themed widgets for all labels on Mac. This\n> is not a big problem because labels don't look extremely different between the\n> themed and non-themed versions. There are subtle differences, but they are not\n> as bad as having the wrong background color.\n> \n> [1] https://stackoverflow.com/a/6723911\n> \n> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>\n> ---\n>  lib/themed.tcl | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nApplied to git-gui/master. Thanks.\n\n-- \nRegards,\nPratyush Yadav\n"}]}