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 <drizzd@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5ab72271e1
commit
f50d5055bf
@ -1,6 +1,14 @@
|
|||||||
# Functions for supporting the use of themed Tk widgets in git-gui.
|
# Functions for supporting the use of themed Tk widgets in git-gui.
|
||||||
# Copyright (C) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
|
# Copyright (C) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
|
||||||
|
|
||||||
|
proc ttk_get_current_theme {} {
|
||||||
|
# Handle either current Tk or older versions of 8.5
|
||||||
|
if {[catch {set theme [ttk::style theme use]}]} {
|
||||||
|
set theme $::ttk::currentTheme
|
||||||
|
}
|
||||||
|
return $theme
|
||||||
|
}
|
||||||
|
|
||||||
proc InitTheme {} {
|
proc InitTheme {} {
|
||||||
# Create a color label style (bg can be overridden by widget option)
|
# Create a color label style (bg can be overridden by widget option)
|
||||||
ttk::style layout Color.TLabel {
|
ttk::style layout Color.TLabel {
|
||||||
@ -28,10 +36,7 @@ proc InitTheme {} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle either current Tk or older versions of 8.5
|
set theme [ttk_get_current_theme]
|
||||||
if {[catch {set theme [ttk::style theme use]}]} {
|
|
||||||
set theme $::ttk::currentTheme
|
|
||||||
}
|
|
||||||
|
|
||||||
if {[lsearch -exact {default alt classic clam} $theme] != -1} {
|
if {[lsearch -exact {default alt classic clam} $theme] != -1} {
|
||||||
# Simple override of standard ttk::entry to change the field
|
# Simple override of standard ttk::entry to change the field
|
||||||
@ -248,7 +253,7 @@ proc tspinbox {w args} {
|
|||||||
proc ttext {w args} {
|
proc ttext {w args} {
|
||||||
global use_ttk
|
global use_ttk
|
||||||
if {$use_ttk} {
|
if {$use_ttk} {
|
||||||
switch -- [ttk::style theme use] {
|
switch -- [ttk_get_current_theme] {
|
||||||
"vista" - "xpnative" {
|
"vista" - "xpnative" {
|
||||||
lappend args -highlightthickness 0 -borderwidth 0
|
lappend args -highlightthickness 0 -borderwidth 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user