mirror of https://github.com/GNOME/gimp.git
app/config/gimpguiconfig.[ch] app/config/gimprc-blurbs.h
2004-10-30 Sven Neumann <sven@gimp.org> * app/config/gimpguiconfig.[ch] * app/config/gimprc-blurbs.h * app/dialogs/preferences-dialog.c * app/tools/gimpmoveoptions.[ch] * app/tools/gimpmovetool.[ch]: reverted changes for bug #156801. Instead added a gimprc option that allows to get the old behaviour back.
This commit is contained in:
parent
e4a871c10b
commit
267676fa99
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2004-10-30 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/config/gimpguiconfig.[ch]
|
||||
* app/config/gimprc-blurbs.h
|
||||
* app/dialogs/preferences-dialog.c
|
||||
* app/tools/gimpmoveoptions.[ch]
|
||||
* app/tools/gimpmovetool.[ch]: reverted changes for bug #156801.
|
||||
Instead added a gimprc option that allows to get the old behaviour
|
||||
back.
|
||||
|
||||
2004-10-30 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimpmoveoptions.[ch]
|
||||
|
|
|
@ -63,6 +63,7 @@ enum
|
|||
{
|
||||
PROP_0,
|
||||
PROP_DEFAULT_THRESHOLD,
|
||||
PROP_MOVE_TOOL_CHANGES_ACTIVE,
|
||||
PROP_INFO_WINDOW_PER_DISPLAY,
|
||||
PROP_TRUST_DIRTY_FLAG,
|
||||
PROP_SAVE_DEVICE_STATUS,
|
||||
|
@ -140,6 +141,11 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
|
|||
"default-threshold", DEFAULT_THRESHOLD_BLURB,
|
||||
0, 255, 15,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MOVE_TOOL_CHANGES_ACTIVE,
|
||||
"move-tool-changes-active",
|
||||
MOVE_TOOL_CHANGES_ACTIVE_BLURB,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INFO_WINDOW_PER_DISPLAY,
|
||||
"info-window-per-display",
|
||||
INFO_WINDOW_PER_DISPLAY_BLURB,
|
||||
|
@ -292,6 +298,9 @@ gimp_gui_config_set_property (GObject *object,
|
|||
case PROP_DEFAULT_THRESHOLD:
|
||||
gui_config->default_threshold = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_MOVE_TOOL_CHANGES_ACTIVE:
|
||||
gui_config->move_tool_changes_active = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_INFO_WINDOW_PER_DISPLAY:
|
||||
gui_config->info_window_per_display = g_value_get_boolean (value);
|
||||
break;
|
||||
|
@ -397,6 +406,9 @@ gimp_gui_config_get_property (GObject *object,
|
|||
case PROP_DEFAULT_THRESHOLD:
|
||||
g_value_set_int (value, gui_config->default_threshold);
|
||||
break;
|
||||
case PROP_MOVE_TOOL_CHANGES_ACTIVE:
|
||||
g_value_set_boolean (value, gui_config->move_tool_changes_active);
|
||||
break;
|
||||
case PROP_INFO_WINDOW_PER_DISPLAY:
|
||||
g_value_set_boolean (value, gui_config->info_window_per_display);
|
||||
break;
|
||||
|
|
|
@ -41,6 +41,7 @@ struct _GimpGuiConfig
|
|||
GimpDisplayConfig parent_instance;
|
||||
|
||||
gint default_threshold;
|
||||
gboolean move_tool_changes_active;
|
||||
gboolean info_window_per_display;
|
||||
gboolean trust_dirty_flag;
|
||||
gboolean save_device_status;
|
||||
|
|
|
@ -205,6 +205,11 @@ N_("Sets the monitor's vertical resolution, in dots per inch. If set to " \
|
|||
"0, forces the X server to be queried for both horizontal and vertical " \
|
||||
"resolution information.")
|
||||
|
||||
#define MOVE_TOOL_CHANGES_ACTIVE_BLURB \
|
||||
N_("If enabled, the move tool changes the active layer or path when a layer " \
|
||||
"or path is being picked. This used to be the default behaviour in older " \
|
||||
"versions.")
|
||||
|
||||
#define NAVIGATION_PREVIEW_SIZE_BLURB \
|
||||
N_("Sets the size of the navigation preview available in the lower right " \
|
||||
"corner of the image window.")
|
||||
|
|
|
@ -1590,6 +1590,14 @@ prefs_dialog_new (Gimp *gimp,
|
|||
_("_Gradient"), GIMP_STOCK_GRADIENT,
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
vbox2 = prefs_frame_new (_("Move Tool"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add_with_icon (object, "move-tool-changes-active",
|
||||
_("Change current layer or path"),
|
||||
GIMP_STOCK_TOOL_MOVE,
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
g_object_unref (size_group);
|
||||
size_group = NULL;
|
||||
|
||||
|
|
|
@ -41,8 +41,7 @@ enum
|
|||
{
|
||||
PROP_0,
|
||||
PROP_MOVE_TYPE,
|
||||
PROP_MOVE_CURRENT,
|
||||
PROP_CHANGE_ACTIVE
|
||||
PROP_MOVE_CURRENT
|
||||
};
|
||||
|
||||
|
||||
|
@ -108,11 +107,6 @@ gimp_move_options_class_init (GimpMoveOptionsClass *klass)
|
|||
"move-current", NULL,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CHANGE_ACTIVE,
|
||||
"change-active", NULL,
|
||||
FALSE,
|
||||
0);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -131,9 +125,6 @@ gimp_move_options_set_property (GObject *object,
|
|||
case PROP_MOVE_CURRENT:
|
||||
options->move_current = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_CHANGE_ACTIVE:
|
||||
options->change_active = g_value_get_boolean (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
|
@ -156,9 +147,6 @@ gimp_move_options_get_property (GObject *object,
|
|||
case PROP_MOVE_CURRENT:
|
||||
g_value_set_boolean (value, options->move_current);
|
||||
break;
|
||||
case PROP_CHANGE_ACTIVE:
|
||||
g_value_set_boolean (value, options->change_active);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
|
@ -172,33 +160,26 @@ gimp_move_options_notify_type (GimpMoveOptions *move_options,
|
|||
{
|
||||
const gchar *false_label = NULL;
|
||||
const gchar *true_label = NULL;
|
||||
const gchar *change_active_label = NULL;
|
||||
GtkWidget *button;
|
||||
GtkWidget *check;
|
||||
GSList *group;
|
||||
|
||||
button = g_object_get_data (G_OBJECT (frame), "radio-button");
|
||||
check = g_object_get_data (G_OBJECT (frame), "check");
|
||||
|
||||
switch (move_options->move_type)
|
||||
{
|
||||
case GIMP_TRANSFORM_TYPE_LAYER:
|
||||
false_label = _("Pick a layer or guide to Move");
|
||||
true_label = _("Move the active layer");
|
||||
change_active_label = _("Change the active layer");
|
||||
false_label = _("Pick a layer or guide");
|
||||
true_label = _("Move the current layer");
|
||||
break;
|
||||
|
||||
case GIMP_TRANSFORM_TYPE_SELECTION:
|
||||
false_label = _("Move selection");
|
||||
true_label = _("Move selection");
|
||||
change_active_label = NULL;
|
||||
false_label = true_label = _("Move selection");
|
||||
break;
|
||||
|
||||
case GIMP_TRANSFORM_TYPE_PATH:
|
||||
false_label = _("Pick a path to move");
|
||||
true_label = _("Move the active path");
|
||||
change_active_label = _("Change the active path");
|
||||
break;
|
||||
false_label = _("Pick a path");
|
||||
true_label = _("Move the current path");
|
||||
break;
|
||||
}
|
||||
|
||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
||||
|
@ -207,21 +188,8 @@ gimp_move_options_notify_type (GimpMoveOptions *move_options,
|
|||
group = g_slist_next (group);
|
||||
gtk_button_set_label (GTK_BUTTON (group->data), false_label);
|
||||
|
||||
gtk_button_set_label (GTK_BUTTON (check), change_active_label);
|
||||
|
||||
gtk_widget_set_sensitive (frame,
|
||||
move_options->move_type != GIMP_TRANSFORM_TYPE_SELECTION);
|
||||
gtk_widget_set_sensitive (check,
|
||||
move_options->move_type != GIMP_TRANSFORM_TYPE_SELECTION);
|
||||
|
||||
if (move_options->move_type == GIMP_TRANSFORM_TYPE_SELECTION)
|
||||
{
|
||||
gtk_widget_hide (check);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_show (check);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
@ -232,7 +200,6 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
|
|||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *check;
|
||||
gchar *title;
|
||||
|
||||
vbox = gimp_tool_options_gui (tool_options);
|
||||
|
@ -253,11 +220,6 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
|
|||
frame = gimp_prop_boolean_radio_frame_new (config, "move-current",
|
||||
title, "true", "false");
|
||||
|
||||
/* change active layer */
|
||||
check = gimp_prop_check_button_new (config, "change_active", "false");
|
||||
|
||||
g_object_set_data (G_OBJECT (frame), "check", check);
|
||||
|
||||
gimp_move_options_notify_type (GIMP_MOVE_OPTIONS (config), NULL, frame);
|
||||
|
||||
g_signal_connect_object (config, "notify::move-type",
|
||||
|
@ -267,10 +229,6 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
|
||||
if (GIMP_MOVE_OPTIONS (config)->move_type == GIMP_TRANSFORM_TYPE_SELECTION)
|
||||
gtk_widget_show (check);
|
||||
|
||||
g_free (title);
|
||||
|
||||
return vbox;
|
||||
|
|
|
@ -40,7 +40,6 @@ struct _GimpMoveOptions
|
|||
|
||||
GimpTransformType move_type;
|
||||
gboolean move_current;
|
||||
gboolean change_active;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "tools-types.h"
|
||||
|
||||
#include "config/gimpdisplayconfig.h"
|
||||
#include "config/gimpguiconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
@ -237,7 +238,6 @@ gimp_move_tool_button_press (GimpTool *tool,
|
|||
move->moving_guide = FALSE;
|
||||
move->old_active_layer = NULL;
|
||||
move->old_active_vectors = NULL;
|
||||
move->change_active = options->change_active;
|
||||
|
||||
if (! options->move_current)
|
||||
{
|
||||
|
@ -362,8 +362,9 @@ gimp_move_tool_button_release (GimpTool *tool,
|
|||
GdkModifierType state,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpMoveTool *move = GIMP_MOVE_TOOL (tool);
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
GimpMoveTool *move = GIMP_MOVE_TOOL (tool);
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
GimpGuiConfig *config = GIMP_GUI_CONFIG (gdisp->gimage->gimp->config);
|
||||
|
||||
if (gimp_tool_control_is_active (tool->control))
|
||||
gimp_tool_control_halt (tool->control);
|
||||
|
@ -456,24 +457,21 @@ gimp_move_tool_button_release (GimpTool *tool,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (move->old_active_layer)
|
||||
if (! config->move_tool_changes_active || (state & GDK_BUTTON3_MASK))
|
||||
{
|
||||
if ( ! move->change_active)
|
||||
if (move->old_active_layer)
|
||||
{
|
||||
gimp_image_set_active_layer (gdisp->gimage,
|
||||
move->old_active_layer);
|
||||
move->old_active_layer = NULL;
|
||||
}
|
||||
move->old_active_layer = NULL;
|
||||
}
|
||||
|
||||
if (move->old_active_vectors)
|
||||
{
|
||||
if (! move->change_active)
|
||||
if (move->old_active_vectors)
|
||||
{
|
||||
gimp_image_set_active_vectors (gdisp->gimage,
|
||||
move->old_active_vectors);
|
||||
move->old_active_vectors = NULL;
|
||||
}
|
||||
move->old_active_vectors = NULL;
|
||||
}
|
||||
|
||||
/* Take care of the case where the user "cancels" the action */
|
||||
|
|
|
@ -49,8 +49,6 @@ struct _GimpMoveTool
|
|||
|
||||
GimpLayer *old_active_layer;
|
||||
GimpVectors *old_active_vectors;
|
||||
|
||||
gboolean change_active;
|
||||
};
|
||||
|
||||
struct _GimpMoveToolClass
|
||||
|
|
Loading…
Reference in New Issue