* [PATCH v2] gitk: Add horizontal scrollbar to the diff view
@ 2008-03-06 12:38 Pekka Kaitaniemi
2008-03-06 20:43 ` Dirk Süsserott
2008-03-06 23:04 ` Paul Mackerras
0 siblings, 2 replies; 4+ messages in thread
From: Pekka Kaitaniemi @ 2008-03-06 12:38 UTC (permalink / raw)
To: paulus, gitster, newsletter; +Cc: git
Adding horizontal scroll bar makes the scrolling feature more
discoverable to the users. The horizontal scrollbar is a bit narrower
than vertical ones so we don't make too big impact on available screen
real estate.
An interesting side effect of Tk scrollbars is that the "elevator"
size changes depending on the visible content. So the horizontal
scrollbar "elevator" changes as the user scrolls the view up and down.
Signed-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>
---
This patch adds a relatively narrow horizontal scrollbar to the diff
pane. It might be a bit more complicated to implement an on-demand
one, however...
The patch seems to work fine on Linux and ion3 window manager. I
haven't had a chance to test it with other systems.
gitk | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index f1f21e9..5340811 100755
--- a/gitk
+++ b/gitk
@@ -857,14 +857,18 @@ proc makewindow {} {
set ctext .bleft.ctext
text $ctext -background $bgcolor -foreground $fgcolor \
-state disabled -font textfont \
- -yscrollcommand scrolltext -wrap none
+ -yscrollcommand scrolltext -wrap none \
+ -xscrollcommand ".bleft.sbhorizontal set"
if {$have_tk85} {
$ctext conf -tabstyle wordprocessor
}
scrollbar .bleft.sb -command "$ctext yview"
+ scrollbar .bleft.sbhorizontal -command "$ctext xview" -orient h \
+ -width 10
pack .bleft.top -side top -fill x
pack .bleft.mid -side top -fill x
pack .bleft.sb -side right -fill y
+ pack .bleft.sbhorizontal -side bottom -fill x -in .bleft
pack $ctext -side left -fill both -expand 1
lappend bglist $ctext
lappend fglist $ctext
--
1.5.4.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view
2008-03-06 12:38 [PATCH v2] gitk: Add horizontal scrollbar to the diff view Pekka Kaitaniemi
@ 2008-03-06 20:43 ` Dirk Süsserott
2008-03-06 23:04 ` Paul Mackerras
1 sibling, 0 replies; 4+ messages in thread
From: Dirk Süsserott @ 2008-03-06 20:43 UTC (permalink / raw)
To: kaitanie; +Cc: paulus, gitster, newsletter, git
Hi Pekka,
thank you for the patch. I'm using "git version 1.5.4.950.ga176"
which is "1.5.4-preview20080202" of the msysGit package,
i.e. the Windows version.
It works great for me either. Exactly what I wanted.
-- Dirk
Pekka Kaitaniemi schrieb:
> Adding horizontal scroll bar makes the scrolling feature more
> discoverable to the users. The horizontal scrollbar is a bit narrower
> than vertical ones so we don't make too big impact on available screen
> real estate.
>
> An interesting side effect of Tk scrollbars is that the "elevator"
> size changes depending on the visible content. So the horizontal
> scrollbar "elevator" changes as the user scrolls the view up and down.
>
> Signed-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>
> ---
> This patch adds a relatively narrow horizontal scrollbar to the diff
> pane. It might be a bit more complicated to implement an on-demand
> one, however...
>
> The patch seems to work fine on Linux and ion3 window manager. I
> haven't had a chance to test it with other systems.
>
> gitk | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/gitk b/gitk
> index f1f21e9..5340811 100755
> --- a/gitk
> +++ b/gitk
> @@ -857,14 +857,18 @@ proc makewindow {} {
> set ctext .bleft.ctext
> text $ctext -background $bgcolor -foreground $fgcolor \
> -state disabled -font textfont \
> - -yscrollcommand scrolltext -wrap none
> + -yscrollcommand scrolltext -wrap none \
> + -xscrollcommand ".bleft.sbhorizontal set"
> if {$have_tk85} {
> $ctext conf -tabstyle wordprocessor
> }
> scrollbar .bleft.sb -command "$ctext yview"
> + scrollbar .bleft.sbhorizontal -command "$ctext xview" -orient h \
> + -width 10
> pack .bleft.top -side top -fill x
> pack .bleft.mid -side top -fill x
> pack .bleft.sb -side right -fill y
> + pack .bleft.sbhorizontal -side bottom -fill x -in .bleft
> pack $ctext -side left -fill both -expand 1
> lappend bglist $ctext
> lappend fglist $ctext
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view
2008-03-06 12:38 [PATCH v2] gitk: Add horizontal scrollbar to the diff view Pekka Kaitaniemi
2008-03-06 20:43 ` Dirk Süsserott
@ 2008-03-06 23:04 ` Paul Mackerras
2008-03-07 12:16 ` Pekka Kaitaniemi
1 sibling, 1 reply; 4+ messages in thread
From: Paul Mackerras @ 2008-03-06 23:04 UTC (permalink / raw)
To: kaitanie; +Cc: gitster, newsletter, git
Pekka Kaitaniemi writes:
> - -yscrollcommand scrolltext -wrap none
> + -yscrollcommand scrolltext -wrap none \
Why this whitespace change?
> + scrollbar .bleft.sbhorizontal -command "$ctext xview" -orient h \
> + -width 10
Are you using Tk 8.4 or 8.5? With Tk 8.5 the scrollbars are thinner
and I wonder whether specifying a width of 10 will actually make it
fatter than it would be otherwise.
Paul.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gitk: Add horizontal scrollbar to the diff view
2008-03-06 23:04 ` Paul Mackerras
@ 2008-03-07 12:16 ` Pekka Kaitaniemi
0 siblings, 0 replies; 4+ messages in thread
From: Pekka Kaitaniemi @ 2008-03-07 12:16 UTC (permalink / raw)
To: Paul Mackerras; +Cc: kaitanie, gitster, newsletter, git
On Fri, Mar 07, 2008 at 10:04:35AM +1100, Paul Mackerras wrote:
> Pekka Kaitaniemi writes:
>
> > - -yscrollcommand scrolltext -wrap none
> > + -yscrollcommand scrolltext -wrap none \
>
> Why this whitespace change?
For no good reason at all... Fixed. The real change was the \ at the
end of the line.
> > + scrollbar .bleft.sbhorizontal -command "$ctext xview" -orient h \
> > + -width 10
>
> Are you using Tk 8.4 or 8.5? With Tk 8.5 the scrollbars are thinner
> and I wonder whether specifying a width of 10 will actually make it
> fatter than it would be otherwise.
I was using Tk 8.4 to make the patch. Today I installed 8.5. On 8.5 it
seems that the horizontal scroll bar is as wide as the default one, or
maybe slightly narrower so it looks quite OK. At least it behaves this
way on Linux. I can't really test how well it works on Mac and Windows
since I don't use them.
So Tk 8.5 actually has more reasonably sized scrollbars than
8.4. Maybe the hardcoded width setting should be dropped? This would
probably make the patch more "cross plattform" because Windows and Mac
versions of Tk may have different "themes" and scrollbar widths than
the Linux version. On those plattforms the width of 10 might be fatter
than the default.
Pekka
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-03-07 12:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 12:38 [PATCH v2] gitk: Add horizontal scrollbar to the diff view Pekka Kaitaniemi
2008-03-06 20:43 ` Dirk Süsserott
2008-03-06 23:04 ` Paul Mackerras
2008-03-07 12:16 ` Pekka Kaitaniemi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).