git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: Add horizontal scrollbar to the files list
@ 2019-10-01 10:08 Bert Wesarg
  2019-10-01 15:42 ` Marc Branchaud
  0 siblings, 1 reply; 2+ messages in thread
From: Bert Wesarg @ 2019-10-01 10:08 UTC (permalink / raw)
  To: git; +Cc: Bert Wesarg, paulus

Wrapping filenames is an unexpected experience in UX design. Disable
wrapping and add a horizontal scrollbar to the files list to remove this.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 gitk | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gitk b/gitk
index abe4805..bf2a061 100755
--- a/gitk
+++ b/gitk
@@ -2477,13 +2477,16 @@ proc makewindow {} {
 	-background $bgcolor -foreground $fgcolor \
 	-font mainfont \
 	-tabs [list $indent [expr {2 * $indent}]] \
-	-yscrollcommand ".bright.sb set" \
+	-xscrollcommand ".bright.sbx set" \
+	-yscrollcommand ".bright.sby set" \
 	-cursor [. cget -cursor] \
-	-spacing1 1 -spacing3 1
+	-spacing1 1 -spacing3 1 -wrap none
     lappend bglist $cflist
     lappend fglist $cflist
-    ${NS}::scrollbar .bright.sb -command "$cflist yview"
-    pack .bright.sb -side right -fill y
+    ${NS}::scrollbar .bright.sbx -orient horizontal -command "$cflist xview"
+    ${NS}::scrollbar .bright.sby -orient vertical   -command "$cflist yview"
+    pack .bright.sbx -side bottom -fill x
+    pack .bright.sby -side right -fill y
     pack $cflist -side left -fill both -expand 1
     $cflist tag configure highlight \
 	-background [$cflist cget -selectbackground]
-- 
2.23.0.11.g242cf7f110


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gitk: Add horizontal scrollbar to the files list
  2019-10-01 10:08 [PATCH] gitk: Add horizontal scrollbar to the files list Bert Wesarg
@ 2019-10-01 15:42 ` Marc Branchaud
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Branchaud @ 2019-10-01 15:42 UTC (permalink / raw)
  To: Bert Wesarg, git; +Cc: paulus

On 2019-10-01 6:08 a.m., Bert Wesarg wrote:
> Wrapping filenames is an unexpected experience in UX design. Disable
> wrapping and add a horizontal scrollbar to the files list to remove this.

(Thanks for working on gitk and git-gui!)

I have to say I'm mildly opposed to this change.  The reason is that 
having to scroll to see the end of the filename is extra work, and it's 
work that would have to be repeated as one navigates between commits in 
the same area of code.  Git-gui has scrollbars for its filename panes, 
and I find them more of a hassle that gitk's wrapping.  (The horizontal 
scrollbar might work better if it defaulted to scrolling all the way to 
the *right* instead of to the left.)

But I would instead prefer there to be some visual indication that the 
filename was wrapped.  Maybe indent the wrapped lines?  Or how about 
contracting the file path with an ellipsis (...), like "git diff --stat"?

		M.


> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> ---
>   gitk | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/gitk b/gitk
> index abe4805..bf2a061 100755
> --- a/gitk
> +++ b/gitk
> @@ -2477,13 +2477,16 @@ proc makewindow {} {
>   	-background $bgcolor -foreground $fgcolor \
>   	-font mainfont \
>   	-tabs [list $indent [expr {2 * $indent}]] \
> -	-yscrollcommand ".bright.sb set" \
> +	-xscrollcommand ".bright.sbx set" \
> +	-yscrollcommand ".bright.sby set" \
>   	-cursor [. cget -cursor] \
> -	-spacing1 1 -spacing3 1
> +	-spacing1 1 -spacing3 1 -wrap none
>       lappend bglist $cflist
>       lappend fglist $cflist
> -    ${NS}::scrollbar .bright.sb -command "$cflist yview"
> -    pack .bright.sb -side right -fill y
> +    ${NS}::scrollbar .bright.sbx -orient horizontal -command "$cflist xview"
> +    ${NS}::scrollbar .bright.sby -orient vertical   -command "$cflist yview"
> +    pack .bright.sbx -side bottom -fill x
> +    pack .bright.sby -side right -fill y
>       pack $cflist -side left -fill both -expand 1
>       $cflist tag configure highlight \
>   	-background [$cflist cget -selectbackground]
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-01 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 10:08 [PATCH] gitk: Add horizontal scrollbar to the files list Bert Wesarg
2019-10-01 15:42 ` Marc Branchaud

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).