Commit 374e3793 authored by Sven Neumann's avatar Sven Neumann

Bug 575006 – Add preferences for snapping


	Bug 575006 – Add preferences for snapping

	* app/config/gimpdisplayconfig.[ch]
	* app/config/gimprc-blurbs.h
	* app/display/gimpdisplayshell.c: applied part of a patch from
	Akkana Peck. This adds gimprc properties for the default values
	used for snapping in new image windows. It also changes the
	default value for "Snap to Canvas Edges" to TRUE. Let's test 
this
	for a while...


svn path=/trunk/; revision=28151
parent e6d22d5f
2009-03-13 Sven Neumann <sven@gimp.org>
Bug 575006 Add preferences for snapping
* app/config/gimpdisplayconfig.[ch]
* app/config/gimprc-blurbs.h
* app/display/gimpdisplayshell.c: applied part of a patch from
Akkana Peck. This adds gimprc properties for the default values
used for snapping in new image windows. It also changes the
default value for "Snap to Canvas Edges" to TRUE. Let's test this
for a while...
2009-03-12 Sven Neumann <sven@gimp.org>
Bug 573695 – 1-bit white background saved as PBM becomes all black
......
......@@ -66,6 +66,10 @@ 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_XOR_COLOR,
......@@ -217,6 +221,26 @@ 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,
TRUE,
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,
......@@ -358,6 +382,18 @@ 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;
......@@ -453,6 +489,18 @@ 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;
......
......@@ -65,6 +65,10 @@ 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;
GimpRGB xor_color;
......
......@@ -75,6 +75,18 @@ 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 \
"Snap to guides by default in new image windows."
#define DEFAULT_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 DEFAULT_SNAP_TO_PATH_BLURB \
"Snap to the active path by default in new image windows."
#define DEFAULT_THRESHOLD_BLURB \
N_("Tools such as fuzzy-select and bucket fill find regions based on a " \
"seed-fill algorithm. The seed fill starts at the initially selected " \
......
......@@ -889,6 +889,11 @@ gimp_display_shell_new (GimpDisplay *display,
gimp_config_sync (G_OBJECT (display->config->default_fullscreen_view),
G_OBJECT (shell->fullscreen_options), 0);
shell->snap_to_guides = display->config->default_snap_to_guides;
shell->snap_to_grid = display->config->default_snap_to_grid;
shell->snap_to_canvas = display->config->default_snap_to_canvas;
shell->snap_to_vectors = display->config->default_snap_to_path;
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
if (display->config->monitor_res_from_gdk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment