# HG changeset patch # User Robert Bauck Hamar # Date 2009-02-07 17:46:13 # Node ID db366ec8d0a4a22539027b4086b0fc989d508d15 # Parent 26bdb71091703c54213435ffa18ca00908460d96 hgk: Add background colour setting Adds the bgcolor config variable, that sets the background colour of the text and canvas frames. diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -439,7 +439,7 @@ proc makewindow {} { global entries sha1entry sha1string sha1but global maincursor textcursor curtextcursor global rowctxmenu gaudydiff mergemax - global hgvdiff + global hgvdiff bgcolor menu .bar .bar add cascade -label "File" -menu .bar.file @@ -478,16 +478,16 @@ proc makewindow {} { .ctop add .ctop.top set canv .ctop.top.clist.canv canvas $canv -height $geometry(canvh) -width $geometry(canv1) \ - -bg white -bd 0 \ + -bg $bgcolor -bd 0 \ -yscrollincr $linespc -yscrollcommand "$cscroll set" -selectbackground grey .ctop.top.clist add $canv set canv2 .ctop.top.clist.canv2 canvas $canv2 -height $geometry(canvh) -width $geometry(canv2) \ - -bg white -bd 0 -yscrollincr $linespc -selectbackground grey + -bg $bgcolor -bd 0 -yscrollincr $linespc -selectbackground grey .ctop.top.clist add $canv2 set canv3 .ctop.top.clist.canv3 canvas $canv3 -height $geometry(canvh) -width $geometry(canv3) \ - -bg white -bd 0 -yscrollincr $linespc -selectbackground grey + -bg $bgcolor -bd 0 -yscrollincr $linespc -selectbackground grey .ctop.top.clist add $canv3 bind .ctop.top.clist {resizeclistpanes %W %w} @@ -547,7 +547,7 @@ proc makewindow {} { .ctop add .ctop.cdet frame .ctop.cdet.left set ctext .ctop.cdet.left.ctext - text $ctext -bg white -state disabled -font $textfont \ + text $ctext -bg $bgcolor -state disabled -font $textfont \ -width $geometry(ctextw) -height $geometry(ctexth) \ -yscrollcommand ".ctop.cdet.left.sb set" \ -xscrollcommand ".ctop.cdet.left.hb set" -wrap none @@ -581,7 +581,7 @@ proc makewindow {} { frame .ctop.cdet.right set cflist .ctop.cdet.right.cfiles - listbox $cflist -bg white -selectmode extended -width $geometry(cflistw) \ + listbox $cflist -bg $bgcolor -selectmode extended -width $geometry(cflistw) \ -yscrollcommand ".ctop.cdet.right.sb set" scrollbar .ctop.cdet.right.sb -command "$cflist yview" pack .ctop.cdet.right.sb -side right -fill y @@ -679,7 +679,7 @@ proc click {w} { proc savestuff {w} { global canv canv2 canv3 ctext cflist mainfont textfont global stuffsaved findmergefiles gaudydiff maxgraphpct - global maxwidth authorcolors curidfont + global maxwidth authorcolors curidfont bgcolor if {$stuffsaved} return if {![winfo viewable .]} return @@ -721,6 +721,7 @@ proc savestuff {w} { puts $f "# the last entry will be reused." puts $f "#" puts $f "set authorcolors {$authorcolors}" + puts $f "set bgcolor $bgcolor" close $f file rename -force "~/.hgk-new" "~/.hgk" } @@ -3891,6 +3892,7 @@ set colors {green red blue magenta darkg set authorcolors { black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey } +set bgcolor white catch {source ~/.hgk}