Bug 704065 - Snap default preferences are now settable in the preferences.
Along with this change, the snap preferences have been moved from GimpDisplayConfig to GimpDisplayOptions, where it makes much more sense. One of the consequences is that there is no need to duplicate these values in GimpDisplayShell anymore to differenciate defaults and current settings.
This commit is contained in:
@ -698,13 +698,13 @@ view_actions_update (GimpActionGroup *group,
|
||||
SET_ACTIVE ("view-show-sample-points", display && options->show_sample_points);
|
||||
|
||||
SET_SENSITIVE ("view-snap-to-guides", image);
|
||||
SET_ACTIVE ("view-snap-to-guides", display && shell->snap_to_guides);
|
||||
SET_ACTIVE ("view-snap-to-guides", display && options->snap_to_guides);
|
||||
SET_SENSITIVE ("view-snap-to-grid", image);
|
||||
SET_ACTIVE ("view-snap-to-grid", display && shell->snap_to_grid);
|
||||
SET_ACTIVE ("view-snap-to-grid", display && options->snap_to_grid);
|
||||
SET_SENSITIVE ("view-snap-to-canvas", image);
|
||||
SET_ACTIVE ("view-snap-to-canvas", display && shell->snap_to_canvas);
|
||||
SET_ACTIVE ("view-snap-to-canvas", display && options->snap_to_canvas);
|
||||
SET_SENSITIVE ("view-snap-to-vectors", image);
|
||||
SET_ACTIVE ("view-snap-to-vectors", display && shell->snap_to_vectors);
|
||||
SET_ACTIVE ("view-snap-to-vectors", display && options->snap_to_path);
|
||||
|
||||
SET_SENSITIVE ("view-padding-color-theme", image);
|
||||
SET_SENSITIVE ("view-padding-color-light-check", image);
|
||||
|
@ -66,16 +66,16 @@ enum
|
||||
PROP_NAV_PREVIEW_SIZE,
|
||||
PROP_DEFAULT_VIEW,
|
||||
PROP_DEFAULT_FULLSCREEN_VIEW,
|
||||
PROP_DEFAULT_SNAP_TO_GUIDES,
|
||||
PROP_DEFAULT_SNAP_TO_GRID,
|
||||
PROP_DEFAULT_SNAP_TO_CANVAS,
|
||||
PROP_DEFAULT_SNAP_TO_PATH,
|
||||
PROP_ACTIVATE_ON_FOCUS,
|
||||
PROP_SPACE_BAR_ACTION,
|
||||
PROP_ZOOM_QUALITY,
|
||||
PROP_USE_EVENT_HISTORY,
|
||||
|
||||
/* ignored, only for backward compatibility: */
|
||||
PROP_DEFAULT_SNAP_TO_GUIDES,
|
||||
PROP_DEFAULT_SNAP_TO_GRID,
|
||||
PROP_DEFAULT_SNAP_TO_CANVAS,
|
||||
PROP_DEFAULT_SNAP_TO_PATH,
|
||||
PROP_CONFIRM_ON_CLOSE,
|
||||
PROP_XOR_COLOR
|
||||
};
|
||||
@ -219,26 +219,6 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
GIMP_TYPE_DISPLAY_OPTIONS,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_AGGREGATE);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_GUIDES,
|
||||
"default-snap-to-guides",
|
||||
DEFAULT_SNAP_TO_GUIDES_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_GRID,
|
||||
"default-snap-to-grid",
|
||||
DEFAULT_SNAP_TO_GRID_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_CANVAS,
|
||||
"default-snap-to-canvas",
|
||||
DEFAULT_SNAP_TO_CANVAS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_PATH,
|
||||
"default-snap-to-path",
|
||||
DEFAULT_SNAP_TO_PATH_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ACTIVATE_ON_FOCUS,
|
||||
"activate-on-focus",
|
||||
ACTIVATE_ON_FOCUS_BLURB,
|
||||
@ -264,6 +244,26 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
/* only for backward compatibility: */
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_GUIDES,
|
||||
"default-snap-to-guides", NULL,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_IGNORE);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_GRID,
|
||||
"default-snap-to-grid", NULL,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_IGNORE);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_CANVAS,
|
||||
"default-snap-to-canvas", NULL,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_IGNORE);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_SNAP_TO_PATH,
|
||||
"default-snap-to-path", NULL,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_IGNORE);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CONFIRM_ON_CLOSE,
|
||||
"confirm-on-close", NULL,
|
||||
TRUE,
|
||||
@ -391,18 +391,6 @@ gimp_display_config_set_property (GObject *object,
|
||||
G_OBJECT (display_config->default_fullscreen_view),
|
||||
0);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_GUIDES:
|
||||
display_config->default_snap_to_guides = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_GRID:
|
||||
display_config->default_snap_to_grid = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_CANVAS:
|
||||
display_config->default_snap_to_canvas = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_PATH:
|
||||
display_config->default_snap_to_path = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_ACTIVATE_ON_FOCUS:
|
||||
display_config->activate_on_focus = g_value_get_boolean (value);
|
||||
break;
|
||||
@ -416,6 +404,10 @@ gimp_display_config_set_property (GObject *object,
|
||||
display_config->use_event_history = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_DEFAULT_SNAP_TO_GUIDES:
|
||||
case PROP_DEFAULT_SNAP_TO_GRID:
|
||||
case PROP_DEFAULT_SNAP_TO_CANVAS:
|
||||
case PROP_DEFAULT_SNAP_TO_PATH:
|
||||
case PROP_CONFIRM_ON_CLOSE:
|
||||
case PROP_XOR_COLOR:
|
||||
/* ignored */
|
||||
@ -500,18 +492,6 @@ gimp_display_config_get_property (GObject *object,
|
||||
case PROP_DEFAULT_FULLSCREEN_VIEW:
|
||||
g_value_set_object (value, display_config->default_fullscreen_view);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_GUIDES:
|
||||
g_value_set_boolean (value, display_config->default_snap_to_guides);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_GRID:
|
||||
g_value_set_boolean (value, display_config->default_snap_to_grid);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_CANVAS:
|
||||
g_value_set_boolean (value, display_config->default_snap_to_canvas);
|
||||
break;
|
||||
case PROP_DEFAULT_SNAP_TO_PATH:
|
||||
g_value_set_boolean (value, display_config->default_snap_to_path);
|
||||
break;
|
||||
case PROP_ACTIVATE_ON_FOCUS:
|
||||
g_value_set_boolean (value, display_config->activate_on_focus);
|
||||
break;
|
||||
@ -525,6 +505,10 @@ gimp_display_config_get_property (GObject *object,
|
||||
g_value_set_boolean (value, display_config->use_event_history);
|
||||
break;
|
||||
|
||||
case PROP_DEFAULT_SNAP_TO_GUIDES:
|
||||
case PROP_DEFAULT_SNAP_TO_GRID:
|
||||
case PROP_DEFAULT_SNAP_TO_CANVAS:
|
||||
case PROP_DEFAULT_SNAP_TO_PATH:
|
||||
case PROP_CONFIRM_ON_CLOSE:
|
||||
case PROP_XOR_COLOR:
|
||||
/* ignored */
|
||||
|
@ -62,10 +62,6 @@ struct _GimpDisplayConfig
|
||||
GimpViewSize nav_preview_size;
|
||||
GimpDisplayOptions *default_view;
|
||||
GimpDisplayOptions *default_fullscreen_view;
|
||||
gboolean default_snap_to_guides;
|
||||
gboolean default_snap_to_grid;
|
||||
gboolean default_snap_to_canvas;
|
||||
gboolean default_snap_to_path;
|
||||
gboolean activate_on_focus;
|
||||
GimpSpaceBarAction space_bar_action;
|
||||
GimpZoomQuality zoom_quality;
|
||||
|
@ -50,6 +50,10 @@ enum
|
||||
PROP_SHOW_GUIDES,
|
||||
PROP_SHOW_GRID,
|
||||
PROP_SHOW_SAMPLE_POINTS,
|
||||
PROP_SNAP_TO_GUIDES,
|
||||
PROP_SNAP_TO_GRID,
|
||||
PROP_SNAP_TO_CANVAS,
|
||||
PROP_SNAP_TO_PATH,
|
||||
PROP_PADDING_MODE,
|
||||
PROP_PADDING_COLOR
|
||||
};
|
||||
@ -138,6 +142,22 @@ gimp_display_options_class_init (GimpDisplayOptionsClass *klass)
|
||||
"show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GUIDES,
|
||||
"snap-to-guides", SNAP_TO_GUIDES_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GRID,
|
||||
"snap-to-grid", SNAP_TO_GRID_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_CANVAS,
|
||||
"snap-to-canvas", SNAP_TO_CANVAS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_PATH,
|
||||
"snap-to-path", SNAP_TO_PATH_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PADDING_MODE,
|
||||
"padding-mode", CANVAS_PADDING_MODE_BLURB,
|
||||
GIMP_TYPE_CANVAS_PADDING_MODE,
|
||||
@ -196,6 +216,22 @@ gimp_display_options_fullscreen_class_init (GimpDisplayOptionsFullscreenClass *k
|
||||
"show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GUIDES,
|
||||
"snap-to-guides", SNAP_TO_GUIDES_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GRID,
|
||||
"snap-to-grid", SHOW_SCROLLBARS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_CANVAS,
|
||||
"snap-to-canvas", SNAP_TO_CANVAS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_PATH,
|
||||
"snap-to-path", SNAP_TO_PATH_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PADDING_MODE,
|
||||
"padding-mode", CANVAS_PADDING_MODE_BLURB,
|
||||
GIMP_TYPE_CANVAS_PADDING_MODE,
|
||||
@ -243,6 +279,22 @@ gimp_display_options_no_image_class_init (GimpDisplayOptionsNoImageClass *klass)
|
||||
"show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GUIDES,
|
||||
"snap-to-guides", SNAP_TO_GUIDES_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_GRID,
|
||||
"snap-to-grid", SHOW_SCROLLBARS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_CANVAS,
|
||||
"snap-to-canvas", SNAP_TO_CANVAS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SNAP_TO_PATH,
|
||||
"snap-to-path", SNAP_TO_PATH_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -288,6 +340,18 @@ gimp_display_options_set_property (GObject *object,
|
||||
case PROP_SHOW_SAMPLE_POINTS:
|
||||
options->show_sample_points = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SNAP_TO_GUIDES:
|
||||
options->snap_to_guides = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SNAP_TO_GRID:
|
||||
options->snap_to_grid = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SNAP_TO_CANVAS:
|
||||
options->snap_to_canvas = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SNAP_TO_PATH:
|
||||
options->snap_to_path = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_PADDING_MODE:
|
||||
options->padding_mode = g_value_get_enum (value);
|
||||
break;
|
||||
@ -338,6 +402,18 @@ gimp_display_options_get_property (GObject *object,
|
||||
case PROP_SHOW_SAMPLE_POINTS:
|
||||
g_value_set_boolean (value, options->show_sample_points);
|
||||
break;
|
||||
case PROP_SNAP_TO_GUIDES:
|
||||
g_value_set_boolean (value, options->snap_to_guides);
|
||||
break;
|
||||
case PROP_SNAP_TO_GRID:
|
||||
g_value_set_boolean (value, options->snap_to_grid);
|
||||
break;
|
||||
case PROP_SNAP_TO_CANVAS:
|
||||
g_value_set_boolean (value, options->snap_to_canvas);
|
||||
break;
|
||||
case PROP_SNAP_TO_PATH:
|
||||
g_value_set_boolean (value, options->snap_to_path);
|
||||
break;
|
||||
case PROP_PADDING_MODE:
|
||||
g_value_set_enum (value, options->padding_mode);
|
||||
break;
|
||||
|
@ -46,13 +46,17 @@ struct _GimpDisplayOptions
|
||||
/* GimpDisplayShell options */
|
||||
gboolean show_rulers;
|
||||
gboolean show_scrollbars;
|
||||
|
||||
/* GimpCanvas options */
|
||||
gboolean show_selection;
|
||||
gboolean show_layer_boundary;
|
||||
gboolean show_guides;
|
||||
gboolean show_grid;
|
||||
gboolean show_sample_points;
|
||||
|
||||
gboolean snap_to_guides;
|
||||
gboolean snap_to_grid;
|
||||
gboolean snap_to_canvas;
|
||||
gboolean snap_to_path;
|
||||
|
||||
GimpCanvasPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
gboolean padding_mode_set;
|
||||
|
@ -93,16 +93,16 @@ N_("When enabled, this will ensure that each pixel of an image gets " \
|
||||
N_("This is the distance in pixels where Guide and Grid snapping " \
|
||||
"activates.")
|
||||
|
||||
#define DEFAULT_SNAP_TO_GUIDES_BLURB \
|
||||
#define SNAP_TO_GUIDES_BLURB \
|
||||
"Snap to guides by default in new image windows."
|
||||
|
||||
#define DEFAULT_SNAP_TO_GRID_BLURB \
|
||||
#define SNAP_TO_GRID_BLURB \
|
||||
"Snap to the grid by default in new image windows."
|
||||
|
||||
#define DEFAULT_SNAP_TO_CANVAS_BLURB \
|
||||
"Snap to the canvas edge by default in new image windows."
|
||||
#define SNAP_TO_CANVAS_BLURB \
|
||||
"Snap to the canvas edges by default in new image windows."
|
||||
|
||||
#define DEFAULT_SNAP_TO_PATH_BLURB \
|
||||
#define SNAP_TO_PATH_BLURB \
|
||||
"Snap to the active path by default in new image windows."
|
||||
|
||||
#define DEFAULT_THRESHOLD_BLURB \
|
||||
|
@ -1139,6 +1139,45 @@ prefs_display_options_frame_add (Gimp *gimp,
|
||||
combo);
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_behavior_options_frame_add (Gimp *gimp,
|
||||
GObject *object,
|
||||
const gchar *label,
|
||||
GtkContainer *parent)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *checks_vbox;
|
||||
|
||||
vbox = prefs_frame_new (label, parent, FALSE);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
checks_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
|
||||
gtk_widget_show (checks_vbox);
|
||||
|
||||
prefs_check_button_add (object, "snap-to-guides",
|
||||
_("Snap to Guides"),
|
||||
GTK_BOX (checks_vbox));
|
||||
prefs_check_button_add (object, "snap-to-grid",
|
||||
_("Snap to Grid"),
|
||||
GTK_BOX (checks_vbox));
|
||||
|
||||
checks_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
|
||||
gtk_widget_show (checks_vbox);
|
||||
|
||||
prefs_check_button_add (object, "snap-to-canvas",
|
||||
_("Snap to Canvas Edges"),
|
||||
GTK_BOX (checks_vbox));
|
||||
prefs_check_button_add (object, "snap-to-path",
|
||||
_("Snap to Active Path"),
|
||||
GTK_BOX (checks_vbox));
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_help_func (const gchar *help_id,
|
||||
gpointer help_data)
|
||||
@ -2072,6 +2111,28 @@ prefs_dialog_new (Gimp *gimp,
|
||||
}
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/* Image Windows / Behavior */
|
||||
/********************************/
|
||||
pixbuf = prefs_get_pixbufs (gimp, "tool-options", &small_pixbuf);
|
||||
vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box),
|
||||
_("Image Window Drawing Behavior"),
|
||||
pixbuf,
|
||||
_("Behavior"),
|
||||
small_pixbuf,
|
||||
GIMP_HELP_PREFS_IMAGE_WINDOW_APPEARANCE,
|
||||
&top_iter,
|
||||
&child_iter);
|
||||
|
||||
prefs_behavior_options_frame_add (gimp,
|
||||
G_OBJECT (display_config->default_view),
|
||||
_("Default Behavior in Normal Mode"),
|
||||
GTK_CONTAINER (vbox));
|
||||
prefs_behavior_options_frame_add (gimp,
|
||||
G_OBJECT (display_config->default_fullscreen_view),
|
||||
_("Default Behavior in Fullscreen Mode"),
|
||||
GTK_CONTAINER (vbox));
|
||||
|
||||
|
||||
/*************/
|
||||
/* Display */
|
||||
|
@ -362,14 +362,13 @@ void
|
||||
gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
GimpDisplayOptions *options;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_grid)
|
||||
{
|
||||
shell->snap_to_grid = snap ? TRUE : FALSE;
|
||||
options = appearance_get_options (shell);
|
||||
|
||||
appearance_set_action_active (shell, "view-snap-to-grid", snap);
|
||||
}
|
||||
g_object_set (options, "snap-to-grid", snap, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -377,21 +376,20 @@ gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return shell->snap_to_grid;
|
||||
return appearance_get_options (shell)->snap_to_grid;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
GimpDisplayOptions *options;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_guides)
|
||||
{
|
||||
shell->snap_to_guides = snap ? TRUE : FALSE;
|
||||
options = appearance_get_options (shell);
|
||||
|
||||
appearance_set_action_active (shell, "view-snap-to-guides", snap);
|
||||
}
|
||||
g_object_set (options, "snap-to-guides", snap, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -399,21 +397,20 @@ gimp_display_shell_get_snap_to_guides (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return shell->snap_to_guides;
|
||||
return appearance_get_options (shell)->snap_to_guides;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_canvas (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
GimpDisplayOptions *options;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_canvas)
|
||||
{
|
||||
shell->snap_to_canvas = snap ? TRUE : FALSE;
|
||||
options = appearance_get_options (shell);
|
||||
|
||||
appearance_set_action_active (shell, "view-snap-to-canvas", snap);
|
||||
}
|
||||
g_object_set (options, "snap-to-canvas", snap, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -421,21 +418,20 @@ gimp_display_shell_get_snap_to_canvas (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return shell->snap_to_canvas;
|
||||
return appearance_get_options (shell)->snap_to_canvas;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_vectors (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
GimpDisplayOptions *options;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_vectors)
|
||||
{
|
||||
shell->snap_to_vectors = snap ? TRUE : FALSE;
|
||||
options = appearance_get_options (shell);
|
||||
|
||||
appearance_set_action_active (shell, "view-snap-to-vectors", snap);
|
||||
}
|
||||
g_object_set (options, "snap-to-path", snap, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -443,7 +439,7 @@ gimp_display_shell_get_snap_to_vectors (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return shell->snap_to_vectors;
|
||||
return appearance_get_options (shell)->snap_to_path;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1079,31 +1079,6 @@ gimp_display_shell_sync_config (GimpDisplayShell *shell,
|
||||
G_OBJECT (shell->options), 0);
|
||||
gimp_config_sync (G_OBJECT (config->default_fullscreen_view),
|
||||
G_OBJECT (shell->fullscreen_options), 0);
|
||||
|
||||
if (shell->display && gimp_display_get_shell (shell->display))
|
||||
{
|
||||
/* if the shell is already fully constructed, use proper API
|
||||
* so the actions are updated accordingly.
|
||||
*/
|
||||
gimp_display_shell_set_snap_to_guides (shell,
|
||||
config->default_snap_to_guides);
|
||||
gimp_display_shell_set_snap_to_grid (shell,
|
||||
config->default_snap_to_grid);
|
||||
gimp_display_shell_set_snap_to_canvas (shell,
|
||||
config->default_snap_to_canvas);
|
||||
gimp_display_shell_set_snap_to_vectors (shell,
|
||||
config->default_snap_to_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* otherwise the shell is currently being constructed and
|
||||
* display->shell is NULL.
|
||||
*/
|
||||
shell->snap_to_guides = config->default_snap_to_guides;
|
||||
shell->snap_to_grid = config->default_snap_to_grid;
|
||||
shell->snap_to_canvas = config->default_snap_to_canvas;
|
||||
shell->snap_to_vectors = config->default_snap_to_path;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -57,11 +57,6 @@ struct _GimpDisplayShell
|
||||
GimpDisplayOptions *fullscreen_options;
|
||||
GimpDisplayOptions *no_image_options;
|
||||
|
||||
gboolean snap_to_guides; /* should the guides be snapped to? */
|
||||
gboolean snap_to_grid; /* should the grid be snapped to? */
|
||||
gboolean snap_to_canvas; /* should the canvas be snapped to? */
|
||||
gboolean snap_to_vectors; /* should the active path be snapped */
|
||||
|
||||
GimpUnit unit;
|
||||
|
||||
gint offset_x; /* offset of display image */
|
||||
|
Reference in New Issue
Block a user