{"thread":{"id":"8246","subject":"[PATCH] gitk - Allow specifying tabstop as other than default 8 characters.","startedAt":"2007-05-20T15:45:49Z","lastAt":"2007-05-20T16:14:40Z","messageCount":4,"participants":["Mark Levedahl"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"42720","messageId":"11796759503065-git-send-email-mdl123@verizon.net","threadId":"8246","inReplyTo":null,"subject":"[PATCH] gitk - Update fontsize in patch / tree list","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-05-20T15:45:49Z","receivedAt":"2007-05-20T15:45:49Z","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 530f8e1..4a15d7b 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.rc3.95.gb3c7e\n"},{"id":"42719","messageId":"11796759513709-git-send-email-mdl123@verizon.net","threadId":"8246","inReplyTo":"11796759503065-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-05-20T15:45:50Z","receivedAt":"2007-05-20T15:45:50Z","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 = one 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 4a15d7b..801c39d 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+    entry $top.tabstop -width 10 -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.rc3.95.gb3c7e\n"},{"id":"42726","messageId":"11796775683753-git-send-email-mdl123@verizon.net","threadId":"8246","inReplyTo":"11796759513709-git-send-email-mdl123@verizon.net","subject":"[PATCH] gitk - Make selection highlight color configurable","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-05-20T16:12:48Z","receivedAt":"2007-05-20T16:12:48Z","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 a57e84c..530f8e1 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.bg 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.rc3.95.gb3c7e\n"},{"id":"42728","messageId":"465073F0.8030608@verizon.net","threadId":"8246","inReplyTo":"11796759513709-git-send-email-mdl123@verizon.net","subject":"Re: [PATCH] gitk - Allow specifying tabstop as other than default 8 characters.","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-05-20T16:14:40Z","receivedAt":"2007-05-20T16:14:40Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Mark Levedahl wrote:\n> Not all projects use the convention that one tabstop = 8 characters, and...\n>   \n...except that I forgot to include the first patch in the series to \nallow changing highlight color, that one follows\nand must be applied first or this patch will not apply.\n\nMark\n"}]}