{"thread":{"id":"12540","subject":"[PATCH v2] gitk: Add horizontal scrollbar to the diff view","startedAt":"2008-03-06T12:38:45Z","lastAt":"2008-03-07T12:16:19Z","messageCount":4,"participants":["Pekka Kaitaniemi","Dirk Süsserott","Paul Mackerras"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"71244","messageId":"20080306123845.GA12115@localdomain","threadId":"12540","inReplyTo":null,"subject":"[PATCH v2] gitk: Add horizontal scrollbar to the diff view","fromName":"Pekka Kaitaniemi","fromEmail":"kaitanie@cc.helsinki.fi","sentAt":"2008-03-06T12:38:45Z","receivedAt":"2008-03-06T12:38:45Z","isPatch":true,"sender":{"key":"kaitanie@cc.helsinki.fi","avatar":null},"body":"Adding horizontal scroll bar makes the scrolling feature more\ndiscoverable to the users. The horizontal scrollbar is a bit narrower\nthan vertical ones so we don't make too big impact on available screen\nreal estate.\n\nAn interesting side effect of Tk scrollbars is that the \"elevator\"\nsize changes depending on the visible content. So the horizontal\nscrollbar \"elevator\" changes as the user scrolls the view up and down.\n\nSigned-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>\n---\nThis patch adds a relatively narrow horizontal scrollbar to the diff\npane. It might be a bit more complicated to implement an on-demand\none, however...\n\nThe patch seems to work fine on Linux and ion3 window manager. I\nhaven't had a chance to test it with other systems.\n\n gitk |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex f1f21e9..5340811 100755\n--- a/gitk\n+++ b/gitk\n@@ -857,14 +857,18 @@ proc makewindow {} {\n     set ctext .bleft.ctext\n     text $ctext -background $bgcolor -foreground $fgcolor \\\n \t-state disabled -font textfont \\\n-\t-yscrollcommand scrolltext -wrap none\n+\t-yscrollcommand scrolltext  -wrap none \\\n+\t-xscrollcommand \".bleft.sbhorizontal set\"\n     if {$have_tk85} {\n \t$ctext conf -tabstyle wordprocessor\n     }\n     scrollbar .bleft.sb -command \"$ctext yview\"\n+    scrollbar .bleft.sbhorizontal -command \"$ctext xview\" -orient h \\\n+\t-width 10\n     pack .bleft.top -side top -fill x\n     pack .bleft.mid -side top -fill x\n     pack .bleft.sb -side right -fill y\n+    pack .bleft.sbhorizontal -side bottom -fill x -in .bleft\n     pack $ctext -side left -fill both -expand 1\n     lappend bglist $ctext\n     lappend fglist $ctext\n-- \n1.5.4.3\n\n"},{"id":"71276","messageId":"47D05772.3080706@dirk.my1.cc","threadId":"12540","inReplyTo":"20080306123845.GA12115@localdomain","subject":"Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2008-03-06T20:43:30Z","receivedAt":"2008-03-06T20:43:30Z","isPatch":true,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Hi Pekka,\n\nthank you for the patch. I'm using \"git version 1.5.4.950.ga176\"\nwhich is \"1.5.4-preview20080202\" of the msysGit package,\ni.e. the Windows version.\nIt works great for me either. Exactly what I wanted.\n\n   -- Dirk\n\nPekka Kaitaniemi schrieb:\n> Adding horizontal scroll bar makes the scrolling feature more\n> discoverable to the users. The horizontal scrollbar is a bit narrower\n> than vertical ones so we don't make too big impact on available screen\n> real estate.\n>\n> An interesting side effect of Tk scrollbars is that the \"elevator\"\n> size changes depending on the visible content. So the horizontal\n> scrollbar \"elevator\" changes as the user scrolls the view up and down.\n>\n> Signed-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>\n> ---\n> This patch adds a relatively narrow horizontal scrollbar to the diff\n> pane. It might be a bit more complicated to implement an on-demand\n> one, however...\n>\n> The patch seems to work fine on Linux and ion3 window manager. I\n> haven't had a chance to test it with other systems.\n>\n>  gitk |    6 +++++-\n>  1 files changed, 5 insertions(+), 1 deletions(-)\n>\n> diff --git a/gitk b/gitk\n> index f1f21e9..5340811 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -857,14 +857,18 @@ proc makewindow {} {\n>      set ctext .bleft.ctext\n>      text $ctext -background $bgcolor -foreground $fgcolor \\\n>  \t-state disabled -font textfont \\\n> -\t-yscrollcommand scrolltext -wrap none\n> +\t-yscrollcommand scrolltext  -wrap none \\\n> +\t-xscrollcommand \".bleft.sbhorizontal set\"\n>      if {$have_tk85} {\n>  \t$ctext conf -tabstyle wordprocessor\n>      }\n>      scrollbar .bleft.sb -command \"$ctext yview\"\n> +    scrollbar .bleft.sbhorizontal -command \"$ctext xview\" -orient h \\\n> +\t-width 10\n>      pack .bleft.top -side top -fill x\n>      pack .bleft.mid -side top -fill x\n>      pack .bleft.sb -side right -fill y\n> +    pack .bleft.sbhorizontal -side bottom -fill x -in .bleft\n>      pack $ctext -side left -fill both -expand 1\n>      lappend bglist $ctext\n>      lappend fglist $ctext\n>   \n\n"},{"id":"71287","messageId":"18384.30851.318641.612252@cargo.ozlabs.ibm.com","threadId":"12540","inReplyTo":"20080306123845.GA12115@localdomain","subject":"Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-03-06T23:04:35Z","receivedAt":"2008-03-06T23:04:35Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Pekka Kaitaniemi writes:\n\n> -\t-yscrollcommand scrolltext -wrap none\n> +\t-yscrollcommand scrolltext  -wrap none \\\n\nWhy this whitespace change?\n\n> +    scrollbar .bleft.sbhorizontal -command \"$ctext xview\" -orient h \\\n> +\t-width 10\n\nAre you using Tk 8.4 or 8.5?  With Tk 8.5 the scrollbars are thinner\nand I wonder whether specifying a width of 10 will actually make it\nfatter than it would be otherwise.\n\nPaul.\n"},{"id":"71339","messageId":"20080307121619.GA1768@localdomain","threadId":"12540","inReplyTo":"18384.30851.318641.612252@cargo.ozlabs.ibm.com","subject":"Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view","fromName":"Pekka Kaitaniemi","fromEmail":"kaitanie@cc.helsinki.fi","sentAt":"2008-03-07T12:16:19Z","receivedAt":"2008-03-07T12:16:19Z","isPatch":true,"sender":{"key":"kaitanie@cc.helsinki.fi","avatar":null},"body":"On Fri, Mar 07, 2008 at 10:04:35AM +1100, Paul Mackerras wrote:\n> Pekka Kaitaniemi writes:\n> \n> > -\t-yscrollcommand scrolltext -wrap none\n> > +\t-yscrollcommand scrolltext  -wrap none \\\n> \n> Why this whitespace change?\n\nFor no good reason at all... Fixed. The real change was the \\ at the\nend of the line.\n\n> > +    scrollbar .bleft.sbhorizontal -command \"$ctext xview\" -orient h \\\n> > +\t-width 10\n> \n> Are you using Tk 8.4 or 8.5?  With Tk 8.5 the scrollbars are thinner\n> and I wonder whether specifying a width of 10 will actually make it\n> fatter than it would be otherwise.\n\nI was using Tk 8.4 to make the patch. Today I installed 8.5. On 8.5 it\nseems that the horizontal scroll bar is as wide as the default one, or\nmaybe slightly narrower so it looks quite OK. At least it behaves this\nway on Linux. I can't really test how well it works on Mac and Windows\nsince I don't use them.\n\nSo Tk 8.5 actually has more reasonably sized scrollbars than\n8.4. Maybe the hardcoded width setting should be dropped? This would\nprobably make the patch more \"cross plattform\" because Windows and Mac\nversions of Tk may have different \"themes\" and scrollbar widths than\nthe Linux version. On those plattforms the width of 10 might be fatter\nthan the default.\n\nPekka\n"}]}