Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitk: Add a user preference to enable/disable use of themed widgets
author
Paul Mackerras
<paulus@samba.org>
Sat, 5 Sep 2009 12:06:46 +0000
(22:06 +1000)
committer
Paul Mackerras
<paulus@samba.org>
Sat, 5 Sep 2009 12:06:46 +0000
(22:06 +1000)
Also move the hide-remotes option up into the commit display options
in the Edit->Preferences panel, since it affects the commit display
more than the diff display.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
eae7d64
)
diff --git
a/gitk
b/gitk
index 9d8afd839cc54747b12cd367b4d02ef354cf5d6c..4d427e23c6c49d75adff01d2cf91f331892c857f 100755
(executable)
--- a/
gitk
+++ b/
gitk
@@
-2606,7
+2606,7
@@
proc savestuff {w} {
global cmitmode wrapcomment datetimeformat limitdiffs
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
global autoselect extdifftool perfile_attrs markbgcolor use_ttk
global cmitmode wrapcomment datetimeformat limitdiffs
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
global autoselect extdifftool perfile_attrs markbgcolor use_ttk
- global hideremotes
+ global hideremotes
want_ttk
if {$stuffsaved} return
if {![winfo viewable .]} return
if {$stuffsaved} return
if {![winfo viewable .]} return
@@
-2630,6
+2630,7
@@
proc savestuff {w} {
puts $f [list set showlocalchanges $showlocalchanges]
puts $f [list set datetimeformat $datetimeformat]
puts $f [list set limitdiffs $limitdiffs]
puts $f [list set showlocalchanges $showlocalchanges]
puts $f [list set datetimeformat $datetimeformat]
puts $f [list set limitdiffs $limitdiffs]
+ puts $f [list set want_ttk $want_ttk]
puts $f [list set bgcolor $bgcolor]
puts $f [list set fgcolor $fgcolor]
puts $f [list set colors $colors]
puts $f [list set bgcolor $bgcolor]
puts $f [list set fgcolor $fgcolor]
puts $f [list set colors $colors]
@@
-10586,7
+10587,7
@@
proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect extdifftool perfile_attrs
global oldprefs prefstop showneartags showlocalchanges
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect extdifftool perfile_attrs
- global hideremotes
+ global hideremotes
want_ttk have_ttk
set top .gitkprefs
set prefstop $top
set top .gitkprefs
set prefstop $top
@@
-10595,7
+10596,7
@@
proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes} {
+ limitdiffs tabstop perfile_attrs hideremotes
want_ttk
} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
set oldprefs($v) [set $v]
}
ttk_toplevel $top
@@
-10616,6
+10617,9
@@
proc doprefs {} {
${NS}::checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
-variable autoselect
grid x $top.autoselect -sticky w
${NS}::checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
-variable autoselect
grid x $top.autoselect -sticky w
+ ${NS}::checkbutton $top.hideremotes -text [mc "Hide remote refs"] \
+ -variable hideremotes
+ grid x $top.hideremotes -sticky w
${NS}::label $top.ddisp -text [mc "Diff display options"]
grid $top.ddisp - -sticky w -pady 10
${NS}::label $top.ddisp -text [mc "Diff display options"]
grid $top.ddisp - -sticky w -pady 10
@@
-10625,9
+10629,6
@@
proc doprefs {} {
${NS}::checkbutton $top.ntag -text [mc "Display nearby tags"] \
-variable showneartags
grid x $top.ntag -sticky w
${NS}::checkbutton $top.ntag -text [mc "Display nearby tags"] \
-variable showneartags
grid x $top.ntag -sticky w
- ${NS}::checkbutton $top.hideremotes -text [mc "Hide remote refs"] \
- -variable hideremotes
- grid x $top.hideremotes -sticky w
${NS}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
-variable limitdiffs
grid x $top.ldiff -sticky w
${NS}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
-variable limitdiffs
grid x $top.ldiff -sticky w
@@
-10643,6
+10644,17
@@
proc doprefs {} {
pack configure $top.extdifff.l -padx 10
grid x $top.extdifff $top.extdifft -sticky ew
pack configure $top.extdifff.l -padx 10
grid x $top.extdifff $top.extdifft -sticky ew
+ ${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)"]
+ } else {
+ ${NS}::label $top.ttk_note -text [mc "(currently unavailable)"]
+ }
+ grid x $top.want_ttk $top.ttk_note -sticky w
+
${NS}::label $top.cdisp -text [mc "Colors: press to choose"]
grid $top.cdisp - -sticky w -pady 10
label $top.bg -padx 40 -relief sunk -background $bgcolor
${NS}::label $top.cdisp -text [mc "Colors: press to choose"]
grid $top.cdisp - -sticky w -pady 10
label $top.bg -padx 40 -relief sunk -background $bgcolor
@@
-10689,7
+10701,8
@@
proc doprefs {} {
if {!$use_ttk} {
foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
ldiff lattr extdifff.l extdifff.b bgbut fgbut
if {!$use_ttk} {
foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
ldiff lattr extdifff.l extdifff.b bgbut fgbut
- diffoldbut diffnewbut hunksepbut markbgbut selbgbut} {
+ diffoldbut diffnewbut hunksepbut markbgbut selbgbut
+ want_ttk ttk_note} {
$top.$w configure -font optionfont
}
}
$top.$w configure -font optionfont
}
}
@@
-10760,7
+10773,7
@@
proc prefscan {} {
global oldprefs prefstop
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
global oldprefs prefstop
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes} {
+ limitdiffs tabstop perfile_attrs hideremotes
want_ttk
} {
global $v
set $v $oldprefs($v)
}
global $v
set $v $oldprefs($v)
}
@@
-11236,6
+11249,7
@@
set limitdiffs 1
set datetimeformat "%Y-%m-%d %H:%M:%S"
set autoselect 1
set perfile_attrs 0
set datetimeformat "%Y-%m-%d %H:%M:%S"
set autoselect 1
set perfile_attrs 0
+set want_ttk 1
if {[tk windowingsystem] eq "aqua"} {
set extdifftool "opendiff"
if {[tk windowingsystem] eq "aqua"} {
set extdifftool "opendiff"
@@
-11372,10
+11386,12
@@
set nullid2 "0000000000000000000000000000000000000001"
set nullfile "/dev/null"
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
set nullfile "/dev/null"
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
-if {![info exists
us
e_ttk]} {
- set
us
e_ttk [llength [info commands ::ttk::style]]
+if {![info exists
hav
e_ttk]} {
+ set
hav
e_ttk [llength [info commands ::ttk::style]]
}
}
+set use_ttk [expr {$have_ttk && $want_ttk}]
set NS [expr {$use_ttk ? "ttk" : ""}]
set NS [expr {$use_ttk ? "ttk" : ""}]
+
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
set runq {}
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
set runq {}