{"thread":{"id":"33299","subject":"[PATCH] gitk: Move hard-coded colors to .gitk","startedAt":"2013-03-27T13:40:51Z","lastAt":"2013-04-02T08:41:51Z","messageCount":4,"participants":["Gauthier Östervall","Ramkumar Ramachandra","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"212376","messageId":"1364391651-5896-1-git-send-email-gauthier@ostervall.se","threadId":"33299","inReplyTo":null,"subject":"[PATCH] gitk: Move hard-coded colors to .gitk","fromName":"Gauthier Östervall","fromEmail":"gauthier@ostervall.se","sentAt":"2013-03-27T13:40:51Z","receivedAt":"2013-03-27T13:40:51Z","isPatch":true,"sender":{"key":"gauthier@ostervall.se","avatar":"https://avatars.githubusercontent.com/u/178409?v=4"},"body":"Colors that are changeable in Preferences gave no sufficient control,\nputting colors in the config file allows for easier configuration and\nsharing of color schemes.\n\nwin32: Make the default foreground color that of window text rather\nthan button text.\n\nSigned-off-by: Gauthier Östervall <gauthier@ostervall.se>\n---\nScreenshot of my current coloring setup using this patch, based on\nzenburn:\nhttp://s11.postimg.org/hozbtsfj7/gitk_zenburn.png\nAnd the .gitk used to that end:\nhttps://gist.github.com/fleutot/5253281\n\n gitk | 149 +++++++++++++++++++++++++++++++++++++++++++++++++------------------\n 1 file changed, 110 insertions(+), 39 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex b3706fc..2edaaa8 100755\n--- a/gitk\n+++ b/gitk\n@@ -2026,6 +2026,9 @@ proc makewindow {} {\n     global highlight_files gdttype\n     global searchstring sstring\n     global bgcolor fgcolor bglist fglist diffcolors selectbgcolor\n+    global uifgcolor uifgdisabledcolor\n+    global filesepbgcolor filesepfgcolor\n+    global mergecolors foundbgcolor currentsearchhitbgcolor\n     global headctxmenu progresscanv progressitem progresscoords statusw\n     global fprogitem fprogcoord lastprogupdate progupdatepending\n     global rprogitem rprogcoord rownumsel numcommits\n@@ -2177,10 +2180,10 @@ proc makewindow {} {\n \t0x00, 0x38, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x00, 0x38, 0x00, 0x1c,\n \t0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01};\n     }\n-    image create bitmap bm-left -data $bm_left_data\n-    image create bitmap bm-left-gray -data $bm_left_data -foreground \"#999\"\n-    image create bitmap bm-right -data $bm_right_data\n-    image create bitmap bm-right-gray -data $bm_right_data -foreground \"#999\"\n+    image create bitmap bm-left -data $bm_left_data -foreground $uifgcolor\n+    image create bitmap bm-left-gray -data $bm_left_data -foreground $uifgdisabledcolor\n+    image create bitmap bm-right -data $bm_right_data -foreground $uifgcolor\n+    image create bitmap bm-right-gray -data $bm_right_data -foreground $uifgdisabledcolor\n \n     ${NS}::button .tf.bar.leftbut -command goback -state disabled -width 26\n     if {$use_ttk} {\n@@ -2349,32 +2352,32 @@ proc makewindow {} {\n     lappend fglist $ctext\n \n     $ctext tag conf comment -wrap $wrapcomment\n-    $ctext tag conf filesep -font textfontbold -back \"#aaaaaa\"\n+    $ctext tag conf filesep -font textfontbold -fore $filesepfgcolor -back $filesepbgcolor\n     $ctext tag conf hunksep -fore [lindex $diffcolors 2]\n     $ctext tag conf d0 -fore [lindex $diffcolors 0]\n     $ctext tag conf dresult -fore [lindex $diffcolors 1]\n-    $ctext tag conf m0 -fore red\n-    $ctext tag conf m1 -fore blue\n-    $ctext tag conf m2 -fore green\n-    $ctext tag conf m3 -fore purple\n-    $ctext tag conf m4 -fore brown\n-    $ctext tag conf m5 -fore \"#009090\"\n-    $ctext tag conf m6 -fore magenta\n-    $ctext tag conf m7 -fore \"#808000\"\n-    $ctext tag conf m8 -fore \"#009000\"\n-    $ctext tag conf m9 -fore \"#ff0080\"\n-    $ctext tag conf m10 -fore cyan\n-    $ctext tag conf m11 -fore \"#b07070\"\n-    $ctext tag conf m12 -fore \"#70b0f0\"\n-    $ctext tag conf m13 -fore \"#70f0b0\"\n-    $ctext tag conf m14 -fore \"#f0b070\"\n-    $ctext tag conf m15 -fore \"#ff70b0\"\n+    $ctext tag conf m0 -fore [lindex $mergecolors 0]\n+    $ctext tag conf m1 -fore [lindex $mergecolors 1]\n+    $ctext tag conf m2 -fore [lindex $mergecolors 2]\n+    $ctext tag conf m3 -fore [lindex $mergecolors 3]\n+    $ctext tag conf m4 -fore [lindex $mergecolors 4]\n+    $ctext tag conf m5 -fore [lindex $mergecolors 5]\n+    $ctext tag conf m6 -fore [lindex $mergecolors 6]\n+    $ctext tag conf m7 -fore [lindex $mergecolors 7]\n+    $ctext tag conf m8 -fore [lindex $mergecolors 8]\n+    $ctext tag conf m9 -fore [lindex $mergecolors 9]\n+    $ctext tag conf m10 -fore [lindex $mergecolors 10]\n+    $ctext tag conf m11 -fore [lindex $mergecolors 11]\n+    $ctext tag conf m12 -fore [lindex $mergecolors 12]\n+    $ctext tag conf m13 -fore [lindex $mergecolors 13]\n+    $ctext tag conf m14 -fore [lindex $mergecolors 14]\n+    $ctext tag conf m15 -fore [lindex $mergecolors 15]\n     $ctext tag conf mmax -fore darkgrey\n     set mergemax 16\n     $ctext tag conf mresult -font textfontbold\n     $ctext tag conf msep -font textfontbold\n-    $ctext tag conf found -back yellow\n-    $ctext tag conf currentsearchhit -back orange\n+    $ctext tag conf found -back $foundbgcolor\n+    $ctext tag conf currentsearchhit -back $currentsearchhitbgcolor\n     $ctext tag conf wwrap -wrap word\n \n     .pwbottom add .bleft\n@@ -2721,6 +2724,14 @@ proc savestuff {w} {\n     global viewname viewfiles viewargs viewargscmd viewperm nextviewnum\n     global cmitmode wrapcomment datetimeformat limitdiffs\n     global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor\n+    global uifgcolor uifgdisabledcolor\n+    global headbgcolor headfgcolor headoutlinecolor remotebgcolor\n+    global tagbgcolor tagfgcolor tagoutlinecolor\n+    global reflinecolor filesepbgcolor filesepfgcolor\n+    global mergecolors foundbgcolor currentsearchhitbgcolor\n+    global linehoverbgcolor linehoverfgcolor linehoveroutlinecolor circlecolors\n+    global mainheadcirclecolor workingfilescirclecolor indexcirclecolor\n+    global linkfgcolor circleoutlinecolor\n     global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk\n     global hideremotes want_ttk maxrefs\n \n@@ -2753,13 +2764,37 @@ proc savestuff {w} {\n \tputs $f [list set want_ttk $want_ttk]\n \tputs $f [list set bgcolor $bgcolor]\n \tputs $f [list set fgcolor $fgcolor]\n+\tputs $f [list set uifgcolor $uifgcolor]\n+\tputs $f [list set uifgdisabledcolor $uifgdisabledcolor]\n \tputs $f [list set colors $colors]\n \tputs $f [list set diffcolors $diffcolors]\n+\tputs $f [list set mergecolors $mergecolors]\n \tputs $f [list set markbgcolor $markbgcolor]\n \tputs $f [list set diffcontext $diffcontext]\n \tputs $f [list set selectbgcolor $selectbgcolor]\n+\tputs $f [list set foundbgcolor $foundbgcolor]\n+\tputs $f [list set currentsearchhitbgcolor $currentsearchhitbgcolor]\n \tputs $f [list set extdifftool $extdifftool]\n \tputs $f [list set perfile_attrs $perfile_attrs]\n+\tputs $f [list set headbgcolor $headbgcolor]\n+\tputs $f [list set headfgcolor $headfgcolor]\n+\tputs $f [list set headoutlinecolor $headoutlinecolor]\n+\tputs $f [list set remotebgcolor $remotebgcolor]\n+\tputs $f [list set tagbgcolor $tagbgcolor]\n+\tputs $f [list set tagfgcolor $tagfgcolor]\n+\tputs $f [list set tagoutlinecolor $tagoutlinecolor]\n+\tputs $f [list set reflinecolor $reflinecolor]\n+\tputs $f [list set filesepbgcolor $filesepbgcolor]\n+\tputs $f [list set filesepfgcolor $filesepfgcolor]\n+\tputs $f [list set linehoverbgcolor $linehoverbgcolor]\n+\tputs $f [list set linehoverfgcolor $linehoverfgcolor]\n+\tputs $f [list set linehoveroutlinecolor $linehoveroutlinecolor]\n+\tputs $f [list set mainheadcirclecolor $mainheadcirclecolor]\n+\tputs $f [list set workingfilescirclecolor $workingfilescirclecolor]\n+\tputs $f [list set indexcirclecolor $indexcirclecolor]\n+\tputs $f [list set circlecolors $circlecolors]\n+\tputs $f [list set linkfgcolor $linkfgcolor]\n+\tputs $f [list set circleoutlinecolor $circleoutlinecolor]\n \n \tputs $f \"set geometry(main) [wm geometry .]\"\n \tputs $f \"set geometry(state) [wm state .]\"\n@@ -5925,15 +5960,17 @@ proc drawcmittext {id row col} {\n     global linehtag linentag linedtag selectedline\n     global canvxmax boldids boldnameids fgcolor markedid\n     global mainheadid nullid nullid2 circleitem circlecolors ctxbut\n+    global mainheadcirclecolor workingfilescirclecolor indexcirclecolor\n+    global circleoutlinecolor\n \n     # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right\n     set listed $cmitlisted($curview,$id)\n     if {$id eq $nullid} {\n-\tset ofill red\n+\tset ofill $workingfilescirclecolor\n     } elseif {$id eq $nullid2} {\n-\tset ofill green\n+\tset ofill $indexcirclecolor\n     } elseif {$id eq $mainheadid} {\n-\tset ofill yellow\n+\tset ofill $mainheadcirclecolor\n     } else {\n \tset ofill [lindex $circlecolors $listed]\n     }\n@@ -5943,21 +5980,21 @@ proc drawcmittext {id row col} {\n     if {$listed <= 2} {\n \tset t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \\\n \t\t   [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \\\n-\t\t   -fill $ofill -outline $fgcolor -width 1 -tags circle]\n+\t\t   -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle]\n     } elseif {$listed == 3} {\n \t# triangle pointing left for left-side commits\n \tset t [$canv create polygon \\\n \t\t   [expr {$x - $orad}] $y \\\n \t\t   [expr {$x + $orad - 1}] [expr {$y - $orad}] \\\n \t\t   [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \\\n-\t\t   -fill $ofill -outline $fgcolor -width 1 -tags circle]\n+\t\t   -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle]\n     } else {\n \t# triangle pointing right for right-side commits\n \tset t [$canv create polygon \\\n \t\t   [expr {$x + $orad - 1}] $y \\\n \t\t   [expr {$x - $orad}] [expr {$y - $orad}] \\\n \t\t   [expr {$x - $orad}] [expr {$y + $orad - 1}] \\\n-\t\t   -fill $ofill -outline $fgcolor -width 1 -tags circle]\n+\t\t   -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle]\n     }\n     set circleitem($row) $t\n     $canv raise $t\n@@ -6345,6 +6382,9 @@ proc drawtags {id x xt y1} {\n     global idtags idheads idotherrefs mainhead\n     global linespc lthickness\n     global canv rowtextx curview fgcolor bgcolor ctxbut\n+    global headbgcolor headfgcolor headoutlinecolor remotebgcolor\n+    global tagbgcolor tagfgcolor tagoutlinecolor\n+    global reflinecolor\n \n     set marks {}\n     set ntags 0\n@@ -6382,7 +6422,7 @@ proc drawtags {id x xt y1} {\n \tset xt [expr {$xt + $delta + $wid + $lthickness + $linespc}]\n     }\n     set t [$canv create line $x $y1 [lindex $xvals end] $y1 \\\n-\t       -width $lthickness -fill black -tags tag.$id]\n+\t       -width $lthickness -fill $reflinecolor -tags tag.$id]\n     $canv lower $t\n     foreach tag $marks x $xvals wid $wvals {\n \tset tag_quoted [string map {% %%} $tag]\n@@ -6393,13 +6433,14 @@ proc drawtags {id x xt y1} {\n \t    # draw a tag\n \t    set t [$canv create polygon $x [expr {$yt + $delta}] $xl $yt \\\n \t\t       $xr $yt $xr $yb $xl $yb $x [expr {$yb - $delta}] \\\n-\t\t       -width 1 -outline black -fill yellow -tags tag.$id]\n+\t\t       -width 1 -outline $tagoutlinecolor -fill $tagbgcolor \\\n+\t\t       -tags tag.$id]\n \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n \t    set rowtextx([rowofcommit $id]) [expr {$xr + $linespc}]\n \t} else {\n \t    # draw a head or other ref\n \t    if {[incr nheads -1] >= 0} {\n-\t\tset col green\n+\t\tset col $headbgcolor\n \t\tif {$tag eq $mainhead} {\n \t\t    set font mainfontbold\n \t\t}\n@@ -6415,10 +6456,10 @@ proc drawtags {id x xt y1} {\n \t\tset yti [expr {$yt + 1}]\n \t\tset xri [expr {$x + $rwid}]\n \t\t$canv create polygon $xi $yti $xri $yti $xri $yb $xi $yb \\\n-\t\t\t-width 0 -fill \"#ffddaa\" -tags tag.$id\n+\t\t\t-width 0 -fill $remotebgcolor -tags tag.$id\n \t    }\n \t}\n-\tset t [$canv create text $xl $y1 -anchor w -text $tag -fill $fgcolor \\\n+\tset t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \\\n \t\t   -font $font -tags [list tag.$id text]]\n \tif {$ntags >= 0} {\n \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n@@ -6799,6 +6840,7 @@ proc appendwithlinks {text tags} {\n \n proc setlink {id lk} {\n     global curview ctext pendinglinks\n+    global linkfgcolor\n \n     if {[string range $id 0 1] eq \"-g\"} {\n       set id [string range $id 2 end]\n@@ -6816,7 +6858,7 @@ proc setlink {id lk} {\n \tset known [commitinview $id $curview]\n     }\n     if {$known} {\n-\t$ctext tag conf $lk -foreground blue -underline 1\n+\t$ctext tag conf $lk -foreground $linkfgcolor -underline 1\n \t$ctext tag bind $lk <1> [list selbyid $id]\n \t$ctext tag bind $lk <Enter> {linkcursor %W 1}\n \t$ctext tag bind $lk <Leave> {linkcursor %W -1}\n@@ -8459,6 +8501,8 @@ proc lineleave {id} {\n proc linehover {} {\n     global hoverx hovery hoverid hovertimer\n     global canv linespc lthickness\n+    global linehoverbgcolor linehoverfgcolor linehoveroutlinecolor\n+\n     global commitinfo\n \n     set text [lindex $commitinfo($hoverid) 0]\n@@ -8472,10 +8516,11 @@ proc linehover {} {\n     set x1 [expr {$x + [font measure mainfont $text] + 2 * $lthickness}]\n     set y1 [expr {$y + $linespc + 2 * $lthickness}]\n     set t [$canv create rectangle $x0 $y0 $x1 $y1 \\\n-\t       -fill \\#ffff80 -outline black -width 1 -tags hover]\n+\t       -fill $linehoverbgcolor -outline $linehoveroutlinecolor \\\n+\t       -width 1 -tags hover]\n     $canv raise $t\n     set t [$canv create text $x $y -anchor nw -text $text -tags hover \\\n-\t       -font mainfont]\n+\t       -font mainfont -fill $linehoverfgcolor]\n     $canv raise $t\n }\n \n@@ -9039,12 +9084,13 @@ proc domktag {} {\n proc redrawtags {id} {\n     global canv linehtag idpos currentid curview cmitlisted markedid\n     global canvxmax iddrawn circleitem mainheadid circlecolors\n+    global mainheadcirclecolor\n \n     if {![commitinview $id $curview]} return\n     if {![info exists iddrawn($id)]} return\n     set row [rowofcommit $id]\n     if {$id eq $mainheadid} {\n-\tset ofill yellow\n+\tset ofill $mainheadcirclecolor\n     } else {\n \tset ofill [lindex $circlecolors $cmitlisted($curview,$id)]\n     }\n@@ -11728,22 +11774,47 @@ if {[tk windowingsystem] eq \"aqua\"} {\n set colors {green red blue magenta darkgrey brown orange}\n if {[tk windowingsystem] eq \"win32\"} {\n     set uicolor SystemButtonFace\n+    set uifgcolor SystemButtonText\n+    set uifgdisabledcolor SystemDisabledText\n     set bgcolor SystemWindow\n-    set fgcolor SystemButtonText\n+    set fgcolor SystemWindowText\n     set selectbgcolor SystemHighlight\n } else {\n     set uicolor grey85\n+    set uifgcolor black\n+    set uifgdisabledcolor \"#999\"\n     set bgcolor white\n     set fgcolor black\n     set selectbgcolor gray85\n }\n set diffcolors {red \"#00a000\" blue}\n set diffcontext 3\n+set mergecolors {red blue green purple brown \"#009090\" magenta \"#808000\" \"#009000\" \"#ff0080\" cyan \"#b07070\" \"#70b0f0\" \"#70f0b0\" \"#f0b070\" \"#ff70b0\"}\n set ignorespace 0\n set worddiff \"\"\n set markbgcolor \"#e0e0ff\"\n \n+set headbgcolor green\n+set headfgcolor black\n+set headoutlinecolor black\n+set remotebgcolor #ffddaa\n+set tagbgcolor yellow\n+set tagfgcolor black\n+set tagoutlinecolor black\n+set reflinecolor black\n+set filesepbgcolor #aaaaaa\n+set filesepfgcolor #6a6a6a\n+set linehoverbgcolor #ffff80\n+set linehoverfgcolor black\n+set linehoveroutlinecolor black\n+set mainheadcirclecolor yellow\n+set workingfilescirclecolor red\n+set indexcirclecolor green\n set circlecolors {white blue gray blue blue}\n+set linkfgcolor blue\n+set circleoutlinecolor $fgcolor\n+set foundbgcolor yellow\n+set currentsearchhitbgcolor orange\n \n # button for popping up context menus\n if {[tk windowingsystem] eq \"aqua\"} {\n-- \n1.8.1.msysgit.1\n"},{"id":"212528","messageId":"CALkWK0mt1cZ22xXFXywQNk7EnZ22kq0KJfbr-GTrSg6iMXF5Yw@mail.gmail.com","threadId":"33299","inReplyTo":"1364391651-5896-1-git-send-email-gauthier@ostervall.se","subject":"Re: [PATCH] gitk: Move hard-coded colors to .gitk","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-03-28T15:23:43Z","receivedAt":"2013-03-28T15:23:43Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Gauthier Östervall wrote:\n> Screenshot of my current coloring setup using this patch, based on\n> zenburn:\n> http://s11.postimg.org/hozbtsfj7/gitk_zenburn.png\n> And the .gitk used to that end:\n> https://gist.github.com/fleutot/5253281\n\nThis is a really cool color theme.  Would we consider shipping some\nthemes with gitk, in contrib/ perhaps?\n"},{"id":"212786","messageId":"20130401071059.GA4427@iris.ozlabs.ibm.com","threadId":"33299","inReplyTo":"1364391651-5896-1-git-send-email-gauthier@ostervall.se","subject":"Re: [PATCH] gitk: Move hard-coded colors to .gitk","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2013-04-01T07:10:59Z","receivedAt":"2013-04-01T07:10:59Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Wed, Mar 27, 2013 at 02:40:51PM +0100, Gauthier Östervall wrote:\n> Colors that are changeable in Preferences gave no sufficient control,\n> putting colors in the config file allows for easier configuration and\n> sharing of color schemes.\n> \n> win32: Make the default foreground color that of window text rather\n> than button text.\n> \n> Signed-off-by: Gauthier Östervall <gauthier@ostervall.se>\n\nThanks, applied.  I reworded the commit message to be clearer and\nalso changed the default filesepfgcolor to black, which is what\nit was previously, for me at least.\n\nPaul.\n"},{"id":"212863","messageId":"CAM8gEgihLehkNSfaKGuxO6Spc=vxF7UAZmWwiTNpXXSjMjVzcA@mail.gmail.com","threadId":"33299","inReplyTo":"CALkWK0mt1cZ22xXFXywQNk7EnZ22kq0KJfbr-GTrSg6iMXF5Yw@mail.gmail.com","subject":"Re: [PATCH] gitk: Move hard-coded colors to .gitk","fromName":"Gauthier Östervall","fromEmail":"gauthier@ostervall.se","sentAt":"2013-04-02T08:41:51Z","receivedAt":"2013-04-02T08:41:51Z","isPatch":true,"sender":{"key":"gauthier@ostervall.se","avatar":"https://avatars.githubusercontent.com/u/178409?v=4"},"body":"On Thu, Mar 28, 2013 at 4:23 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Would we consider shipping some themes with gitk, in contrib/ perhaps?\n\nIt does not seem like anyone is against it. I am not sure how gitk\ndevelopment integrates into git's, but I guess we will have to wait\nuntil the patch is integrated not only to gitk but also to git, before\nhaving themes that require it. Other than that, I think it's a good\nidea!\n"}]}