* [PATCH resend] gitk: font and theme use
@ 2010-01-13 20:40 Mark Hills
2010-01-13 20:40 ` [PATCH 1/5] gitk: Remove forced use of sans-serif font Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Hi Paul,
I'm following up this email with a re-send of some earlier patches for
your review (previously sent to the list). They make some fixes to the
font and theme use, mainly for consistency.
Since last time and have based them on gitk.git master (instead of
git.git); no other changes.
Thanks
--
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] gitk: Remove forced use of sans-serif font
2010-01-13 20:40 [PATCH resend] gitk: font and theme use Mark Hills
@ 2010-01-13 20:40 ` Mark Hills
2010-01-13 20:40 ` [PATCH 2/5] gitk: Set the font for all spinbox widgets Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
The X resources set using uifont cover this case.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/gitk b/gitk
index 48cfce3..0e430bd 100755
--- a/gitk
+++ b/gitk
@@ -10528,7 +10528,6 @@ proc mkfontdisp {font top which} {
set fontpref($font) [set $font]
${NS}::button $top.${font}but -text $which \
-command [list choosefont $font $which]
- if {!$use_ttk} {$top.${font}but configure -font optionfont}
${NS}::label $top.$font -relief flat -font $font \
-text $fontattr($font,family) -justify left
grid x $top.${font}but $top.$font -sticky w
@@ -10791,15 +10790,6 @@ proc doprefs {} {
mkfontdisp textfont $top [mc "Diff display font"]
mkfontdisp uifont $top [mc "User interface font"]
- if {!$use_ttk} {
- foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
- ldiff lattr extdifff.l extdifff.b bgbut fgbut
- diffoldbut diffnewbut hunksepbut markbgbut selbgbut
- want_ttk ttk_note} {
- $top.$w configure -font optionfont
- }
- }
-
${NS}::frame $top.buts
${NS}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active
${NS}::button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal
@@ -11411,8 +11401,6 @@ namespace import ::msgcat::mc
catch {source ~/.gitk}
-font create optionfont -family sans-serif -size -12
-
parsefont mainfont $mainfont
eval font create mainfont [fontflags mainfont]
eval font create mainfontbold [fontflags mainfont 1]
--
1.6.6.5.ge408
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] gitk: Set the font for all spinbox widgets
2010-01-13 20:40 ` [PATCH 1/5] gitk: Remove forced use of sans-serif font Mark Hills
@ 2010-01-13 20:40 ` Mark Hills
2010-01-13 20:40 ` [PATCH 3/5] gitk: Set the font for all listbox widgets Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Use the X resources to set the font, removing the need to set the font
for specific widgets.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index 0e430bd..e010010 100755
--- a/gitk
+++ b/gitk
@@ -1879,6 +1879,7 @@ proc setoptions {} {
option add *Message.font uifont startupFile
option add *Entry.font uifont startupFile
option add *Labelframe.font uifont startupFile
+ option add *Spinbox.font textfont startupFile
}
# Make a menu and submenus.
@@ -2229,7 +2230,7 @@ proc makewindow {} {
-command changediffdisp -variable diffelide -value {1 0}
${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: "
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
- spinbox .bleft.mid.diffcontext -width 5 -font textfont \
+ spinbox .bleft.mid.diffcontext -width 5 \
-from 0 -increment 1 -to 10000000 \
-validate all -validatecommand "diffcontextvalidate %P" \
-textvariable diffcontextstring
--
1.6.6.5.ge408
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] gitk: Set the font for all listbox widgets
2010-01-13 20:40 ` [PATCH 2/5] gitk: Set the font for all spinbox widgets Mark Hills
@ 2010-01-13 20:40 ` Mark Hills
2010-01-13 20:40 ` [PATCH 4/5] gitk: Disable option when themed widgets are not available Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
This affects the font chooser.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index e010010..3cdc31e 100755
--- a/gitk
+++ b/gitk
@@ -1880,6 +1880,7 @@ proc setoptions {} {
option add *Entry.font uifont startupFile
option add *Labelframe.font uifont startupFile
option add *Spinbox.font textfont startupFile
+ option add *Listbox.font mainfont startupFile
}
# Make a menu and submenus.
--
1.6.6.5.ge408
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] gitk: Disable option when themed widgets are not available
2010-01-13 20:40 ` [PATCH 3/5] gitk: Set the font for all listbox widgets Mark Hills
@ 2010-01-13 20:40 ` Mark Hills
2010-01-13 20:40 ` [PATCH 5/5] gitk: Use consistent font for all text input fields Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Disable the widget instead of using the label to indicate that themed
widgets are not available.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gitk b/gitk
index 3cdc31e..54f4fb3 100755
--- a/gitk
+++ b/gitk
@@ -10736,14 +10736,14 @@ proc doprefs {} {
${NS}::label $top.lgen -text [mc "General options"]
grid $top.lgen - -sticky w -pady 10
- ${NS}::checkbutton $top.want_ttk -variable want_ttk \
- -text [mc "Use themed widgets"]
if {$have_ttk} {
- ${NS}::label $top.ttk_note -text [mc "(change requires restart)"]
+ ${NS}::checkbutton $top.want_ttk -variable want_ttk \
+ -text [mc "Use themed widgets (change requires restart)"]
} else {
- ${NS}::label $top.ttk_note -text [mc "(currently unavailable)"]
+ ${NS}::checkbutton $top.want_ttk \
+ -text [mc "Use themed widgets"] -state disabled
}
- grid x $top.want_ttk $top.ttk_note -sticky w
+ grid x $top.want_ttk - -sticky w
${NS}::label $top.cdisp -text [mc "Colors: press to choose"]
grid $top.cdisp - -sticky w -pady 10
--
1.6.6.5.ge408
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] gitk: Use consistent font for all text input fields
2010-01-13 20:40 ` [PATCH 4/5] gitk: Disable option when themed widgets are not available Mark Hills
@ 2010-01-13 20:40 ` Mark Hills
0 siblings, 0 replies; 7+ messages in thread
From: Mark Hills @ 2010-01-13 20:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
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 | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gitk b/gitk
index 54f4fb3..1f5f456 100755
--- a/gitk
+++ b/gitk
@@ -1877,7 +1877,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
@@ -2176,7 +2177,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 \
@@ -2219,7 +2220,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
@@ -4039,7 +4040,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.5.ge408
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/5] gitk: Remove forced use of sans-serif font
@ 2009-12-28 20:03 Mark Hills
2009-12-28 20:04 ` [PATCH 2/5] gitk: Set the font for all spinbox widgets Mark Hills
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hills @ 2009-12-28 20:03 UTC (permalink / raw)
To: git
The X resources set using uifont cover this case.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk-git/gitk | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 364c7a8..c58fd58 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -10513,7 +10513,6 @@ proc mkfontdisp {font top which} {
set fontpref($font) [set $font]
${NS}::button $top.${font}but -text $which \
-command [list choosefont $font $which]
- if {!$use_ttk} {$top.${font}but configure -font optionfont}
${NS}::label $top.$font -relief flat -font $font \
-text $fontattr($font,family) -justify left
grid x $top.${font}but $top.$font -sticky w
@@ -10776,15 +10775,6 @@ proc doprefs {} {
mkfontdisp textfont $top [mc "Diff display font"]
mkfontdisp uifont $top [mc "User interface font"]
- if {!$use_ttk} {
- foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
- ldiff lattr extdifff.l extdifff.b bgbut fgbut
- diffoldbut diffnewbut hunksepbut markbgbut selbgbut
- want_ttk ttk_note} {
- $top.$w configure -font optionfont
- }
- }
-
${NS}::frame $top.buts
${NS}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active
${NS}::button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal
@@ -11396,8 +11386,6 @@ namespace import ::msgcat::mc
catch {source ~/.gitk}
-font create optionfont -family sans-serif -size -12
-
parsefont mainfont $mainfont
eval font create mainfont [fontflags mainfont]
eval font create mainfontbold [fontflags mainfont 1]
--
1.6.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] gitk: Set the font for all spinbox widgets
2009-12-28 20:03 [PATCH 1/5] gitk: Remove forced use of sans-serif font Mark Hills
@ 2009-12-28 20:04 ` Mark Hills
0 siblings, 0 replies; 7+ messages in thread
From: Mark Hills @ 2009-12-28 20:04 UTC (permalink / raw)
To: git
Use the X resources to set the font, removing the need to set the font
for specific widgets.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
gitk-git/gitk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index c58fd58..299a2ae 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -1876,6 +1876,7 @@ proc setoptions {} {
option add *Message.font uifont startupFile
option add *Entry.font uifont startupFile
option add *Labelframe.font uifont startupFile
+ option add *Spinbox.font textfont startupFile
}
# Make a menu and submenus.
@@ -2226,7 +2227,7 @@ proc makewindow {} {
-command changediffdisp -variable diffelide -value {1 0}
${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: "
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
- spinbox .bleft.mid.diffcontext -width 5 -font textfont \
+ spinbox .bleft.mid.diffcontext -width 5 \
-from 0 -increment 1 -to 10000000 \
-validate all -validatecommand "diffcontextvalidate %P" \
-textvariable diffcontextstring
--
1.6.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-01-13 20:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 20:40 [PATCH resend] gitk: font and theme use Mark Hills
2010-01-13 20:40 ` [PATCH 1/5] gitk: Remove forced use of sans-serif font Mark Hills
2010-01-13 20:40 ` [PATCH 2/5] gitk: Set the font for all spinbox widgets Mark Hills
2010-01-13 20:40 ` [PATCH 3/5] gitk: Set the font for all listbox widgets Mark Hills
2010-01-13 20:40 ` [PATCH 4/5] gitk: Disable option when themed widgets are not available Mark Hills
2010-01-13 20:40 ` [PATCH 5/5] gitk: Use consistent font for all text input fields Mark Hills
-- strict thread matches above, loose matches on Subject: below --
2009-12-28 20:03 [PATCH 1/5] gitk: Remove forced use of sans-serif font Mark Hills
2009-12-28 20:04 ` [PATCH 2/5] gitk: Set the font for all spinbox widgets Mark Hills
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 NNTP newsgroup(s).