@matheusbsbs / matheus-bagliano / commits / 5497f7a23a
Fork 0

gitk: Add configuration for UI colour scheme

This adds an option to control the global colour scheme in the Edit > Preferences dialog so that the whole interface can have a non-default main colour. Signed-off-by: Guillermo S. Romero <gsromero@infernal-iceberg.com> Signed-off-by: Paul Mackerras <paulus@samba.org>

Guillermo S. Romero committed Oct 15, 2009 at 18:51 UTC 5497f7a23ac11f9b230892220d5ed80263eedd1f
1 file changed +14 -2
gitk
+14 -2
@@ -2519,7 +2519,7 @@ proc savestuff {w} {
2519 global maxwidth showneartags showlocalchanges
2520 global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
2521 global cmitmode wrapcomment datetimeformat limitdiffs
2522 - global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
2522 + global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
2523 global autoselect extdifftool perfile_attrs markbgcolor
2524 global hideremotes
2525
@@ -2546,6 +2546,7 @@ proc savestuff {w} {
2546 puts $f [list set showlocalchanges $showlocalchanges]
2547 puts $f [list set datetimeformat $datetimeformat]
2548 puts $f [list set limitdiffs $limitdiffs]
2549 + puts $f [list set uicolor $uicolor]
2550 puts $f [list set bgcolor $bgcolor]
2551 puts $f [list set fgcolor $fgcolor]
2552 puts $f [list set colors $colors]
@@ -10425,7 +10426,7 @@ proc chg_fontparam {v sub op} {
10426 proc doprefs {} {
10427 global maxwidth maxgraphpct
10428 global oldprefs prefstop showneartags showlocalchanges
10428 - global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10429 + global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10430 global tabstop limitdiffs autoselect extdifftool perfile_attrs
10431 global hideremotes
10432
@@ -10489,6 +10490,10 @@ proc doprefs {} {
10490
10491 label $top.cdisp -text [mc "Colors: press to choose"]
10492 grid $top.cdisp - -sticky w -pady 10
10493 + label $top.ui -padx 40 -relief sunk -background $uicolor
10494 + button $top.uibut -text [mc "Interface"] -font optionfont \
10495 + -command [list choosecolor uicolor {} $top.ui [mc "interface"] setui]
10496 + grid x $top.uibut $top.ui -sticky w
10497 label $top.bg -padx 40 -relief sunk -background $bgcolor
10498 button $top.bgbut -text [mc "Background"] -font optionfont \
10499 -command [list choosecolor bgcolor {} $top.bg [mc "background"] setbg]
@@ -10572,6 +10577,10 @@ proc setselbg {c} {
10577 allcanvs itemconf secsel -fill $c
10578 }
10579
10580 +proc setui {c} {
10581 + tk_setPalette $c
10582 +}
10583 +
10584 proc setbg {c} {
10585 global bglist
10586
@@ -11079,6 +11088,7 @@ if {[tk windowingsystem] eq "aqua"} {
11088 }
11089
11090 set colors {green red blue magenta darkgrey brown orange}
11091 +set uicolor grey85
11092 set bgcolor white
11093 set fgcolor black
11094 set diffcolors {red "#00a000" blue}
@@ -11130,6 +11140,8 @@ eval font create textfontbold [fontflags textfont 1]
11140 parsefont uifont $uifont
11141 eval font create uifont [fontflags uifont]
11142
11143 +tk_setPalette $uicolor
11144 +
11145 setoptions
11146
11147 # check that we can find a .git directory somewhere...