app: get rid of hardcoding GDK_SHIFT_MASK in tools/
gimp_suggest_modifiers(): change "shift_format" and "control_format" parameters to "extend_selection_format" and "toggle_behavior_format", which fixes the longstanding problem that the function did the right thing only by accident. tools: use gimp_get_extend_selection_mask() instead of GDK_SHIFT_MASK which is not 100% semantically correct in all cases, but at least a step in the right direction to make the tool modifiers easier to improve.
This commit is contained in:
@ -109,21 +109,20 @@ gimp_convolve_tool_modifier_key (GimpTool *tool,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GimpConvolveTool *convolve = GIMP_CONVOLVE_TOOL (tool);
|
||||
GimpConvolveOptions *options = GIMP_CONVOLVE_TOOL_GET_OPTIONS (tool);
|
||||
GdkModifierType toggle_mask;
|
||||
GimpConvolveTool *convolve = GIMP_CONVOLVE_TOOL (tool);
|
||||
GimpConvolveOptions *options = GIMP_CONVOLVE_TOOL_GET_OPTIONS (tool);
|
||||
GdkModifierType line_mask = GIMP_PAINT_TOOL_LINE_MASK;
|
||||
GdkModifierType toggle_mask = gimp_get_toggle_behavior_mask ();
|
||||
|
||||
toggle_mask = gimp_get_toggle_behavior_mask ();
|
||||
|
||||
if (((key == toggle_mask) &&
|
||||
! (state & GDK_SHIFT_MASK) && /* leave stuff untouched in line draw mode */
|
||||
if (((key == toggle_mask) &&
|
||||
! (state & line_mask) && /* leave stuff untouched in line draw mode */
|
||||
press != convolve->toggled)
|
||||
|
||||
||
|
||||
|
||||
(key == GDK_SHIFT_MASK && /* toggle back after keypresses CTRL(hold)-> */
|
||||
! press && /* SHIFT(hold)->CTRL(release)->SHIFT(release) */
|
||||
convolve->toggled &&
|
||||
(key == line_mask && /* toggle back after keypresses CTRL(hold)-> */
|
||||
! press && /* SHIFT(hold)->CTRL(release)->SHIFT(release) */
|
||||
convolve->toggled &&
|
||||
! (state & toggle_mask)))
|
||||
{
|
||||
convolve->toggled = press;
|
||||
|
||||
Reference in New Issue
Block a user