* [PATCH] git-gui: add horizontal scrollbar to commit buffer
@ 2019-09-12 19:20 Bert Wesarg
2019-09-13 18:53 ` Pratyush Yadav
0 siblings, 1 reply; 3+ messages in thread
From: Bert Wesarg @ 2019-09-12 19:20 UTC (permalink / raw)
To: git; +Cc: Bert Wesarg, Pratyush Yadav, Johannes Sixt,
Birger Skogeng Pedersen
While the commit message widget has a configurable fixed width, it
nevertheless allowed to write commit messages which exceeded this limit.
Though there is no visual clue, that there is scrolling going on. Now
there is a horizontal scrollbar.
There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
does not update the horizontal scrollbar if one removes the whole
content at once.
Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
git-gui.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 5bc21b8..032ebd6 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
-relief sunken \
-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
-font font_diff \
+ -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
+${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
+ -orient horizontal \
+ -command [list $ui_comm xview]
${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
+ -orient vertical \
-command [list $ui_comm yview]
+pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x
pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
-pack $ui_comm -side left -fill y
+pack $ui_comm -side left -fill both -expand 1
pack .vpane.lower.commarea.buffer.header -side top -fill x
-pack .vpane.lower.commarea.buffer.frame -side left -fill y
+pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1
pack .vpane.lower.commarea.buffer -side left -fill y
# -- Commit Message Buffer Context Menu
--
2.21.0.789.ga095d9d866
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] git-gui: add horizontal scrollbar to commit buffer
2019-09-12 19:20 [PATCH] git-gui: add horizontal scrollbar to commit buffer Bert Wesarg
@ 2019-09-13 18:53 ` Pratyush Yadav
2019-09-13 20:15 ` Bert Wesarg
0 siblings, 1 reply; 3+ messages in thread
From: Pratyush Yadav @ 2019-09-13 18:53 UTC (permalink / raw)
To: Bert Wesarg; +Cc: git, Johannes Sixt, Birger Skogeng Pedersen
Can you please add a version number when you send re-rolls the next time
around. Something like "[PATCH v2] subject...". Makes it easier for me
to keep track of things when there are multiple re-rolls of multiple
patches.
You can do this by passing "-v2" (or "-v3", "-v4", etc) to
git-send-email or git-format-patch.
You missed two quick questions I had in the last version. I'll ask them
again below. Other than those two, LGTM. Thanks.
On 12/09/19 09:20PM, Bert Wesarg wrote:
> While the commit message widget has a configurable fixed width, it
> nevertheless allowed to write commit messages which exceeded this limit.
> Though there is no visual clue, that there is scrolling going on. Now
> there is a horizontal scrollbar.
Looks much better!
> There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
> does not update the horizontal scrollbar if one removes the whole
> content at once.
>
> Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> ---
> git-gui.sh | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index 5bc21b8..032ebd6 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
> -relief sunken \
> -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
> -font font_diff \
> + -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
> -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
> +${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
> + -orient horizontal \
> + -command [list $ui_comm xview]
> ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
> + -orient vertical \
> -command [list $ui_comm yview]
>
> +pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x
> pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
> -pack $ui_comm -side left -fill y
> +pack $ui_comm -side left -fill both -expand 1
If I remove this change, the behavior does not seem to change, and the
commit message buffer still expands. So what exactly does this change
do?
> pack .vpane.lower.commarea.buffer.header -side top -fill x
> -pack .vpane.lower.commarea.buffer.frame -side left -fill y
> +pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1
I'm not too familiar with pack, but why change the side from left to
bottom? I tested by changing it back to left and it doesn't seem to make
a difference.
> pack .vpane.lower.commarea.buffer -side left -fill y
>
> # -- Commit Message Buffer Context Menu
> --
> 2.21.0.789.ga095d9d866
>
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] git-gui: add horizontal scrollbar to commit buffer
2019-09-13 18:53 ` Pratyush Yadav
@ 2019-09-13 20:15 ` Bert Wesarg
0 siblings, 0 replies; 3+ messages in thread
From: Bert Wesarg @ 2019-09-13 20:15 UTC (permalink / raw)
To: Pratyush Yadav; +Cc: Git Mailing List, Johannes Sixt, Birger Skogeng Pedersen
On Fri, Sep 13, 2019 at 8:53 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> Can you please add a version number when you send re-rolls the next time
> around. Something like "[PATCH v2] subject...". Makes it easier for me
> to keep track of things when there are multiple re-rolls of multiple
> patches.
>
> You can do this by passing "-v2" (or "-v3", "-v4", etc) to
> git-send-email or git-format-patch.
>
> You missed two quick questions I had in the last version. I'll ask them
> again below. Other than those two, LGTM. Thanks.
I removed both of then, but they still made it into the patch, sorry.
Will re-roll with v4 now.
Bert
>
> On 12/09/19 09:20PM, Bert Wesarg wrote:
> > While the commit message widget has a configurable fixed width, it
> > nevertheless allowed to write commit messages which exceeded this limit.
> > Though there is no visual clue, that there is scrolling going on. Now
> > there is a horizontal scrollbar.
>
> Looks much better!
>
> > There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
> > does not update the horizontal scrollbar if one removes the whole
> > content at once.
> >
> > Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
> > Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> > ---
> > git-gui.sh | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/git-gui.sh b/git-gui.sh
> > index 5bc21b8..032ebd6 100755
> > --- a/git-gui.sh
> > +++ b/git-gui.sh
> > @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
> > -relief sunken \
> > -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
> > -font font_diff \
> > + -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
> > -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
> > +${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
> > + -orient horizontal \
> > + -command [list $ui_comm xview]
> > ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
> > + -orient vertical \
> > -command [list $ui_comm yview]
> >
> > +pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x
> > pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
> > -pack $ui_comm -side left -fill y
> > +pack $ui_comm -side left -fill both -expand 1
>
> If I remove this change, the behavior does not seem to change, and the
> commit message buffer still expands. So what exactly does this change
> do?
>
> > pack .vpane.lower.commarea.buffer.header -side top -fill x
> > -pack .vpane.lower.commarea.buffer.frame -side left -fill y
> > +pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1
>
> I'm not too familiar with pack, but why change the side from left to
> bottom? I tested by changing it back to left and it doesn't seem to make
> a difference.
>
> > pack .vpane.lower.commarea.buffer -side left -fill y
> >
> > # -- Commit Message Buffer Context Menu
> > --
> > 2.21.0.789.ga095d9d866
> >
>
> --
> Regards,
> Pratyush Yadav
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-13 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-12 19:20 [PATCH] git-gui: add horizontal scrollbar to commit buffer Bert Wesarg
2019-09-13 18:53 ` Pratyush Yadav
2019-09-13 20:15 ` Bert Wesarg
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).