Commit Graph

9 Commits

Author SHA1 Message Date
Ell
3212da715b app: increase idle priority for hiding on-hover tool-group menu
In GimpToolButton, when in "show menu on hover" mode, increase the
idle priority for hiding the the tool-group menu upon button/menu
leave-notify.  Make the priority one step below the normal event
priority, so that a subsequent button/menu enter-notify event
canceling the idle is processed beforehand, while the idle is
otherwise still processed before ordinary lower-priority sources,
in particular, before projection rendering timeouts.
2020-06-28 12:12:36 +03:00
Ell
00145da370 Issue #5226 - hover over toolgroup not working
In gimp_tool_button_enter_notify(), only mask-in the mouse-button
state for determining whether to show the tool-group menu.  This
avoids other bits of state -- in particular, certain keyboard
locks, including keyboard-layout state -- from preventing the menu
from showing.
2020-06-16 13:12:34 +03:00
Ell
35d6d9e529 app: list all tool-group tools in tool-button tooltip
In tool-group GimpToolButton tooltips, in addition to showing the
description of the currently-active tool, list the other tools in
the group as well, to improve discoverability.

(cherry picked from commit 4d83c7a3fc)
2020-06-01 19:30:54 +03:00
Ell
1b3c945488 app: don't grab keyboard focus when showing tool-button menu on hover
In GimpToolButton, don't let the group menu grab the keyboard focus
when showing it on hover.  This avoids accidentally reassigning the
keyboard shortcut of the selected tool.
2020-04-11 12:38:21 +03:00
Ell
04d17b7829 app: add option to show tool-button menu on hover
Add a "Menu mode" option to the toolbox preferences, which controls
the menu behavior for tool-group buttons, and can be one of "Show
on click" (current behavior), "Show on hover" (show the menu when
hovering over the button), and "Show on hover in single column"
(behaves like "Show on hover" when the toolbox has a single column,
and "Show on click" otherwise) -- the latter is the default.

Note that "Show on hover" requires the ability to remove the menu
grab, which doesn't seem to work in GTK3, so this change is
restricted to 2.10 for now.
2020-03-26 13:31:55 +02:00
Ell
327b3fb772 app: in GimpToolButton, select active tool in menu
In a GimpToolButton representing a tool group, select the group's
active-tool item when showing the menu.

(cherry picked from commit 75435c8e6b)
2020-03-26 13:30:05 +02:00
Ell
c58d4017de app: move tool-activation upon tool-group active-tool change to GimpToolManager
When the active tool of the tool group associated with the
currently-selected tool changes, we select the new active tool;
this is currently handled in GimpToolButton.  Move this logic to
GimpToolManager, which already handles the other half of the
problem: updating the group's active tool when one of its tools is
selected.
2020-01-30 16:39:22 +02:00
Ell
b0f0013af6 app: various fixes to last commits
(cherry picked from commit bae9f2d880)
2020-01-30 10:46:21 +02:00
Ell
bcc5634093 app: add GimpToolButton
Add a new GimpToolButton class, used for tool-buttons in the
toolbox, instead of implementing them directly in GimpToolPalette.
Each GimpToolButton is associated with a GimpToolItem, which can be
either an individual tool or a group.

When a tool button is associated with a group, it displays the
group's active tool, with an arrow at the corner.  Clicking the
button selects the active tool, while clicking-and-holding, or
right-clicking, shows a menu of all the tools in the group.
Alternatively, the active tool can be changed using the scroll
wheel.
2020-01-30 02:46:53 +02:00