{"thread":{"id":"22208","subject":"[PATCH resend] gitk: font and theme use","startedAt":"2010-01-13T20:40:01Z","lastAt":"2010-01-13T20:40:22Z","messageCount":6,"participants":["Mark Hills"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"131529","messageId":"alpine.NEB.2.01.1001132030010.15349@jrf.vwaro.pbz","threadId":"22208","inReplyTo":null,"subject":"[PATCH resend] gitk: font and theme use","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2010-01-13T20:40:01Z","receivedAt":"2010-01-13T20:40:01Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"Hi Paul,\n\nI'm following up this email with a re-send of some earlier patches for \nyour review (previously sent to the list). They make some fixes to the \nfont and theme use, mainly for consistency.\n\nSince last time and have based them on gitk.git master (instead of \ngit.git); no other changes.\n\nThanks\n\n-- \nMark\n"},{"id":"131531","messageId":"1263415222-5911-1-git-send-email-mark@pogo.org.uk","threadId":"22208","inReplyTo":"alpine.NEB.2.01.1001132030010.15349@jrf.vwaro.pbz","subject":"[PATCH 1/5] gitk: Remove forced use of sans-serif font","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2010-01-13T20:40:18Z","receivedAt":"2010-01-13T20:40:18Z","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 |   12 ------------\n 1 files changed, 0 insertions(+), 12 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 48cfce3..0e430bd 100755\n--- a/gitk\n+++ b/gitk\n@@ -10528,7 +10528,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@@ -10791,15 +10790,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@@ -11411,8 +11401,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.5.ge408\n"},{"id":"131534","messageId":"1263415222-5911-2-git-send-email-mark@pogo.org.uk","threadId":"22208","inReplyTo":"1263415222-5911-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":"2010-01-13T20:40:19Z","receivedAt":"2010-01-13T20:40:19Z","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 |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 0e430bd..e010010 100755\n--- a/gitk\n+++ b/gitk\n@@ -1879,6 +1879,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@@ -2229,7 +2230,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.5.ge408\n"},{"id":"131530","messageId":"1263415222-5911-3-git-send-email-mark@pogo.org.uk","threadId":"22208","inReplyTo":"1263415222-5911-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":"2010-01-13T20:40:20Z","receivedAt":"2010-01-13T20:40:20Z","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 |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex e010010..3cdc31e 100755\n--- a/gitk\n+++ b/gitk\n@@ -1880,6 +1880,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.5.ge408\n"},{"id":"131533","messageId":"1263415222-5911-4-git-send-email-mark@pogo.org.uk","threadId":"22208","inReplyTo":"1263415222-5911-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":"2010-01-13T20:40:21Z","receivedAt":"2010-01-13T20:40:21Z","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 |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 3cdc31e..54f4fb3 100755\n--- a/gitk\n+++ b/gitk\n@@ -10736,14 +10736,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.5.ge408\n"},{"id":"131532","messageId":"1263415222-5911-5-git-send-email-mark@pogo.org.uk","threadId":"22208","inReplyTo":"1263415222-5911-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":"2010-01-13T20:40:22Z","receivedAt":"2010-01-13T20:40:22Z","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 |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 54f4fb3..1f5f456 100755\n--- a/gitk\n+++ b/gitk\n@@ -1877,7 +1877,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@@ -2176,7 +2177,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@@ -2219,7 +2220,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@@ -4039,7 +4040,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.5.ge408\n"}]}