emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 8 Oct 2004 10:20:04 -0700

Please try this version of the pop-up tool-bar, and see what you think about
including it in Emacs as an option. I've added it to `tool-bar.el'; patch
attached.

The added code adds two new minor modes:

 - tool-bar-here-mode
 - tool-bar-pop-up-mode

The former is not strictly related to the pop-up tool-bar. It is simply the
same thing as `tool-bar-mode', but local to the selected frame only. I'd
propose it independently, even if folks decided against including the pop-up
mode. The pop-up tool-bar uses the frame-local tool-bar
(`tool-bar-here-mode') to do its work, but `tool-bar-here-mode' does not
need `tool-bar-pop-up-mode'.

So, with this addition, we will have three modes:

 - tool-bar-mode:        global (all frames)
 - tool-bar-here-mode:   local to selected frame
 - tool-bar-pop-up-mode: local to selected frame; tool-bar pops up on demand

Command `tool-bar-pop-up-mode' functions as a toggle only if neither
`tool-bar-mode' nor `tool-bar-here-mode' is on. If either of those modes is
on, then command `tool-bar-pop-up-mode' turns them both off and turns
`tool-bar-pop-up-mode' on (regardless of whether or not variable
`tool-bar-pop-up-mode' considers the pop-up mode to already be on).

Conversely, turning on one of the other tool-bar modes effectively nullifies
`tool-bar-pop-up-mode'. In terms of user-visible effect, the two are thus
mutually exclusive: either pop-up or not. By default, `tool-bar-mode' is on
(and the other two are off).

This version of the tool-bar pop-up code solves an interesting pb that arose
with the previous version when you clicked the mouse while the tool-bar was
temporarily visible. Because the tool-bar disappearance caused the buffer
text (the window) to move relative to an unmoving mouse, the mouse click
caused a region selection. That is, even though the mouse didn't move (you
just clicked), the movement of the _window_ relative to the mouse caused a
selection.

The fix was to scroll the buffer (window) `tool-bar-lines' to compensate for
the window movement. This scrolling happens for mouse events only, since
other events do not cause the problem (and you don't want to scroll the
buffer each time you click a tool-bar button).

It's easier to experience all of this than to describe it, so please give it
a try. To use the pop-up tool-bar, patch the file tool-bar.el, then load it
and `M-x tool-bar-popup-mode'. Then click "Buttons" in the menu-bar to pop
up the tool-bar for a single command (button click). Pound on it a bit, and
let me know what you think.

Thanks,

  Drew

Attachment: diff-tool-bar-pop-up.txt
Description: Text document


reply via email to

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