git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] gitk: Use consistent font for all text input fields

From
MHMark Hills <mark@pogo.org.uk>
Date
Dec 28, 2009, 20:04 UTC
Message-ID
<1262030643-12952-5-git-send-email-mark@pogo.org.uk>
In-Reply-To
<1262030643-12952-4-git-send-email-mark@pogo.org.uk>

Instead of setting the font for specific widgets, set the font for the widget type. If themed widgets are not available, this is via the X resources. If themed widgets are available, the theme font is used.

The exception is the SHA1 ID which is forced to use the fixed-width font, even where themed widgets are used.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
 gitk-git/gitk |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 5008753..13da663 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -1874,7 +1874,8 @@ proc setoptions {} {
     option add *Menubutton.font uifont startupFile
     option add *Label.font uifont startupFile
     option add *Message.font uifont startupFile
-    option add *Entry.font uifont startupFile
+    option add *Entry.font textfont startupFile
+    option add *Text.font textfont startupFile
     option add *Labelframe.font uifont startupFile
     option add *Spinbox.font textfont startupFile
     option add *Listbox.font mainfont startupFile
@@ -2173,7 +2174,7 @@ proc makewindow {} {
     set findstring {}
     set fstring .tf.lbar.findstring
     lappend entries $fstring
-    ${NS}::entry $fstring -width 30 -font textfont -textvariable findstring
+    ${NS}::entry $fstring -width 30 -textvariable findstring
     trace add variable findstring write find_change
     set findtype [mc "Exact"]
     set findtypemenu [makedroplist .tf.lbar.findtype \
@@ -2216,7 +2217,7 @@ proc makewindow {} {
     pack .bleft.top.search -side left -padx 5
     set sstring .bleft.top.sstring
     set searchstring ""
-    ${NS}::entry $sstring -width 20 -font textfont -textvariable searchstring
+    ${NS}::entry $sstring -width 20 -textvariable searchstring
     lappend entries $sstring
     trace add variable searchstring write incrsearch
     pack $sstring -side left -expand 1 -fill x
@@ -4036,7 +4037,7 @@ proc vieweditor {top n title} {
 	} elseif {$type eq "path"} {
 	    ${NS}::label $top.l -text $title
 	    pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3
-	    text $top.t -width 40 -height 5 -background $bgcolor -font uifont
+	    text $top.t -width 40 -height 5 -background $bgcolor
 	    if {[info exists viewfiles($n)]} {
 		foreach f $viewfiles($n) {
 		    $top.t insert end $f
-- 
1.6.6
Previous: Mark Hills
Message 5 of 5 in “gitk: Remove forced use of sans-serif font”
  1. 1/5 gitk: Remove forced use of sans-serif fontMark Hills, Dec 28, 2009
  2. 2/5 gitk: Set the font for all spinbox widgetsMark Hills, Dec 28, 2009
  3. 3/5 gitk: Set the font for all listbox widgetsMark Hills, Dec 28, 2009
  4. 4/5 gitk: Disable option when themed widgets are not availableMark Hills, Dec 28, 2009
  5. 5/5 gitk: Use consistent font for all text input fieldsMark Hills, Dec 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.