]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: fix colored label backgrounds when using themed widgets
authorStefan Haller <stefan@haller-berlin.de>
Sun, 22 Nov 2020 19:45:37 +0000 (20:45 +0100)
committerPratyush Yadav <me@yadavpratyush.com>
Thu, 17 Dec 2020 19:00:37 +0000 (00:30 +0530)
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.

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.

[1] https://stackoverflow.com/a/6723911

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
lib/themed.tcl

index 83e3ac795f3842b2ca615e91ba33ef53ad05cf25..02aae90144a9f5fee864ff4295c61fc9641ed953 100644 (file)
@@ -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 {