All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>
To: Paul Mackerras <paulus@samba.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	kaitanie@cc.helsinki.fi, newsletter@dirk.my1.cc,
	git@vger.kernel.org
Subject: Re: [PATCH] gitk: Add horizontal scrollbar to the diff view
Date: Thu, 6 Mar 2008 13:53:47 +0200	[thread overview]
Message-ID: <20080306115347.GA11808@localdomain> (raw)
In-Reply-To: <18383.51154.695501.543720@cargo.ozlabs.ibm.com>

Hi,

On Thu, Mar 06, 2008 at 09:30:42PM +1100, Paul Mackerras wrote:
> Junio C Hamano writes:
> 
> > An obvious solution is to show the scrollbar on-demand (i.e. when the
> > lines are overlong), but I do not talk Tcl/Tk and do not know if you can
> > do that easily.
> 
> I don't know of any extremely easy way to do it; it's certainly
> possible, but I think I would have to calculate the length of each
> line as it is put in, so as to get the maximum, and then have a
> handler for when the pane is resized, and pack and unpack the
> scrollbar as necessary.

I have spent some time today looking for examples on Tk scrollbar
handling (I'm not really a Tcl/Tk guru) and I haven't found any really
easy ways either.

> I think it's reasonable to have the scroll bar there always.  I think
> that pane could look better using the grid geometry manager (instead
> of pack), but that can be a separate patch.

I have modified the patch a bit to make the horizontal scrollbar a bit
narrower so the impact on screen real estate should be smaller
now.

The grid layout manager would probably be a bit better than pack for
the left pane. At least most examples of "text and two scrollbars"
case seem to be using it. Maybe I can try to prepare a patch that
converts the diff pane from pack to grid layout.

An interesting side effect of Tk scrollbars is that by default the
"elevator" size changes depending on the _visible_ content. So the
horizontal scrollbar "elevator" changes as the user scrolls the view
up and down.

Pekka


  reply	other threads:[~2008-03-06 11:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 22:51 [PATCH] gitk: Add horizontal scrollbar to the diff view Pekka Kaitaniemi
2008-03-06  6:18 ` Junio C Hamano
2008-03-06 10:30   ` Paul Mackerras
2008-03-06 11:53     ` Pekka Kaitaniemi [this message]
2008-03-08  1:53     ` Shawn O. Pearce
2008-03-08  5:41       ` Paul Mackerras
2008-03-08  5:51         ` Shawn O. Pearce
  -- strict thread matches above, loose matches on Subject: below --
2008-03-08 12:27 Pekka Kaitaniemi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080306115347.GA11808@localdomain \
    --to=kaitanie@cc.helsinki.fi \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newsletter@dirk.my1.cc \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.