git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] git-gui: fix colored label backgrounds when using themed widgets

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Dec 1, 2020, 20:06 UTC
Message-ID
<20201201200634.bazwncj7yyp7vksn@yadavpratyush.com>
In-Reply-To
<20201122194537.41870-2-stefan@haller-berlin.de>
Hi Stefan,
Thanks for the patch.
On 22/11/20 08:45PM, Stefan Haller wrote:
Show 5 quoted lines
> The aqua theme on Mac doesn't support changing the background color for labels
> and frames [1]. Since the red, green, and yellow backgrounds of the labels for
> unstaged and staged files and the diff pane are so important design elements of
> git gui's main window, it's not acceptable for them to have grey backgrounds on
> Mac.

I unfortunately don't have access to a Mac machine to I can't test this patch.

Were the colors fine before c02efc1 (git-gui: improve dark mode support, 2020-09-26)? From what I understand that patch should not affect the colors of the "Staged Changes" or the "Unstaged Changes" parts.

If the colors were fine earlier then we need to figure out why colors from the theme are being used even when we hard-code green or red when creating those labels.

Can you give it a try on a commit before c02efc1 and see what happens?
 
> To work around this, simply use non-themed widgets for all labels on Mac. This
> is not a big problem because labels don't look extremely different between the
> themed and non-themed versions. There are subtle differences, but they are not
> as bad as having the wrong background color.
Agreed. Though I certainly wish we didn't have to do this.
 
Show 29 quoted lines
> [1] https://stackoverflow.com/a/6723911
> 
> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
> ---
>  lib/themed.tcl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/themed.tcl b/lib/themed.tcl
> index 83e3ac7..02aae90 100644
> --- a/lib/themed.tcl
> +++ b/lib/themed.tcl
> @@ -174,7 +174,7 @@ proc InitEntryFrame {} {
> 
>  proc gold_frame {w args} {
>  	global use_ttk
> -	if {$use_ttk} {
> +	if {$use_ttk && ![is_MacOSX]} {
>  		eval [linsert $args 0 ttk::frame $w -style Gold.TFrame]
>  	} else {
>  		eval [linsert $args 0 frame $w -background gold]
> @@ -183,7 +183,7 @@ proc gold_frame {w args} {
> 
>  proc tlabel {w args} {
>  	global use_ttk
> -	if {$use_ttk} {
> +	if {$use_ttk && ![is_MacOSX]} {
>  		set cmd [list ttk::label $w -style Color.TLabel]
>  		foreach {k v} $args {
>  			switch -glob -- $k {
-- 
Regards,
Pratyush Yadav
Previous: Stefan HallerNext: Stefan Haller
Message 3 of 7 in “git-gui: fix colored label backgrounds on Mac”
  1. 0/1 git-gui: fix colored label backgrounds on MacStefan Haller, Nov 22, 2020
  2. 1/1 git-gui: fix colored label backgrounds when using themed widgetsStefan Haller, Nov 22, 2020
  3. Pratyush YadavDec 1, 2020
  4. Stefan HallerDec 2, 2020
  5. Pratyush YadavDec 6, 2020
  6. Stefan HallerDec 8, 2020
  7. Pratyush YadavDec 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.