Skip to content

Commit f50d505

Browse files
drizzdgitster
authored andcommitted
git-gui: workaround ttk:style theme use
Tk 8.5.7, which is the latest version on Centos 6, does not support getting the current theme with [ttk::style theme use]. Use the existing workaround for this in all places. Signed-off-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5ab7227 commit f50d505

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/themed.tcl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Functions for supporting the use of themed Tk widgets in git-gui.
22
# Copyright (C) 2009 Pat Thoyts <[email protected]>
33

4+
proc ttk_get_current_theme {} {
5+
# Handle either current Tk or older versions of 8.5
6+
if {[catch {set theme [ttk::style theme use]}]} {
7+
set theme $::ttk::currentTheme
8+
}
9+
return $theme
10+
}
11+
412
proc InitTheme {} {
513
# Create a color label style (bg can be overridden by widget option)
614
ttk::style layout Color.TLabel {
@@ -28,10 +36,7 @@ proc InitTheme {} {
2836
}
2937
}
3038

31-
# Handle either current Tk or older versions of 8.5
32-
if {[catch {set theme [ttk::style theme use]}]} {
33-
set theme $::ttk::currentTheme
34-
}
39+
set theme [ttk_get_current_theme]
3540

3641
if {[lsearch -exact {default alt classic clam} $theme] != -1} {
3742
# Simple override of standard ttk::entry to change the field
@@ -248,7 +253,7 @@ proc tspinbox {w args} {
248253
proc ttext {w args} {
249254
global use_ttk
250255
if {$use_ttk} {
251-
switch -- [ttk::style theme use] {
256+
switch -- [ttk_get_current_theme] {
252257
"vista" - "xpnative" {
253258
lappend args -highlightthickness 0 -borderwidth 0
254259
}

0 commit comments

Comments
 (0)