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.
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user