Commit 38b8f059 authored by Michael Natterer's avatar Michael Natterer 😴

app: use the new modifier API instead of constants in all tools

There are still many uses of literal SHIFT and MOD1 left, but all uses
of CONTROL are gone. Should work exactly as before on Win/X11, and
still has some glitches on OSX.
parent 59f4396c
......@@ -247,8 +247,11 @@ gimp_align_tool_button_release (GimpTool *tool,
GimpDisplayShell *shell = gimp_display_get_shell (display);
GObject *object = NULL;
GimpImage *image = gimp_display_get_image (display);
GdkModifierType extend_mask;
gint i;
extend_mask = gimp_get_extend_selection_mask ();
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_tool_control_halt (tool->control);
......@@ -262,7 +265,7 @@ gimp_align_tool_button_release (GimpTool *tool,
return;
}
if (! (state & GDK_SHIFT_MASK)) /* start a new list */
if (! (state & extend_mask)) /* start a new list */
{
gimp_align_tool_clear_selected (align_tool);
align_tool->set_reference = FALSE;
......@@ -317,7 +320,7 @@ gimp_align_tool_button_release (GimpTool *tool,
/* if an object has been selected using unmodified click,
* it should be used as the reference
*/
if (! (state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)))
if (! (state & extend_mask))
align_tool->set_reference = TRUE;
}
}
......@@ -426,7 +429,8 @@ gimp_align_tool_oper_update (GimpTool *tool,
gint snap_distance = display->config->snap_distance;
gboolean add;
add = (state & GDK_SHIFT_MASK) && align_tool->selected_objects;
add = ((state & gimp_get_extend_selection_mask ()) &&
align_tool->selected_objects);
if (gimp_draw_tool_on_vectors (GIMP_DRAW_TOOL (tool), display,
coords, snap_distance, snap_distance,
......@@ -481,7 +485,7 @@ gimp_align_tool_cursor_update (GimpTool *tool,
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
/* always add '+' when Shift is pressed, even if nothing is selected */
if (state & GDK_SHIFT_MASK)
if (state & gimp_get_extend_selection_mask ())
modifier = GIMP_CURSOR_MODIFIER_PLUS;
switch (align_tool->function)
......@@ -522,7 +526,10 @@ gimp_align_tool_status_update (GimpTool *tool,
GdkModifierType state,
gboolean proximity)
{
GimpAlignTool *align_tool = GIMP_ALIGN_TOOL (tool);
GimpAlignTool *align_tool = GIMP_ALIGN_TOOL (tool);
GdkModifierType extend_mask;
extend_mask = gimp_get_extend_selection_mask ();
gimp_tool_pop_status (tool, display);
......@@ -533,7 +540,7 @@ gimp_align_tool_status_update (GimpTool *tool,
if (! align_tool->selected_objects)
{
/* no need to suggest Shift if nothing is selected */
state |= GDK_SHIFT_MASK;
state |= extend_mask;
}
switch (align_tool->function)
......@@ -542,14 +549,14 @@ gimp_align_tool_status_update (GimpTool *tool,
status = gimp_suggest_modifiers (_("Click on a layer, path or guide, "
"or Click-Drag to pick several "
"layers"),
GDK_SHIFT_MASK & ~state,
extend_mask & ~state,
NULL, NULL, NULL);
break;
case ALIGN_TOOL_PICK_LAYER:
status = gimp_suggest_modifiers (_("Click to pick this layer as "
"first item"),
GDK_SHIFT_MASK & ~state,
extend_mask & ~state,
NULL, NULL, NULL);
break;
......@@ -560,7 +567,7 @@ gimp_align_tool_status_update (GimpTool *tool,
case ALIGN_TOOL_PICK_GUIDE:
status = gimp_suggest_modifiers (_("Click to pick this guide as "
"first item"),
GDK_SHIFT_MASK & ~state,
extend_mask & ~state,
NULL, NULL, NULL);
break;
......@@ -571,7 +578,7 @@ gimp_align_tool_status_update (GimpTool *tool,
case ALIGN_TOOL_PICK_PATH:
status = gimp_suggest_modifiers (_("Click to pick this path as "
"first item"),
GDK_SHIFT_MASK & ~state,
extend_mask & ~state,
NULL, NULL, NULL);
break;
......
......@@ -309,7 +309,7 @@ gimp_blend_tool_motion (GimpTool *tool,
blend_tool->end_y = coords->y;
}
if (state & GDK_CONTROL_MASK)
if (state & gimp_get_constrain_behavior_mask ())
{
gimp_constrain_line (blend_tool->start_x, blend_tool->start_y,
&blend_tool->end_x, &blend_tool->end_y,
......@@ -334,7 +334,7 @@ gimp_blend_tool_active_modifier_key (GimpTool *tool,
{
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
if (key == GDK_CONTROL_MASK)
if (key == gimp_get_constrain_behavior_mask ())
{
blend_tool->end_x = blend_tool->mouse_x;
blend_tool->end_y = blend_tool->mouse_y;
......@@ -440,8 +440,9 @@ gimp_blend_tool_push_status (GimpBlendTool *blend_tool,
gchar *status_help;
status_help = gimp_suggest_modifiers ("",
((GDK_CONTROL_MASK | GDK_MOD1_MASK)
& ~state),
(gimp_get_constrain_behavior_mask () |
GDK_MOD1_MASK) &
~state,
NULL,
_("%s for constrained angles"),
_("%s to move the whole line"));
......
......@@ -211,20 +211,23 @@ gimp_bucket_fill_options_reset (GimpToolOptions *tool_options)
GtkWidget *
gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *vbox2;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *scale;
GtkWidget *combo;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *vbox2;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *scale;
GtkWidget *combo;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
/* fill type */
str = g_strdup_printf (_("Fill Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK)),
gimp_get_mod_string (toggle_mask)),
frame = gimp_prop_enum_radio_frame_new (config, "fill-mode", str, 0, 0);
g_free (str);
......
......@@ -32,6 +32,7 @@
#include "core/gimppickable.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
......@@ -218,7 +219,7 @@ gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
{
GimpBucketFillOptions *options = GIMP_BUCKET_FILL_TOOL_GET_OPTIONS (tool);
if (key == GDK_CONTROL_MASK)
if (key == gimp_get_toggle_behavior_mask ())
{
switch (options->fill_mode)
{
......
......@@ -144,11 +144,14 @@ gimp_color_picker_options_get_property (GObject *object,
GtkWidget *
gimp_color_picker_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_color_options_gui (tool_options);
GtkWidget *button;
GtkWidget *frame;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_color_options_gui (tool_options);
GtkWidget *button;
GtkWidget *frame;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
/* the sample merged toggle button */
button = gimp_prop_check_button_new (config, "sample-merged",
......@@ -158,7 +161,7 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
/* the pick FG/BG frame */
str = g_strdup_printf (_("Pick Mode (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_enum_radio_frame_new (config, "pick-mode", str, -1, -1);
g_free (str);
......
......@@ -177,7 +177,7 @@ gimp_color_picker_tool_modifier_key (GimpTool *tool,
g_object_set (options, "use-info-window", ! options->use_info_window,
NULL);
}
else if (key == GDK_CONTROL_MASK)
else if (key == gimp_get_toggle_behavior_mask ())
{
switch (options->pick_mode)
{
......@@ -207,6 +207,9 @@ gimp_color_picker_tool_oper_update (GimpTool *tool,
{
GimpColorPickerTool *picker_tool = GIMP_COLOR_PICKER_TOOL (tool);
GimpColorPickerOptions *options = GIMP_COLOR_PICKER_TOOL_GET_OPTIONS (tool);
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
GIMP_COLOR_TOOL (tool)->pick_mode = options->pick_mode;
......@@ -231,16 +234,16 @@ gimp_color_picker_tool_oper_update (GimpTool *tool,
case GIMP_COLOR_PICK_MODE_FOREGROUND:
status_help = gimp_suggest_modifiers (_("Click in any image to pick"
" the foreground color"),
(shift_mod
| GDK_CONTROL_MASK) & ~state,
(shift_mod | toggle_mask) &
~state,
NULL, NULL, NULL);
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
status_help = gimp_suggest_modifiers (_("Click in any image to pick"
" the background color"),
(shift_mod
| GDK_CONTROL_MASK) & ~state,
(shift_mod | toggle_mask) &
~state,
NULL, NULL, NULL);
break;
......
......@@ -110,8 +110,11 @@ gimp_convolve_tool_modifier_key (GimpTool *tool,
{
GimpConvolveTool *convolve = GIMP_CONVOLVE_TOOL (tool);
GimpConvolveOptions *options = GIMP_CONVOLVE_TOOL_GET_OPTIONS (tool);
GdkModifierType toggle_mask;
if (((key == GDK_CONTROL_MASK) &&
toggle_mask = gimp_get_toggle_behavior_mask ();
if (((key == toggle_mask) &&
! (state & GDK_SHIFT_MASK) && /* leave stuff untouched in line draw mode */
press != convolve->toggled)
......@@ -120,7 +123,7 @@ gimp_convolve_tool_modifier_key (GimpTool *tool,
(key == GDK_SHIFT_MASK && /* toggle back after keypresses CTRL(hold)-> */
! press && /* SHIFT(hold)->CTRL(release)->SHIFT(release) */
convolve->toggled &&
! (state & GDK_CONTROL_MASK)))
! (state & toggle_mask)))
{
convolve->toggled = press;
......@@ -200,15 +203,18 @@ gimp_convolve_tool_status_update (GimpTool *tool,
static GtkWidget *
gimp_convolve_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *scale;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *scale;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
/* the type radio box */
str = g_strdup_printf (_("Convolve Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_enum_radio_frame_new (config, "type",
str, 0, 0);
......
......@@ -48,6 +48,7 @@
#include "widgets/gimpcolorbar.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpcurveview.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
......@@ -280,7 +281,7 @@ gimp_curves_tool_button_release (GimpTool *tool,
gimp_curve_set_point (curve, closest,
value, gimp_curve_map_value (curve, value));
}
else if (state & GDK_CONTROL_MASK)
else if (state & gimp_get_toggle_behavior_mask ())
{
gint i;
......@@ -338,7 +339,7 @@ gimp_curves_tool_oper_update (GimpTool *tool,
mode = GIMP_COLOR_PICK_MODE_PALETTE;
status = _("Click to add a control point");
}
else if (state & GDK_CONTROL_MASK)
else if (state & gimp_get_toggle_behavior_mask ())
{
mode = GIMP_COLOR_PICK_MODE_PALETTE;
status = _("Click to add control points to all channels");
......
......@@ -110,8 +110,11 @@ gimp_dodge_burn_tool_modifier_key (GimpTool *tool,
{
GimpDodgeBurnTool *dodgeburn = GIMP_DODGE_BURN_TOOL (tool);
GimpDodgeBurnOptions *options = GIMP_DODGE_BURN_TOOL_GET_OPTIONS (tool);
GdkModifierType toggle_mask;
if ((key == GDK_CONTROL_MASK &&
toggle_mask = gimp_get_toggle_behavior_mask ();
if ((key == toggle_mask &&
! (state & GDK_SHIFT_MASK) && /* leave stuff untouched in line draw mode */
press != dodgeburn->toggled)
......@@ -120,7 +123,7 @@ gimp_dodge_burn_tool_modifier_key (GimpTool *tool,
(key == GDK_SHIFT_MASK && /* toggle back after keypresses CTRL(hold)-> */
! press && /* SHIFT(hold)->CTRL(release)->SHIFT(release) */
dodgeburn->toggled &&
! (state & GDK_CONTROL_MASK)))
! (state & toggle_mask)))
{
dodgeburn->toggled = press;
......@@ -203,15 +206,18 @@ gimp_dodge_burn_tool_status_update (GimpTool *tool,
static GtkWidget *
gimp_dodge_burn_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *scale;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_paint_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *scale;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
/* the type (dodge or burn) */
str = g_strdup_printf (_("Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_enum_radio_frame_new (config, "type",
str, 0, 0);
......
......@@ -46,6 +46,8 @@
#include "vectors/gimpvectors.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-appearance.h"
......@@ -765,7 +767,8 @@ gimp_edit_selection_tool_active_modifier_key (GimpTool *tool,
{
GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool);
edit_select->constrain = state & GDK_CONTROL_MASK ? TRUE : FALSE;
edit_select->constrain = (state & gimp_get_constrain_behavior_mask () ?
TRUE : FALSE);
/* If we didn't came here due to a mouse release, immediately update
* the position of the thing we move.
......@@ -1104,7 +1107,7 @@ gimp_edit_selection_tool_key_press (GimpTool *tool,
if (kevent->state & GDK_MOD1_MASK)
translate_type = GIMP_TRANSFORM_TYPE_SELECTION;
else if (kevent->state & GDK_CONTROL_MASK)
else if (kevent->state & gimp_get_toggle_behavior_mask ())
translate_type = GIMP_TRANSFORM_TYPE_PATH;
else
translate_type = GIMP_TRANSFORM_TYPE_LAYER;
......
......@@ -115,13 +115,16 @@ gimp_flip_options_get_property (GObject *object,
GtkWidget *
gimp_flip_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
GtkWidget *hbox;
GtkWidget *box;
GtkWidget *label;
GtkWidget *frame;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
GtkWidget *hbox;
GtkWidget *box;
GtkWidget *label;
GtkWidget *frame;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
......@@ -137,7 +140,7 @@ gimp_flip_options_gui (GimpToolOptions *tool_options)
/* tool toggle */
str = g_strdup_printf (_("Flip Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_enum_radio_frame_new (config, "flip-type",
str,
......
......@@ -34,6 +34,7 @@
#include "core/gimppickable.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
......@@ -127,7 +128,7 @@ gimp_flip_tool_modifier_key (GimpTool *tool,
{
GimpFlipOptions *options = GIMP_FLIP_TOOL_GET_OPTIONS (tool);
if (key == GDK_CONTROL_MASK)
if (key == gimp_get_toggle_behavior_mask ())
{
switch (options->flip_type)
{
......
......@@ -258,18 +258,21 @@ gimp_foreground_select_options_get_property (GObject *object,
GtkWidget *
gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scale;
GtkWidget *label;
GtkWidget *menu;
GtkWidget *inner_frame;
GtkWidget *table;
gchar *title;
gint row = 0;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scale;
GtkWidget *label;
GtkWidget *menu;
GtkWidget *inner_frame;
GtkWidget *table;
gchar *title;
gint row = 0;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
gtk_widget_set_sensitive (GIMP_SELECTION_OPTIONS (tool_options)->antialias_toggle,
FALSE);
......@@ -281,7 +284,7 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
/* foreground / background */
title = g_strdup_printf (_("Interactive refinement (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_boolean_radio_frame_new (config, "background", title,
_("Mark background"),
......
......@@ -41,6 +41,7 @@
#include "core/gimpscanconvert.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -319,7 +320,7 @@ gimp_foreground_select_tool_modifier_key (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
if (key == GDK_CONTROL_MASK)
if (key == gimp_get_toggle_behavior_mask ())
{
GimpForegroundSelectOptions *options;
......
......@@ -38,6 +38,7 @@
#include "core/gimplayer-floating-sel.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpcanvasgroup.h"
#include "display/gimpdisplay.h"
......@@ -1385,9 +1386,10 @@ gimp_free_select_tool_modifier_key (GimpTool *tool,
{
gimp_draw_tool_pause (draw_tool);
priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
priv->constrain_angle = state & (gimp_get_constrain_behavior_mask () ?
TRUE : FALSE);
priv->supress_handles = state & GDK_SHIFT_MASK ? TRUE : FALSE;
priv->supress_handles = state & GDK_SHIFT_MASK ? TRUE : FALSE;
gimp_draw_tool_resume (draw_tool);
}
......@@ -1414,7 +1416,8 @@ gimp_free_select_tool_active_modifier_key (GimpTool *tool,
gimp_draw_tool_pause (draw_tool);
priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
priv->constrain_angle = state & (gimp_get_constrain_behavior_mask () ?
TRUE : FALSE);
/* If we didn't came here due to a mouse release, immediately update
* the position of the thing we move.
......
......@@ -158,11 +158,14 @@ gimp_magnify_options_reset (GimpToolOptions *tool_options)
GtkWidget *
gimp_magnify_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *button;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
GtkWidget *frame;
GtkWidget *button;
gchar *str;
GdkModifierType toggle_mask;
toggle_mask = gimp_get_toggle_behavior_mask ();
/* the auto_resize toggle button */
button = gimp_prop_check_button_new (config, "auto-resize",
......@@ -172,7 +175,7 @@ gimp_magnify_options_gui (GimpToolOptions *tool_options)
/* tool toggle */
str = g_strdup_printf (_("Direction (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (toggle_mask));
frame = gimp_prop_enum_radio_frame_new (config, "zoom-type",
str, 0, 0);
......
......@@ -28,6 +28,7 @@
#include "core/gimpimage.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpcanvasrectangle.h"
#include "display/gimpdisplay.h"
......@@ -324,7 +325,7 @@ gimp_magnify_tool_modifier_key (GimpTool *tool,
{
GimpMagnifyOptions *options = GIMP_MAGNIFY_TOOL_GET_OPTIONS (tool);
if (key == GDK_CONTROL_MASK)
if (key == gimp_get_toggle_behavior_mask ())
{
switch (options->zoom_type)
{
......
......@@ -220,12 +220,14 @@ gimp_measure_tool_button_press (GimpTool *tool,
*/
if (measure->point != -1)
{
if (state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))
GdkModifierType toggle_mask = gimp_get_toggle_behavior_mask ();
if (state & (toggle_mask | GDK_MOD1_MASK))
{
gboolean create_hguide;
gboolean create_vguide;
create_hguide = ((state & GDK_CONTROL_MASK) &&
create_hguide = ((state & toggle_mask) &&
(measure->y[measure->point] ==
CLAMP (measure->y[measure->point],
0,
......@@ -435,7 +437,7 @@ gimp_measure_tool_motion (GimpTool *tool,
measure->x[measure->point] = ROUND (coords->x);
measure->y[measure->point] = ROUND (coords->y);
if (state & GDK_CONTROL_MASK)
if (state & gimp_get_constrain_behavior_mask ())
{
gdouble x = measure->x[measure->point];
gdouble y = measure->y[measure->point];
......@@ -503,7 +505,8 @@ gimp_measure_tool_active_modifier_key (GimpTool *tool,
{
GimpMeasureTool *measure = GIMP_MEASURE_TOOL (tool);
if (key == GDK_CONTROL_MASK && measure->function == MOVING)
if (key == gimp_get_constrain_behavior_mask () &&
measure->function == MOVING)
{
gdouble x, y;
......@@ -546,9 +549,11 @@ gimp_measure_tool_oper_update (GimpTool *tool,
if (gimp_canvas_item_hit (measure->handles[i],
coords->x, coords->y))
{
GdkModifierType toggle_mask = gimp_get_toggle_behavior_mask ();
point = i;
if (state & GDK_CONTROL_MASK)
if (state & toggle_mask)
{
if (state & GDK_MOD1_MASK)
{
......@@ -576,7 +581,7 @@ gimp_measure_tool_oper_update (GimpTool *tool,
{
status = gimp_suggest_modifiers (_("Click to place a "
"vertical guide"),
GDK_CONTROL_MASK & ~state,
toggle_mask & ~state,
NULL, NULL, NULL);
gimp_tool_replace_status (tool, display, "%s", status);