From: Nelson Elhage <nelhage@MIT.EDU>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org, Nelson Elhage <nelhage@mit.edu>
Subject: [PATCH] gitk: Let the ttk theme be controllable via preferences.
Date: Sun, 4 Jul 2010 11:17:45 -0400 [thread overview]
Message-ID: <1278256665-29034-1-git-send-email-nelhage@mit.edu> (raw)
Signed-off-by: Nelson Elhage <nelhage@mit.edu>
---
gitk-git/gitk | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1b0e09a..8790cee 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2626,7 +2626,7 @@ proc savestuff {w} {
global cmitmode wrapcomment datetimeformat limitdiffs
global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
global autoselect extdifftool perfile_attrs markbgcolor use_ttk
- global hideremotes want_ttk
+ global hideremotes want_ttk ttk_theme
if {$stuffsaved} return
if {![winfo viewable .]} return
@@ -2653,6 +2653,7 @@ proc savestuff {w} {
puts $f [list set limitdiffs $limitdiffs]
puts $f [list set uicolor $uicolor]
puts $f [list set want_ttk $want_ttk]
+ puts $f [list set ttk_theme $ttk_theme]
puts $f [list set bgcolor $bgcolor]
puts $f [list set fgcolor $fgcolor]
puts $f [list set colors $colors]
@@ -10696,7 +10697,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect extdifftool perfile_attrs
- global hideremotes want_ttk have_ttk
+ global hideremotes want_ttk have_ttk ttk_theme
set top .gitkprefs
set prefstop $top
@@ -10705,7 +10706,8 @@ proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk \
+ ttk_theme} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
@@ -10764,6 +10766,17 @@ proc doprefs {} {
}
grid x $top.want_ttk $top.ttk_note -sticky w
+ if {$have_ttk} {
+ ttk::combobox $top.ttk_theme -textvariable ttk_theme \
+ -values [ttk::style theme names]
+ $top.ttk_theme state readonly
+ if {!$use_ttk} {
+ $top.ttk_theme state disabled
+ }
+ ${NS}::label $top.lttk_theme -text [mc "Theme"]
+ grid x $top.lttk_theme $top.ttk_theme -sticky w
+ }
+
${NS}::label $top.cdisp -text [mc "Colors: press to choose"]
grid $top.cdisp - -sticky w -pady 10
label $top.ui -padx 40 -relief sunk -background $uicolor
@@ -10892,7 +10905,8 @@ proc prefscan {} {
global oldprefs prefstop
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk \
+ ttk_theme} {
global $v
set $v $oldprefs($v)
}
@@ -10906,7 +10920,7 @@ proc prefsok {} {
global oldprefs prefstop showneartags showlocalchanges
global fontpref mainfont textfont uifont
global limitdiffs treediffs perfile_attrs
- global hideremotes
+ global hideremotes use_ttk ttk_theme
catch {destroy $prefstop}
unset prefstop
@@ -10955,6 +10969,9 @@ proc prefsok {} {
if {$hideremotes != $oldprefs(hideremotes)} {
rereadrefs
}
+ if {$use_ttk && $ttk_theme != $oldprefs(ttk_theme)} {
+ ttk::style theme use $ttk_theme
+ }
}
proc formatdate {d} {
@@ -11369,6 +11386,7 @@ set datetimeformat "%Y-%m-%d %H:%M:%S"
set autoselect 1
set perfile_attrs 0
set want_ttk 1
+set ttk_theme "default"
if {[tk windowingsystem] eq "aqua"} {
set extdifftool "opendiff"
@@ -11519,6 +11537,10 @@ if {![info exists have_ttk]} {
set use_ttk [expr {$have_ttk && $want_ttk}]
set NS [expr {$use_ttk ? "ttk" : ""}]
+if {$use_ttk} {
+ ttk::style theme use $ttk_theme
+}
+
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
set runq {}
--
1.7.1.1
reply other threads:[~2010-07-04 15:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278256665-29034-1-git-send-email-nelhage@mit.edu \
--to=nelhage@mit.edu \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).