aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Levedahl <mlevedahl@gmail.com>2025-06-08 08:16:34 -0400
committerMark Levedahl <mlevedahl@gmail.com>2025-07-16 23:01:51 -0400
commitcb9fa4d9ecd97b9e7e9bbd449c5106cad64215e8 (patch)
treed6c135df2c2bea5272f7cce6994ae167e8ee394b
parent5b8103a0bdd64aa1e093e235966ae76b76b4f81d (diff)
downloadgit-cb9fa4d9ecd97b9e7e9bbd449c5106cad64215e8.tar.gz
gitk: always use themed Tk (ttk)
gitk added the option to used themed Tk (ttk) in 0cc08ff7dd ("gitk: Add a user preference to enable/disable use of themed widgets", 2009-09-05). Using ttk had to be optional as Tk 8.4, then in common use, does not have ttk. ttk is the default when available, so the ttk code paths are by now very well tested. gitk also has code paths for the older default widgets, increasing the maintenance burden. Let's make ttk non-optional to reduce code complexity in later commits. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
-rwxr-xr-xgitk25
1 files changed, 4 insertions, 21 deletions
diff --git a/gitk b/gitk
index e4e100a87b..b973000682 100755
--- a/gitk
+++ b/gitk
@@ -11669,7 +11669,7 @@ proc create_prefs_page {w} {
}
proc prefspage_general {notebook} {
- global NS have_ttk
+ global NS
global {*}$::config_variables
set page [create_prefs_page $notebook.general]
@@ -11747,14 +11747,6 @@ proc prefspage_general {notebook} {
${NS}::label $page.lgen -text [mc "General options"] -font mainfontbold
grid $page.lgen - -sticky w -pady 10
- ${NS}::checkbutton $page.want_ttk -variable want_ttk \
- -text [mc "Use themed widgets"]
- if {$have_ttk} {
- ${NS}::label $page.ttk_note -text [mc "(change requires restart)"]
- } else {
- ${NS}::label $page.ttk_note -text [mc "(currently unavailable)"]
- }
- grid x $page.want_ttk $page.ttk_note -sticky w
return $page
}
@@ -12506,7 +12498,6 @@ set autocopy 0
set autoselect 1
set autosellen 40
set perfile_attrs 0
-set want_ttk 1
if {[tk windowingsystem] eq "aqua"} {
set extdifftool "opendiff"
@@ -12651,7 +12642,6 @@ set config_variables {
uifgdisabledcolor
uifont
visiblerefs
- want_ttk
web_browser
workingfilescirclecolor
wrapcomment
@@ -12748,16 +12738,9 @@ set nullid "0000000000000000000000000000000000000000"
set nullid2 "0000000000000000000000000000000000000001"
set nullfile "/dev/null"
-if {![info exists have_ttk]} {
- set have_ttk [llength [info commands ::ttk::style]]
-}
-set use_ttk [expr {$have_ttk && $want_ttk}]
-set NS [expr {$use_ttk ? "ttk" : ""}]
-
-if {$use_ttk} {
- setttkstyle
-}
-
+setttkstyle
+set use_ttk 1
+set NS ttk
set appname "gitk"
set runq {}