git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Provide configurable UI font for gitk
@ 2006-04-02  9:23 Keith Packard
  2006-04-02 10:57 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Packard @ 2006-04-02  9:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 4839 bytes --]

This makes the font used in the UI elements of gitk configurable in the
same way the other fonts are. The default fonts used in the Xft build of
tk8.5 are particularily horrific, making this change more important
there.

Signed-off-by: Keith Packard <keithp@neko.keithp.com>


---

 gitk |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

0ec97bb373389b5a55b0579168679b59bede1868
diff --git a/gitk b/gitk
index 03cd475..6319709 100755
--- a/gitk
+++ b/gitk
@@ -337,7 +337,7 @@ proc error_popup msg {
 }
 
 proc makewindow {rargs} {
-    global canv canv2 canv3 linespc charspc ctext cflist textfont
+    global canv canv2 canv3 linespc charspc ctext cflist textfont
mainfont uifont
     global findtype findtypemenu findloc findstring fstring geometry
     global entries sha1entry sha1string sha1but
     global maincursor textcursor curtextcursor
@@ -345,16 +345,20 @@ proc makewindow {rargs} {
 
     menu .bar
     .bar add cascade -label "File" -menu .bar.file
+    .bar configure -font $uifont
     menu .bar.file
     .bar.file add command -label "Update" -command [list updatecommits
$rargs]
     .bar.file add command -label "Reread references" -command
rereadrefs
     .bar.file add command -label "Quit" -command doquit
+    .bar.file configure -font $uifont
     menu .bar.edit
     .bar add cascade -label "Edit" -menu .bar.edit
     .bar.edit add command -label "Preferences" -command doprefs
+    .bar.edit configure -font $uifont
     menu .bar.help
     .bar add cascade -label "Help" -menu .bar.help
     .bar.help add command -label "About gitk" -command about
+    .bar.help configure -font $uifont
     . configure -menu .bar
 
     if {![info exists geometry(canv1)]} {
@@ -401,7 +405,7 @@ proc makewindow {rargs} {
     set entries $sha1entry
     set sha1but .ctop.top.bar.sha1label
     button $sha1but -text "SHA1 ID: " -state disabled -relief flat \
-	-command gotocommit -width 8
+	-command gotocommit -width 8 -font $uifont
     $sha1but conf -disabledforeground [$sha1but cget -foreground]
     pack .ctop.top.bar.sha1label -side left
     entry $sha1entry -width 40 -font $textfont -textvariable sha1string
@@ -431,19 +435,24 @@ proc makewindow {rargs} {
 	-state disabled -width 26
     pack .ctop.top.bar.rightbut -side left -fill y
 
-    button .ctop.top.bar.findbut -text "Find" -command dofind
+    button .ctop.top.bar.findbut -text "Find" -command dofind -font
$uifont
     pack .ctop.top.bar.findbut -side left
     set findstring {}
     set fstring .ctop.top.bar.findstring
     lappend entries $fstring
-    entry $fstring -width 30 -font $textfont -textvariable findstring
+    entry $fstring -width 30 -font $textfont -textvariable findstring
-font $textfont
     pack $fstring -side left -expand 1 -fill x
     set findtype Exact
     set findtypemenu [tk_optionMenu .ctop.top.bar.findtype \
 			  findtype Exact IgnCase Regexp]
+    .ctop.top.bar.findtype configure -font $uifont
+    .ctop.top.bar.findtype.menu configure -font $uifont
     set findloc "All fields"
     tk_optionMenu .ctop.top.bar.findloc findloc "All fields" Headline \
 	Comments Author Committer Files Pickaxe
+    .ctop.top.bar.findloc configure -font $uifont
+    .ctop.top.bar.findloc.menu configure -font $uifont
+	
     pack .ctop.top.bar.findloc -side right
     pack .ctop.top.bar.findtype -side right
     # for making sure type==Exact whenever loc==Pickaxe
@@ -490,7 +499,7 @@ proc makewindow {rargs} {
     frame .ctop.cdet.right
     set cflist .ctop.cdet.right.cfiles
     listbox $cflist -bg white -selectmode extended -width
$geometry(cflistw) \
-	-yscrollcommand ".ctop.cdet.right.sb set"
+	-yscrollcommand ".ctop.cdet.right.sb set" -font $mainfont
     scrollbar .ctop.cdet.right.sb -command "$cflist yview"
     pack .ctop.cdet.right.sb -side right -fill y
     pack $cflist -side left -fill both -expand 1
@@ -590,7 +599,7 @@ proc click {w} {
 }
 
 proc savestuff {w} {
-    global canv canv2 canv3 ctext cflist mainfont textfont
+    global canv canv2 canv3 ctext cflist mainfont textfont uifont
     global stuffsaved findmergefiles maxgraphpct
     global maxwidth
 
@@ -600,6 +609,7 @@ proc savestuff {w} {
 	set f [open "~/.gitk-new" w]
 	puts $f [list set mainfont $mainfont]
 	puts $f [list set textfont $textfont]
+	puts $f [list set uifont $uifont]
 	puts $f [list set findmergefiles $findmergefiles]
 	puts $f [list set maxgraphpct $maxgraphpct]
 	puts $f [list set maxwidth $maxwidth]
@@ -3738,6 +3748,7 @@ if {$tclencoding == {}} {
 
 set mainfont {Helvetica 9}
 set textfont {Courier 9}
+set uifont {Helvetica 9 bold}
 set findmergefiles 0
 set maxgraphpct 50
 set maxwidth 16
-- 
1.3.0.rc1.g9590


-- 
keith.packard@intel.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Provide configurable UI font for gitk
  2006-04-02  9:23 [PATCH] Provide configurable UI font for gitk Keith Packard
@ 2006-04-02 10:57 ` Junio C Hamano
  2006-04-02 19:06   ` Keith Packard
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-04-02 10:57 UTC (permalink / raw)
  To: Keith Packard; +Cc: git, Paul Mackerras

Keith Packard <keithp@keithp.com> writes:

> This makes the font used in the UI elements of gitk configurable in the
> same way the other fonts are. The default fonts used in the Xft build of
> tk8.5 are particularily horrific, making this change more important
> there.
>
> Signed-off-by: Keith Packard <keithp@neko.keithp.com>

Thanks for the patch.  I haven't run it, but a quick eyeballing
suggests what you did is sane.  However,..

>  proc makewindow {rargs} {
> -    global canv canv2 canv3 linespc charspc ctext cflist textfont
> +    global canv canv2 canv3 linespc charspc ctext cflist textfont
> mainfont uifont

Your MUA seems to be line-wrapping the patch here and there...

> @@ -345,16 +345,20 @@ proc makewindow {rargs} {
>  
>      menu .bar
>      .bar add cascade -label "File" -menu .bar.file
> +    .bar configure -font $uifont
>      menu .bar.file
>      .bar.file add command -label "Update" -command [list updatecommits
> $rargs]
>      .bar.file add command -label "Reread references" -command
> rereadrefs
>...

so the patch does not apply X-<.

Also, I prefer changes to gitk to be fed via Paul Mackerras
tree.  If you send changes to gitk to me, I will forward patches
with my Acked-by: to him and wait for him to bounce the change
back to me through his tree, so it is not a big deal for me, and
the changes will _not_ be lost anyway, but I'd still appreciate
gitk patches to be sent to Paul first if possible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Provide configurable UI font for gitk
  2006-04-02 10:57 ` Junio C Hamano
@ 2006-04-02 19:06   ` Keith Packard
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Packard @ 2006-04-02 19:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: keithp, git, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

On Sun, 2006-04-02 at 03:57 -0700, Junio C Hamano wrote:

> Your MUA seems to be line-wrapping the patch here and there...

Sigh. I'll resend it to Paul.

-- 
keith.packard@intel.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-02 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-02  9:23 [PATCH] Provide configurable UI font for gitk Keith Packard
2006-04-02 10:57 ` Junio C Hamano
2006-04-02 19:06   ` Keith Packard

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).