Skip to content

Commit

Permalink
Merge branch 'cb/ttk-style' of git-gui into cb/git-gui-ttk-style
Browse files Browse the repository at this point in the history
* 'cb/ttk-style' of git-gui:
  git-gui: workaround ttk:style theme use
  • Loading branch information
gitster committed Mar 6, 2018
2 parents 7e31236 + f50d505 commit 4891961
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions git-gui/lib/themed.tcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Functions for supporting the use of themed Tk widgets in git-gui.
# Copyright (C) 2009 Pat Thoyts <[email protected]>

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 {} {
# Create a color label style (bg can be overridden by widget option)
ttk::style layout Color.TLabel {
Expand Down Expand Up @@ -28,10 +36,7 @@ proc InitTheme {} {
}
}

# Handle either current Tk or older versions of 8.5
if {[catch {set theme [ttk::style theme use]}]} {
set theme $::ttk::currentTheme
}
set theme [ttk_get_current_theme]

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

0 comments on commit 4891961

Please sign in to comment.