[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: pop-up tool-bar

From: Drew Adams
Subject: RE: pop-up tool-bar
Date: Sun, 10 Oct 2004 12:15:01 -0700

You're right, in terms of the implementation that I sent. That uses
`scroll-down', which depends on the height of the text at the top of the
window (and if a line has mixed font sizes, the maximum face height in the
line appears to be determinant).

The `tool-bar-lines' frame property is measured in line units that
correspond to the height of the font that is the `frame-font' frame
property. What's really needed is to scroll this amount, regardless of the
text font size.

I don't know of a way to do that in Lisp. It could be done in C, I'm sure.
The implementation I sent was intended as a proof of concept, to help us see
if a pop-up tool-bar would be useful.

In the email you quoted, I was not referring to this implementation, however
(that was in a separate email of the same thread). I was speaking in terms
of general principles, raising the question of which behavior is more
intuitive for users. If the compensatory scroll were exactly equal to
tool-bar-lines in height, then which would be preferable for a user?

I probably should have posed the choice differently, because, if the current
behavior for _displaying_ the tool-bar is kept, then you don't want the
buffer to scroll when the tool-bar _disappears_. That is, the same
mechanism, whatever it is, needs to be used for both displaying and removing
the tool-bar.

What I really meant was this choice:

 1. When displaying the tool-bar, let it _replace_ the first few lines
displayed in the window. When removing the tool-bar, _redisplay_ those
displaced lines. Then, the buffer lines don't jump up and down with the
appearance and disappearance of the tool-bar. The tool-bar just masks buffer
lines; the lines don't move up or down.

 2. When displaying the tool-bar, do as is done currently: shift the buffer
text down, so that the same lines remain visible. When removing the
tool-bar, move the buffer text back up. In this case, the tool-bar doesn't
replace (mask) lines; it is an addition.

I don't know which is preferable, in general. I would guess that it depends
on how often you display & remove the tool-bar. If you don't do that often,
then choice 2 is probably better. But if you display and remove the tool-bar
often, as in a pop-up tool-bar, then choice 1 is probably better.

I'm guessing that many (most) Emacs users will _not_ want to display the
tool-bar on each and every frame all the time. Some of them will want to use
the tool-bar, however (that's why we added it!), so a pop-up tool-bar that
is displayed only on the selected frame is a good compromise. For a pop-up
tool-bar, choice 1 may be preferable: let the temporary tool-bar _mask_ the
first few buffer lines, so that the buffer text doesn't visually shift up
and down for the temporary tool-bar display.

 - Drew

-----Original Message-----From: Richard Stallman

     - Move the buffer text down, to compensate for the tool-bar
    That is, replace the tool-bar with an equivalent number of lines of
    text. The text then stays in the same position relative to the display.

In general, line heights can vary, so this would require displaying a
partial line.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]