app/actions/view-actions.c app/actions/view-commands.[ch]
2005-01-03 Michael Natterer <mitch@gimp.org> * app/actions/view-actions.c * app/actions/view-commands.[ch] * app/display/gimpdisplayshell-appearance.[ch] * menus/image-menu.xml.in: reordered actions, functions and menu items so the "show" and "snap" actions are grouped.
This commit is contained in:

committed by
Michael Natterer

parent
150bea1e80
commit
4a0b9cb662
@ -1,3 +1,11 @@
|
||||
2005-01-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/view-actions.c
|
||||
* app/actions/view-commands.[ch]
|
||||
* app/display/gimpdisplayshell-appearance.[ch]
|
||||
* menus/image-menu.xml.in: reordered actions, functions and menu
|
||||
items so the "show" and "snap" actions are grouped.
|
||||
|
||||
2005-01-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Implemented "Snap to Canvas Edges" (fixes bug #152971) and
|
||||
|
@ -139,18 +139,18 @@ static GimpToggleActionEntry view_toggle_actions[] =
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_SHOW_GUIDES },
|
||||
|
||||
{ "view-snap-to-guides", NULL,
|
||||
N_("Sn_ap to Guides"), NULL, NULL,
|
||||
G_CALLBACK (view_snap_to_guides_cmd_callback),
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_SNAP_TO_GUIDES },
|
||||
|
||||
{ "view-show-grid", NULL,
|
||||
N_("S_how Grid"), NULL, NULL,
|
||||
G_CALLBACK (view_toggle_grid_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_VIEW_SHOW_GRID },
|
||||
|
||||
{ "view-snap-to-guides", NULL,
|
||||
N_("Sn_ap to Guides"), NULL, NULL,
|
||||
G_CALLBACK (view_snap_to_guides_cmd_callback),
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_SNAP_TO_GUIDES },
|
||||
|
||||
{ "view-snap-to-grid", NULL,
|
||||
N_("Sna_p to Grid"), NULL, NULL,
|
||||
G_CALLBACK (view_snap_to_grid_cmd_callback),
|
||||
@ -158,13 +158,13 @@ static GimpToggleActionEntry view_toggle_actions[] =
|
||||
GIMP_HELP_VIEW_SNAP_TO_GRID },
|
||||
|
||||
{ "view-snap-to-canvas", NULL,
|
||||
N_("S_nap to Canvas Edges"), NULL, NULL,
|
||||
N_("Snap to _Canvas Edges"), NULL, NULL,
|
||||
G_CALLBACK (view_snap_to_canvas_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_VIEW_SNAP_TO_CANVAS },
|
||||
|
||||
{ "view-snap-to-vectors", NULL,
|
||||
N_("Snap to Active Pat_h"), NULL, NULL,
|
||||
N_("Snap t_o Active Path"), NULL, NULL,
|
||||
G_CALLBACK (view_snap_to_vectors_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_VIEW_SNAP_TO_VECTORS },
|
||||
@ -523,8 +523,8 @@ view_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("view-show-layer-boundary", gdisp);
|
||||
SET_ACTIVE ("view-show-layer-boundary", gdisp && options->show_layer_boundary);
|
||||
SET_ACTIVE ("view-show-guides", gdisp && options->show_guides);
|
||||
SET_ACTIVE ("view-snap-to-guides", gdisp && shell->snap_to_guides);
|
||||
SET_ACTIVE ("view-show-grid", gdisp && options->show_grid);
|
||||
SET_ACTIVE ("view-snap-to-guides", gdisp && shell->snap_to_guides);
|
||||
SET_ACTIVE ("view-snap-to-grid", gdisp && shell->snap_to_grid);
|
||||
SET_ACTIVE ("view-snap-to-canvas", gdisp && shell->snap_to_canvas);
|
||||
SET_ACTIVE ("view-snap-to-vectors", gdisp && shell->snap_to_vectors);
|
||||
|
@ -477,23 +477,6 @@ view_toggle_guides_cmd_callback (GtkAction *action,
|
||||
gimp_display_shell_set_show_guides (shell, active);
|
||||
}
|
||||
|
||||
void
|
||||
view_snap_to_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
gimp_display_shell_set_snap_to_guides (shell, active);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
view_toggle_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
@ -510,6 +493,22 @@ view_toggle_grid_cmd_callback (GtkAction *action,
|
||||
gimp_display_shell_set_show_grid (shell, active);
|
||||
}
|
||||
|
||||
void
|
||||
view_snap_to_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
gimp_display_shell_set_snap_to_guides (shell, active);
|
||||
}
|
||||
|
||||
void
|
||||
view_snap_to_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
|
@ -67,10 +67,11 @@ void view_toggle_statusbar_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void view_toggle_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void view_snap_to_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void view_toggle_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void view_snap_to_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void view_snap_to_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void view_snap_to_canvas_cmd_callback (GtkAction *action,
|
||||
|
@ -373,31 +373,6 @@ gimp_display_shell_get_show_grid (GimpDisplayShell *shell)
|
||||
return GET_OPTIONS (shell)->show_grid;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_grid)
|
||||
{
|
||||
shell->snap_to_grid = snap ? TRUE : FALSE;
|
||||
|
||||
SET_ACTIVE (shell->menubar_manager, "view-snap-to-grid", snap);
|
||||
|
||||
if (IS_ACTIVE_DISPLAY (shell))
|
||||
SET_ACTIVE (shell->popup_manager, "view-snap-to-grid", snap);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_guides (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
@ -427,6 +402,31 @@ gimp_display_shell_get_show_guides (GimpDisplayShell *shell)
|
||||
return GET_OPTIONS (shell)->show_guides;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (snap != shell->snap_to_grid)
|
||||
{
|
||||
shell->snap_to_grid = snap ? TRUE : FALSE;
|
||||
|
||||
SET_ACTIVE (shell->menubar_manager, "view-snap-to-grid", snap);
|
||||
|
||||
if (IS_ACTIVE_DISPLAY (shell))
|
||||
SET_ACTIVE (shell->popup_manager, "view-snap-to-grid", snap);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell,
|
||||
gboolean snap)
|
||||
|
@ -56,14 +56,14 @@ void gimp_display_shell_set_show_grid (GimpDisplayShell *shell,
|
||||
gboolean show);
|
||||
gboolean gimp_display_shell_get_show_grid (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
|
||||
gboolean snap);
|
||||
gboolean gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_show_guides (GimpDisplayShell *shell,
|
||||
gboolean show);
|
||||
gboolean gimp_display_shell_get_show_guides (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
|
||||
gboolean snap);
|
||||
gboolean gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell,
|
||||
gboolean snap);
|
||||
gboolean gimp_display_shell_get_snap_to_guides (GimpDisplayShell *shell);
|
||||
|
@ -238,11 +238,13 @@
|
||||
<menuitem action="view-show-selection" />
|
||||
<menuitem action="view-show-layer-boundary" />
|
||||
<menuitem action="view-show-guides" />
|
||||
<menuitem action="view-snap-to-guides" />
|
||||
<menuitem action="view-show-grid" />
|
||||
<separator />
|
||||
<menuitem action="view-snap-to-guides" />
|
||||
<menuitem action="view-snap-to-grid" />
|
||||
<menuitem action="view-snap-to-canvas" />
|
||||
<menuitem action="view-snap-to-vectors" />
|
||||
<separator />
|
||||
<menu action="view-padding-color-menu" name="Padding color">
|
||||
<menuitem action="view-padding-color-theme" />
|
||||
<menuitem action="view-padding-color-light-check" />
|
||||
@ -251,7 +253,6 @@
|
||||
<separator />
|
||||
<menuitem action="view-padding-color-prefs" />
|
||||
</menu>
|
||||
<separator />
|
||||
<menuitem action="view-show-menubar" />
|
||||
<menuitem action="view-show-rulers" />
|
||||
<menuitem action="view-show-scrollbars" />
|
||||
|
Reference in New Issue
Block a user