{"thread":{"id":"51836","subject":"[PATCH] git-gui: add horizontal scrollbar to commit buffer","startedAt":"2019-09-12T19:20:53Z","lastAt":"2019-09-13T20:15:20Z","messageCount":3,"participants":["Bert Wesarg","Pratyush Yadav"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"382244","messageId":"f9bf70bfae825228a7afee705babc1915b579072.1568315704.git.bert.wesarg@googlemail.com","threadId":"51836","inReplyTo":null,"subject":"[PATCH] git-gui: add horizontal scrollbar to commit buffer","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2019-09-12T19:20:47Z","receivedAt":"2019-09-12T19:20:53Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"While the commit message widget has a configurable fixed width, it\nnevertheless allowed to write commit messages which exceeded this limit.\nThough there is no visual clue, that there is scrolling going on. Now\nthere is a horizontal scrollbar.\n\nThere seems to be a bug in at least Tcl/Tk up to version 8.6.8, which\ndoes not update the horizontal scrollbar if one removes the whole\ncontent at once.\n\nSuggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n git-gui.sh | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 5bc21b8..032ebd6 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \\\n \t-relief sunken \\\n \t-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \\\n \t-font font_diff \\\n+\t-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \\\n \t-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}\n+${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \\\n+\t-orient horizontal \\\n+\t-command [list $ui_comm xview]\n ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \\\n+\t-orient vertical \\\n \t-command [list $ui_comm yview]\n \n+pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x\n pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y\n-pack $ui_comm -side left -fill y\n+pack $ui_comm -side left -fill both -expand 1\n pack .vpane.lower.commarea.buffer.header -side top -fill x\n-pack .vpane.lower.commarea.buffer.frame -side left -fill y\n+pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1\n pack .vpane.lower.commarea.buffer -side left -fill y\n \n # -- Commit Message Buffer Context Menu\n-- \n2.21.0.789.ga095d9d866\n\n"},{"id":"382319","messageId":"20190913185309.m766nxjo6wby47hf@yadavpratyush.com","threadId":"51836","inReplyTo":"f9bf70bfae825228a7afee705babc1915b579072.1568315704.git.bert.wesarg@googlemail.com","subject":"Re: [PATCH] git-gui: add horizontal scrollbar to commit buffer","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-09-13T18:53:09Z","receivedAt":"2019-09-13T18:53:16Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Can you please add a version number when you send re-rolls the next time \naround. Something like \"[PATCH v2] subject...\". Makes it easier for me \nto keep track of things when there are multiple re-rolls of multiple \npatches.\n\nYou can do this by passing \"-v2\" (or \"-v3\", \"-v4\", etc) to \ngit-send-email or git-format-patch.\n\nYou missed two quick questions I had in the last version. I'll ask them \nagain below. Other than those two, LGTM. Thanks.\n\nOn 12/09/19 09:20PM, Bert Wesarg wrote:\n> While the commit message widget has a configurable fixed width, it\n> nevertheless allowed to write commit messages which exceeded this limit.\n> Though there is no visual clue, that there is scrolling going on. Now\n> there is a horizontal scrollbar.\n\nLooks much better!\n \n> There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which\n> does not update the horizontal scrollbar if one removes the whole\n> content at once.\n> \n> Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>\n> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n> ---\n>  git-gui.sh | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n> \n> diff --git a/git-gui.sh b/git-gui.sh\n> index 5bc21b8..032ebd6 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \\\n>  \t-relief sunken \\\n>  \t-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \\\n>  \t-font font_diff \\\n> +\t-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \\\n>  \t-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}\n> +${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \\\n> +\t-orient horizontal \\\n> +\t-command [list $ui_comm xview]\n>  ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \\\n> +\t-orient vertical \\\n>  \t-command [list $ui_comm yview]\n>  \n> +pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x\n>  pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y\n> -pack $ui_comm -side left -fill y\n> +pack $ui_comm -side left -fill both -expand 1\n\nIf I remove this change, the behavior does not seem to change, and the \ncommit message buffer still expands. So what exactly does this change \ndo?\n\n>  pack .vpane.lower.commarea.buffer.header -side top -fill x\n> -pack .vpane.lower.commarea.buffer.frame -side left -fill y\n> +pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1\n\nI'm not too familiar with pack, but why change the side from left to \nbottom? I tested by changing it back to left and it doesn't seem to make \na difference.\n\n>  pack .vpane.lower.commarea.buffer -side left -fill y\n>  \n>  # -- Commit Message Buffer Context Menu\n> -- \n> 2.21.0.789.ga095d9d866\n> \n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"382328","messageId":"CAKPyHN37WPrc9vFXKWJNhW_4GG0r8VPcUnxJALfpNTWirx821w@mail.gmail.com","threadId":"51836","inReplyTo":"20190913185309.m766nxjo6wby47hf@yadavpratyush.com","subject":"Re: [PATCH] git-gui: add horizontal scrollbar to commit buffer","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2019-09-13T20:15:06Z","receivedAt":"2019-09-13T20:15:20Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, Sep 13, 2019 at 8:53 PM Pratyush Yadav <me@yadavpratyush.com> wrote:\n>\n> Can you please add a version number when you send re-rolls the next time\n> around. Something like \"[PATCH v2] subject...\". Makes it easier for me\n> to keep track of things when there are multiple re-rolls of multiple\n> patches.\n>\n> You can do this by passing \"-v2\" (or \"-v3\", \"-v4\", etc) to\n> git-send-email or git-format-patch.\n>\n> You missed two quick questions I had in the last version. I'll ask them\n> again below. Other than those two, LGTM. Thanks.\n\nI removed both of then, but they still made it into the patch, sorry.\nWill re-roll with v4 now.\n\nBert\n\n>\n> On 12/09/19 09:20PM, Bert Wesarg wrote:\n> > While the commit message widget has a configurable fixed width, it\n> > nevertheless allowed to write commit messages which exceeded this limit.\n> > Though there is no visual clue, that there is scrolling going on. Now\n> > there is a horizontal scrollbar.\n>\n> Looks much better!\n>\n> > There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which\n> > does not update the horizontal scrollbar if one removes the whole\n> > content at once.\n> >\n> > Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>\n> > Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n> > ---\n> >  git-gui.sh | 10 ++++++++--\n> >  1 file changed, 8 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/git-gui.sh b/git-gui.sh\n> > index 5bc21b8..032ebd6 100755\n> > --- a/git-gui.sh\n> > +++ b/git-gui.sh\n> > @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \\\n> >       -relief sunken \\\n> >       -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \\\n> >       -font font_diff \\\n> > +     -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \\\n> >       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}\n> > +${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \\\n> > +     -orient horizontal \\\n> > +     -command [list $ui_comm xview]\n> >  ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \\\n> > +     -orient vertical \\\n> >       -command [list $ui_comm yview]\n> >\n> > +pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x\n> >  pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y\n> > -pack $ui_comm -side left -fill y\n> > +pack $ui_comm -side left -fill both -expand 1\n>\n> If I remove this change, the behavior does not seem to change, and the\n> commit message buffer still expands. So what exactly does this change\n> do?\n>\n> >  pack .vpane.lower.commarea.buffer.header -side top -fill x\n> > -pack .vpane.lower.commarea.buffer.frame -side left -fill y\n> > +pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1\n>\n> I'm not too familiar with pack, but why change the side from left to\n> bottom? I tested by changing it back to left and it doesn't seem to make\n> a difference.\n>\n> >  pack .vpane.lower.commarea.buffer -side left -fill y\n> >\n> >  # -- Commit Message Buffer Context Menu\n> > --\n> > 2.21.0.789.ga095d9d866\n> >\n>\n> --\n> Regards,\n> Pratyush Yadav\n"}]}