{"thread":{"id":"22041","subject":"[PATCH 5/5] gitk: Use consistent font for all text input fields","startedAt":"2009-12-28T20:03:59Z","lastAt":"2009-12-28T20:04:03Z","messageCount":5,"participants":["Mark Hills"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"130414","messageId":"1262030643-12952-1-git-send-email-mark@pogo.org.uk","threadId":"22041","inReplyTo":null,"subject":"[PATCH 1/5] gitk: Remove forced use of sans-serif font","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2009-12-28T20:03:59Z","receivedAt":"2009-12-28T20:03:59Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"The X resources set using uifont cover this case.\n\nSigned-off-by: Mark Hills <mark@pogo.org.uk>\n---\n gitk-git/gitk |   12 ------------\n 1 files changed, 0 insertions(+), 12 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 364c7a8..c58fd58 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -10513,7 +10513,6 @@ proc mkfontdisp {font top which} {\n     set fontpref($font) [set $font]\n     ${NS}::button $top.${font}but -text $which \\\n \t-command [list choosefont $font $which]\n-    if {!$use_ttk} {$top.${font}but configure  -font optionfont}\n     ${NS}::label $top.$font -relief flat -font $font \\\n \t-text $fontattr($font,family) -justify left\n     grid x $top.${font}but $top.$font -sticky w\n@@ -10776,15 +10775,6 @@ proc doprefs {} {\n     mkfontdisp textfont $top [mc \"Diff display font\"]\n     mkfontdisp uifont $top [mc \"User interface font\"]\n \n-    if {!$use_ttk} {\n-\tforeach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag\n-\t    ldiff lattr extdifff.l extdifff.b bgbut fgbut\n-\t    diffoldbut diffnewbut hunksepbut markbgbut selbgbut\n-\t    want_ttk ttk_note} {\n-\t    $top.$w configure -font optionfont\n-\t}\n-    }\n-\n     ${NS}::frame $top.buts\n     ${NS}::button $top.buts.ok -text [mc \"OK\"] -command prefsok -default active\n     ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command prefscan -default normal\n@@ -11396,8 +11386,6 @@ namespace import ::msgcat::mc\n \n catch {source ~/.gitk}\n \n-font create optionfont -family sans-serif -size -12\n-\n parsefont mainfont $mainfont\n eval font create mainfont [fontflags mainfont]\n eval font create mainfontbold [fontflags mainfont 1]\n-- \n1.6.6\n"},{"id":"130416","messageId":"1262030643-12952-2-git-send-email-mark@pogo.org.uk","threadId":"22041","inReplyTo":"1262030643-12952-1-git-send-email-mark@pogo.org.uk","subject":"[PATCH 2/5] gitk: Set the font for all spinbox widgets","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2009-12-28T20:04:00Z","receivedAt":"2009-12-28T20:04:00Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"Use the X resources to set the font, removing the need to set the font\nfor specific widgets.\n\nSigned-off-by: Mark Hills <mark@pogo.org.uk>\n---\n gitk-git/gitk |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex c58fd58..299a2ae 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1876,6 +1876,7 @@ proc setoptions {} {\n     option add *Message.font uifont startupFile\n     option add *Entry.font uifont startupFile\n     option add *Labelframe.font uifont startupFile\n+    option add *Spinbox.font textfont startupFile\n }\n \n # Make a menu and submenus.\n@@ -2226,7 +2227,7 @@ proc makewindow {} {\n \t-command changediffdisp -variable diffelide -value {1 0}\n     ${NS}::label .bleft.mid.labeldiffcontext -text \"      [mc \"Lines of context\"]: \"\n     pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left\n-    spinbox .bleft.mid.diffcontext -width 5 -font textfont \\\n+    spinbox .bleft.mid.diffcontext -width 5 \\\n \t-from 0 -increment 1 -to 10000000 \\\n \t-validate all -validatecommand \"diffcontextvalidate %P\" \\\n \t-textvariable diffcontextstring\n-- \n1.6.6\n"},{"id":"130417","messageId":"1262030643-12952-3-git-send-email-mark@pogo.org.uk","threadId":"22041","inReplyTo":"1262030643-12952-2-git-send-email-mark@pogo.org.uk","subject":"[PATCH 3/5] gitk: Set the font for all listbox widgets","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2009-12-28T20:04:01Z","receivedAt":"2009-12-28T20:04:01Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"This affects the font chooser.\n\nSigned-off-by: Mark Hills <mark@pogo.org.uk>\n---\n gitk-git/gitk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 299a2ae..5cbc885 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1877,6 +1877,7 @@ proc setoptions {} {\n     option add *Entry.font uifont startupFile\n     option add *Labelframe.font uifont startupFile\n     option add *Spinbox.font textfont startupFile\n+    option add *Listbox.font mainfont startupFile\n }\n \n # Make a menu and submenus.\n-- \n1.6.6\n"},{"id":"130415","messageId":"1262030643-12952-4-git-send-email-mark@pogo.org.uk","threadId":"22041","inReplyTo":"1262030643-12952-3-git-send-email-mark@pogo.org.uk","subject":"[PATCH 4/5] gitk: Disable option when themed widgets are not available","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2009-12-28T20:04:02Z","receivedAt":"2009-12-28T20:04:02Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"Disable the widget instead of using the label to indicate that themed\nwidgets are not available.\n\nSigned-off-by: Mark Hills <mark@pogo.org.uk>\n---\n gitk-git/gitk |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 5cbc885..5008753 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -10721,14 +10721,14 @@ proc doprefs {} {\n \n     ${NS}::label $top.lgen -text [mc \"General options\"]\n     grid $top.lgen - -sticky w -pady 10\n-    ${NS}::checkbutton $top.want_ttk -variable want_ttk \\\n-\t-text [mc \"Use themed widgets\"]\n     if {$have_ttk} {\n-\t${NS}::label $top.ttk_note -text [mc \"(change requires restart)\"]\n+\t${NS}::checkbutton $top.want_ttk -variable want_ttk \\\n+\t    -text [mc \"Use themed widgets (change requires restart)\"]\n     } else {\n-\t${NS}::label $top.ttk_note -text [mc \"(currently unavailable)\"]\n+\t${NS}::checkbutton $top.want_ttk \\\n+\t    -text [mc \"Use themed widgets\"] -state disabled\n     }\n-    grid x $top.want_ttk $top.ttk_note -sticky w\n+    grid x $top.want_ttk - -sticky w\n \n     ${NS}::label $top.cdisp -text [mc \"Colors: press to choose\"]\n     grid $top.cdisp - -sticky w -pady 10\n-- \n1.6.6\n"},{"id":"130413","messageId":"1262030643-12952-5-git-send-email-mark@pogo.org.uk","threadId":"22041","inReplyTo":"1262030643-12952-4-git-send-email-mark@pogo.org.uk","subject":"[PATCH 5/5] gitk: Use consistent font for all text input fields","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2009-12-28T20:04:03Z","receivedAt":"2009-12-28T20:04:03Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"Instead of setting the font for specific widgets, set the font for the\nwidget type. If themed widgets are not available, this is via the X\nresources. If themed widgets are available, the theme font is used.\n\nThe exception is the SHA1 ID which is forced to use the fixed-width\nfont, even where themed widgets are used.\n\nSigned-off-by: Mark Hills <mark@pogo.org.uk>\n---\n gitk-git/gitk |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 5008753..13da663 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1874,7 +1874,8 @@ proc setoptions {} {\n     option add *Menubutton.font uifont startupFile\n     option add *Label.font uifont startupFile\n     option add *Message.font uifont startupFile\n-    option add *Entry.font uifont startupFile\n+    option add *Entry.font textfont startupFile\n+    option add *Text.font textfont startupFile\n     option add *Labelframe.font uifont startupFile\n     option add *Spinbox.font textfont startupFile\n     option add *Listbox.font mainfont startupFile\n@@ -2173,7 +2174,7 @@ proc makewindow {} {\n     set findstring {}\n     set fstring .tf.lbar.findstring\n     lappend entries $fstring\n-    ${NS}::entry $fstring -width 30 -font textfont -textvariable findstring\n+    ${NS}::entry $fstring -width 30 -textvariable findstring\n     trace add variable findstring write find_change\n     set findtype [mc \"Exact\"]\n     set findtypemenu [makedroplist .tf.lbar.findtype \\\n@@ -2216,7 +2217,7 @@ proc makewindow {} {\n     pack .bleft.top.search -side left -padx 5\n     set sstring .bleft.top.sstring\n     set searchstring \"\"\n-    ${NS}::entry $sstring -width 20 -font textfont -textvariable searchstring\n+    ${NS}::entry $sstring -width 20 -textvariable searchstring\n     lappend entries $sstring\n     trace add variable searchstring write incrsearch\n     pack $sstring -side left -expand 1 -fill x\n@@ -4036,7 +4037,7 @@ proc vieweditor {top n title} {\n \t} elseif {$type eq \"path\"} {\n \t    ${NS}::label $top.l -text $title\n \t    pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3\n-\t    text $top.t -width 40 -height 5 -background $bgcolor -font uifont\n+\t    text $top.t -width 40 -height 5 -background $bgcolor\n \t    if {[info exists viewfiles($n)]} {\n \t\tforeach f $viewfiles($n) {\n \t\t    $top.t insert end $f\n-- \n1.6.6\n"}]}