summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorLibravatar Giuseppe Bilotta <giuseppe.bilotta@gmail.com>2015-12-08 08:05:50 +0100
committerLibravatar Paul Mackerras <paulus@samba.org>2015-12-12 13:43:52 +1100
commit6cb73c84e1dcf1d04f24b6e7915e5606bf69a5fd (patch)
treed196f70471454c2938f6e981d2502219306b431d /gitk
parentMerge https://github.com/vnwildman/gitk (diff)
downloadtgif-6cb73c84e1dcf1d04f24b6e7915e5606bf69a5fd.tar.xz
gitk: Match ttk fonts to gitk fonts
The fonts set in setoptions aren't consistently picked up by ttk, which uses its own predefined fonts. This is noticeable when switching between using and not using ttk with custom fonts or in HiDPI settings (where the default TTK fonts do _not_ respect tk sclaing). Fix by mapping the ttk fontset to the one used by gitk internally. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk18
1 files changed, 18 insertions, 0 deletions
diff --git a/gitk b/gitk
index fcc606eab7..e04264bd86 100755
--- a/gitk
+++ b/gitk
@@ -1943,6 +1943,8 @@ proc confirm_popup {msg {owner .}} {
}
proc setoptions {} {
+ global use_ttk
+
if {[tk windowingsystem] ne "win32"} {
option add *Panedwindow.showHandle 1 startupFile
option add *Panedwindow.sashRelief raised startupFile
@@ -1965,6 +1967,18 @@ proc setoptions {} {
option add *Listbox.font mainfont startupFile
}
+proc setttkstyle {} {
+ eval font configure TkDefaultFont [fontflags mainfont]
+ eval font configure TkTextFont [fontflags textfont]
+ eval font configure TkHeadingFont [fontflags mainfont]
+ eval font configure TkCaptionFont [fontflags mainfont] -weight bold
+ eval font configure TkTooltipFont [fontflags uifont]
+ eval font configure TkFixedFont [fontflags textfont]
+ eval font configure TkIconFont [fontflags uifont]
+ eval font configure TkMenuFont [fontflags uifont]
+ eval font configure TkSmallCaptionFont [fontflags uifont]
+}
+
# Make a menu and submenus.
# m is the window name for the menu, items is the list of menu items to add.
# Each item is a list {mc label type description options...}
@@ -12356,6 +12370,10 @@ if {![info exists have_ttk]} {
set use_ttk [expr {$have_ttk && $want_ttk}]
set NS [expr {$use_ttk ? "ttk" : ""}]
+if {$use_ttk} {
+ setttkstyle
+}
+
regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
set show_notes {}