{"thread":{"id":"8714","subject":"Mark Levedahl's gitk patches","startedAt":"2007-06-25T16:05:24Z","lastAt":"2007-06-28T00:15:21Z","messageCount":11,"participants":["Johannes Sixt","Mark Levedahl","Paul Mackerras","Brian Downing","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"45776","messageId":"467FE7C4.5E421535@eudaptics.com","threadId":"8714","inReplyTo":null,"subject":"Mark Levedahl's gitk patches","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-06-25T16:05:24Z","receivedAt":"2007-06-25T16:05:24Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Is there a chance that we get Mark Levedahl's gitk patches into 1.5.3:\n\ngitk - Allow specifying tabstop as other than default 8 characters.\n    http://article.gmane.org/gmane.comp.version-control.git/47844\n\ngitk - Update fontsize in patch / tree list\n    http://article.gmane.org/gmane.comp.version-control.git/47845\n\ngitk - Make selection highlight color configurable\n    http://article.gmane.org/gmane.comp.version-control.git/47851\n\nI'm mostly interested in the last one because the highlight color is\nalso a serious issue under MinGW.\n\n-- Hannes\n"},{"id":"45813","messageId":"46807CEF.2010109@verizon.net","threadId":"8714","inReplyTo":"467FE7C4.5E421535@eudaptics.com","subject":"Re: Mark Levedahl's gitk patches","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-26T02:41:51Z","receivedAt":"2007-06-26T02:41:51Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Sixt wrote:\n> Is there a chance that we get Mark Levedahl's gitk patches into 1.5.3:\n>\n>   \nI found a bug in the highlight patch (the color picker updated the wrong \npanel in the chooser but did set the correct color), and updated the \ntab-stop patch to use a spin control to enforce entry of small integers \nonly. As there is possible interest, I am sending the amended series.\n\nMark\n"},{"id":"45814","messageId":"1182825801300-git-send-email-mdl123@verizon.net","threadId":"8714","inReplyTo":"46807CEF.2010109@verizon.net","subject":"[PATCH] gitk - Make selection highlight color configurable","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-26T02:43:19Z","receivedAt":"2007-06-26T02:43:19Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Cygwin's tk by default uses a very dark selection background color that\nmakes the currently selected text almost unreadable. On linux, the default\nselection background is a light gray which is very usable. This makes the\ndefault a light gray everywhere but allows the user to configure the\ncolor as well.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |   26 +++++++++++++++++++++++---\n 1 files changed, 23 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 87c3690..cd9456e 100755\n--- a/gitk\n+++ b/gitk\n@@ -402,7 +402,7 @@ proc makewindow {} {\n     global rowctxmenu mergemax wrapcomment\n     global highlight_files gdttype\n     global searchstring sstring\n-    global bgcolor fgcolor bglist fglist diffcolors\n+    global bgcolor fgcolor bglist fglist diffcolors selectbgcolor\n     global headctxmenu\n \n     menu .bar\n@@ -457,15 +457,18 @@ proc makewindow {} {\n     set cscroll .tf.histframe.csb\n     set canv .tf.histframe.pwclist.canv\n     canvas $canv \\\n+\t-selectbackground $selectbgcolor \\\n \t-background $bgcolor -bd 0 \\\n \t-yscrollincr $linespc -yscrollcommand \"scrollcanv $cscroll\"\n     .tf.histframe.pwclist add $canv\n     set canv2 .tf.histframe.pwclist.canv2\n     canvas $canv2 \\\n+\t-selectbackground $selectbgcolor \\\n \t-background $bgcolor -bd 0 -yscrollincr $linespc\n     .tf.histframe.pwclist add $canv2\n     set canv3 .tf.histframe.pwclist.canv3\n     canvas $canv3 \\\n+\t-selectbackground $selectbgcolor \\\n \t-background $bgcolor -bd 0 -yscrollincr $linespc\n     .tf.histframe.pwclist add $canv3\n     eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0)\n@@ -666,6 +669,7 @@ proc makewindow {} {\n     set cflist .bright.cfiles\n     set indent [font measure $mainfont \"nn\"]\n     text $cflist \\\n+\t-selectbackground $selectbgcolor \\\n \t-background $bgcolor -foreground $fgcolor \\\n \t-font $mainfont \\\n \t-tabs [list $indent [expr {2 * $indent}]] \\\n@@ -825,7 +829,7 @@ proc savestuff {w} {\n     global maxwidth showneartags\n     global viewname viewfiles viewargs viewperm nextviewnum\n     global cmitmode wrapcomment\n-    global colors bgcolor fgcolor diffcolors\n+    global colors bgcolor fgcolor diffcolors selectbgcolor\n \n     if {$stuffsaved} return\n     if {![winfo viewable .]} return\n@@ -844,6 +848,7 @@ proc savestuff {w} {\n \tputs $f [list set fgcolor $fgcolor]\n \tputs $f [list set colors $colors]\n \tputs $f [list set diffcolors $diffcolors]\n+\tputs $f [list set selectbgcolor $selectbgcolor]\n \n \tputs $f \"set geometry(main) [wm geometry .]\"\n \tputs $f \"set geometry(topwidth) [winfo width .tf]\"\n@@ -5845,7 +5850,7 @@ proc doquit {} {\n proc doprefs {} {\n     global maxwidth maxgraphpct diffopts\n     global oldprefs prefstop showneartags\n-    global bgcolor fgcolor ctext diffcolors\n+    global bgcolor fgcolor ctext diffcolors selectbgcolor\n     global uifont\n \n     set top .gitkprefs\n@@ -5912,6 +5917,10 @@ proc doprefs {} {\n \t\t      \"diff hunk header\" \\\n \t\t      [list $ctext tag conf hunksep -foreground]]\n     grid x $top.hunksepbut $top.hunksep -sticky w\n+    label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor\n+    button $top.selbgbut -text \"Select bg\" -font optionfont \\\n+\t-command [list choosecolor selectbgcolor 0 $top.selbgsep background setselbg]\n+    grid x $top.selbgbut $top.selbgsep -sticky w\n \n     frame $top.buts\n     button $top.buts.ok -text \"OK\" -command prefsok -default active\n@@ -5936,6 +5945,16 @@ proc choosecolor {v vi w x cmd} {\n     eval $cmd $c\n }\n \n+proc setselbg {c} {\n+    global bglist cflist\n+    foreach w $bglist {\n+\t$w configure -selectbackground $c\n+    }\n+    $cflist tag configure highlight \\\n+\t-background [$cflist cget -selectbackground]\n+    allcanvs itemconf secsel -fill $c\n+}\n+\n proc setbg {c} {\n     global bglist\n \n@@ -6292,6 +6311,7 @@ set colors {green red blue magenta darkgrey brown orange}\n set bgcolor white\n set fgcolor black\n set diffcolors {red \"#00a000\" blue}\n+set selectbgcolor gray85\n \n catch {source ~/.gitk}\n \n-- \n1.5.2.2.282.g9826\n"},{"id":"45815","messageId":"11828258013248-git-send-email-mdl123@verizon.net","threadId":"8714","inReplyTo":"1182825801300-git-send-email-mdl123@verizon.net","subject":"[PATCH] gitk - Update fontsize in patch / tree list","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-26T02:43:20Z","receivedAt":"2007-06-26T02:43:20Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"When adjusting fontsize (using ctrl+/-), all panes except the lower right\nwere updated. This fixes that.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex cd9456e..62eefd9 100755\n--- a/gitk\n+++ b/gitk\n@@ -4695,13 +4695,14 @@ proc redisplay {} {\n }\n \n proc incrfont {inc} {\n-    global mainfont textfont ctext canv phase\n+    global mainfont textfont ctext canv phase cflist\n     global stopped entries\n     unmarkmatches\n     set mainfont [lreplace $mainfont 1 1 [expr {[lindex $mainfont 1] + $inc}]]\n     set textfont [lreplace $textfont 1 1 [expr {[lindex $textfont 1] + $inc}]]\n     setcoords\n     $ctext conf -font $textfont\n+    $cflist conf -font $textfont\n     $ctext tag conf filesep -font [concat $textfont bold]\n     foreach e $entries {\n \t$e conf -font $mainfont\n-- \n1.5.2.2.282.g9826\n"},{"id":"45816","messageId":"1182825801391-git-send-email-mdl123@verizon.net","threadId":"8714","inReplyTo":"11828258013248-git-send-email-mdl123@verizon.net","subject":"[PATCH] gitk - Allow specifying tabstop as other than default 8 characters.","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-26T02:43:21Z","receivedAt":"2007-06-26T02:43:21Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Not all projects use the convention that one tabstop = 8 characters, and\na common convention is to use one tabstop = on level of indent. For such\nprojects, using 8 characters per tabstop often shows too much whitespace\nper indent. This allows the user to configure the number of characters\nto use per tabstop.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |   17 +++++++++++++----\n 1 files changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 62eefd9..06df3bb 100755\n--- a/gitk\n+++ b/gitk\n@@ -395,7 +395,7 @@ proc confirm_popup msg {\n \n proc makewindow {} {\n     global canv canv2 canv3 linespc charspc ctext cflist\n-    global textfont mainfont uifont\n+    global textfont mainfont uifont tabstop\n     global findtype findtypemenu findloc findstring fstring geometry\n     global entries sha1entry sha1string sha1but\n     global maincursor textcursor curtextcursor\n@@ -615,6 +615,7 @@ proc makewindow {} {\n     pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left\n     set ctext .bleft.ctext\n     text $ctext -background $bgcolor -foreground $fgcolor \\\n+\t-tabs \"[expr {$tabstop * $charspc}]\" \\\n \t-state disabled -font $textfont \\\n \t-yscrollcommand scrolltext -wrap none\n     scrollbar .bleft.sb -command \"$ctext yview\"\n@@ -824,7 +825,7 @@ proc click {w} {\n }\n \n proc savestuff {w} {\n-    global canv canv2 canv3 ctext cflist mainfont textfont uifont\n+    global canv canv2 canv3 ctext cflist mainfont textfont uifont tabstop\n     global stuffsaved findmergefiles maxgraphpct\n     global maxwidth showneartags\n     global viewname viewfiles viewargs viewperm nextviewnum\n@@ -838,6 +839,7 @@ proc savestuff {w} {\n \tputs $f [list set mainfont $mainfont]\n \tputs $f [list set textfont $textfont]\n \tputs $f [list set uifont $uifont]\n+\tputs $f [list set tabstop $tabstop]\n \tputs $f [list set findmergefiles $findmergefiles]\n \tputs $f [list set maxgraphpct $maxgraphpct]\n \tputs $f [list set maxwidth $maxwidth]\n@@ -4696,12 +4698,13 @@ proc redisplay {} {\n \n proc incrfont {inc} {\n     global mainfont textfont ctext canv phase cflist\n+    global charspc tabstop\n     global stopped entries\n     unmarkmatches\n     set mainfont [lreplace $mainfont 1 1 [expr {[lindex $mainfont 1] + $inc}]]\n     set textfont [lreplace $textfont 1 1 [expr {[lindex $textfont 1] + $inc}]]\n     setcoords\n-    $ctext conf -font $textfont\n+    $ctext conf -font $textfont -tabs \"[expr {$tabstop * $charspc}]\"\n     $cflist conf -font $textfont\n     $ctext tag conf filesep -font [concat $textfont bold]\n     foreach e $entries {\n@@ -5852,7 +5855,7 @@ proc doprefs {} {\n     global maxwidth maxgraphpct diffopts\n     global oldprefs prefstop showneartags\n     global bgcolor fgcolor ctext diffcolors selectbgcolor\n-    global uifont\n+    global uifont tabstop\n \n     set top .gitkprefs\n     set prefstop $top\n@@ -5890,6 +5893,9 @@ proc doprefs {} {\n     checkbutton $top.ntag.b -variable showneartags\n     pack $top.ntag.b $top.ntag.l -side left\n     grid x $top.ntag -sticky w\n+    label $top.tabstopl -text \"tabstop\" -font optionfont\n+    spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop\n+    grid x $top.tabstopl $top.tabstop -sticky w\n \n     label $top.cdisp -text \"Colors: press to choose\"\n     $top.cdisp configure -font $uifont\n@@ -5988,9 +5994,11 @@ proc prefscan {} {\n proc prefsok {} {\n     global maxwidth maxgraphpct\n     global oldprefs prefstop showneartags\n+    global charspc ctext tabstop\n \n     catch {destroy $prefstop}\n     unset prefstop\n+    $ctext configure -tabs \"[expr {$tabstop * $charspc}]\"\n     if {$maxwidth != $oldprefs(maxwidth)\n \t|| $maxgraphpct != $oldprefs(maxgraphpct)} {\n \tredisplay\n@@ -6296,6 +6304,7 @@ if {$tclencoding == {}} {\n set mainfont {Helvetica 9}\n set textfont {Courier 9}\n set uifont {Helvetica 9 bold}\n+set tabstop 8\n set findmergefiles 0\n set maxgraphpct 50\n set maxwidth 16\n-- \n1.5.2.2.282.g9826\n"},{"id":"45818","messageId":"18048.36797.283166.952377@cargo.ozlabs.ibm.com","threadId":"8714","inReplyTo":"46807CEF.2010109@verizon.net","subject":"Re: Mark Levedahl's gitk patches","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2007-06-26T04:02:05Z","receivedAt":"2007-06-26T04:02:05Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Mark Levedahl writes:\n\n> I found a bug in the highlight patch (the color picker updated the wrong \n> panel in the chooser but did set the correct color), and updated the \n> tab-stop patch to use a spin control to enforce entry of small integers \n> only. As there is possible interest, I am sending the amended series.\n\nAh.  I just pushed out a pile of patches to gitk.git including your\nthree.  Could you do an incremental patch on top of that for me?\n\nThanks,\nPaul.\n"},{"id":"45841","messageId":"20070626175452.GS4087@lavos.net","threadId":"8714","inReplyTo":"1182825801300-git-send-email-mdl123@verizon.net","subject":"Re: [PATCH] gitk - Make selection highlight color configurable","fromName":"Brian Downing","fromEmail":"bdowning@lavos.net","sentAt":"2007-06-26T17:54:52Z","receivedAt":"2007-06-26T17:54:52Z","isPatch":true,"sender":{"key":"bdowning@lavos.net","avatar":"https://avatars.githubusercontent.com/u/366426?v=4"},"body":"Mark Levedahl wrote:\n> Cygwin's tk by default uses a very dark selection background color\n> that makes the currently selected text almost unreadable. On linux,\n> the default selection background is a light gray which is very usable.\n> This makes the default a light gray everywhere but allows the user to\n> configure the color as well.\n\nI noticed this, and also noticed that the dark color in question was\nin fact the default Windows selection background color.  Unfortunately,\nwish/gitk doesn't also use the default Windows selection foreground color\n(white), so the result is pretty unreadable.\n\nWhen playing with Git on Windows I worked around the problem by changing\nthe selection color system-wide.\n\n(This patch is perhaps better than making it work the \"Windows way\"\nwith the right system foreground color, though, as the tag and branch\nmarkers are also pretty ugly against a dark background...)\n\n-bcd\n-- \n*** Brian Downing <bdowning@lavos.net> \n"},{"id":"45864","messageId":"7v645axm7r.fsf@assigned-by-dhcp.pobox.com","threadId":"8714","inReplyTo":"18048.36797.283166.952377@cargo.ozlabs.ibm.com","subject":"Re: Mark Levedahl's gitk patches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-27T00:41:44Z","receivedAt":"2007-06-27T00:41:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Mackerras <paulus@samba.org> writes:\n\n> Mark Levedahl writes:\n>\n>> I found a bug in the highlight patch (the color picker updated the wrong \n>> panel in the chooser but did set the correct color), and updated the \n>> tab-stop patch to use a spin control to enforce entry of small integers \n>> only. As there is possible interest, I am sending the amended series.\n>\n> Ah.  I just pushed out a pile of patches to gitk.git including your\n> three.  Could you do an incremental patch on top of that for me?\n\nI took a look at differences between your gitk.git and what I\nhave.  It appears that our \"proc readrefs\" differ a bit.\n\nMost notably, the global hash tagcontents is read when readrefs\nrun in the version I have, while gitk.git version fills it\nlazily in showtag, where it is actually used.  Because you read\nthe refs using \"show-ref -d\", you do not need to do extra forks\nto figure out the objects referred to by the tags in your code.\n\nI think what you have is a lot better from interactive latency\npoint of view.  I'll take the version from gitk.git and push the\nresults out.\n"},{"id":"45873","messageId":"11829090952211-git-send-email-mdl123@verizon.net","threadId":"8714","inReplyTo":"18048.36797.283166.952377@cargo.ozlabs.ibm.com","subject":"[PATCH] gitk - bugfix - Update selection background colorbar in prefs dialog","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-27T01:51:34Z","receivedAt":"2007-06-27T01:51:34Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"The callback function was incorrectly set to update the background\ncolorbar when updated the selection background. This did not affect the\ncolors chosen or their use, just their presentation in the preferences\ndialog box.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 269f9b0..c06d327 100755\n--- a/gitk\n+++ b/gitk\n@@ -7004,7 +7004,7 @@ proc doprefs {} {\n     grid x $top.hunksepbut $top.hunksep -sticky w\n     label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor\n     button $top.selbgbut -text \"Select bg\" -font optionfont \\\n-\t-command [list choosecolor selectbgcolor 0 $top.bg background setselbg]\n+\t-command [list choosecolor selectbgcolor 0 $top.selbgsep background setselbg]\n     grid x $top.selbgbut $top.selbgsep -sticky w\n \n     frame $top.buts\n-- \n1.5.2.2.282.g9826\n"},{"id":"45872","messageId":"118290910058-git-send-email-mdl123@verizon.net","threadId":"8714","inReplyTo":"11829090952211-git-send-email-mdl123@verizon.net","subject":"[PATCH] gitk - Use a spinbox for setting tabstop settings","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-06-27T01:51:35Z","receivedAt":"2007-06-27T01:51:35Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"The tabstop must be a smallish positive integer, and a spinbox is the\naccepted UI control to accomplish this limiting rather than the text\nentry box previously used.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex c06d327..2d6a6ef 100755\n--- a/gitk\n+++ b/gitk\n@@ -6972,7 +6972,7 @@ proc doprefs {} {\n     pack $top.ntag.b $top.ntag.l -side left\n     grid x $top.ntag -sticky w\n     label $top.tabstopl -text \"tabstop\" -font optionfont\n-    entry $top.tabstop -width 10 -textvariable tabstop\n+    spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop\n     grid x $top.tabstopl $top.tabstop -sticky w\n \n     label $top.cdisp -text \"Colors: press to choose\"\n-- \n1.5.2.2.282.g9826\n"},{"id":"45940","messageId":"18050.64921.235580.37028@cargo.ozlabs.ibm.com","threadId":"8714","inReplyTo":"7v645axm7r.fsf@assigned-by-dhcp.pobox.com","subject":"Re: Mark Levedahl's gitk patches","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2007-06-28T00:15:21Z","receivedAt":"2007-06-28T00:15:21Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Junio C Hamano writes:\n\n> I took a look at differences between your gitk.git and what I\n> have.  It appears that our \"proc readrefs\" differ a bit.\n> \n> Most notably, the global hash tagcontents is read when readrefs\n> run in the version I have, while gitk.git version fills it\n> lazily in showtag, where it is actually used.  Because you read\n> the refs using \"show-ref -d\", you do not need to do extra forks\n> to figure out the objects referred to by the tags in your code.\n\nYes, that was one of the many improvements I made.  Basically I pulled\na lot of stuff over from the 'new' branch.\n\n> I think what you have is a lot better from interactive latency\n> point of view.  I'll take the version from gitk.git and push the\n> results out.\n\nThanks.  I have now pushed out Mark Levedahl's two bug fixes as well.\n\nPaul.\n"}]}