Commit c3a4ddc6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

reordered the View menu, moved all Zoom-related entries into a submenu.

2003-03-12  Sven Neumann  <sven@gimp.org>

	* app/gui/image-menu.c: reordered the View menu, moved all
	Zoom-related entries into a submenu. Use radio items for the zoom
	ratio as suggested in bug #74385.

	* app/gui/view-commands.c (view_zoom_cmd_callback): only call
	gimp_display_shell_scale() if the item is active and the current
	scale is different from the requested one.

	* app/display/gimpdisplayshell.c (gimp_display_shell_real_scaled):
	update the image menu so that the zoom ratio is displayed correctly.

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_realize): don't call
	gimp_display_shell_scale_setup(), since it is done in the configure
	event handler already.
parent f2ca2574
2003-03-12 Sven Neumann <sven@gimp.org>
* app/gui/image-menu.c: reordered the View menu, moved all
Zoom-related entries into a submenu. Use radio items for the zoom
ratio as suggested in bug #74385.
* app/gui/view-commands.c (view_zoom_cmd_callback): only call
gimp_display_shell_scale() if the item is active and the current
scale is different from the requested one.
* app/display/gimpdisplayshell.c (gimp_display_shell_real_scaled):
update the image menu so that the zoom ratio is displayed correctly.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_realize): don't call
gimp_display_shell_scale_setup(), since it is done in the configure
event handler already.
2003-03-12 Michael Natterer <mitch@gimp.org>
 
* app/core/core-enums.[ch]: added descriptions to the
......@@ -92,10 +92,22 @@ view_zoom_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpDisplay *gdisp;
GimpDisplayShell *shell;
guchar scalesrc;
guchar scaledest;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), action);
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
scalesrc = CLAMP (action % 100, 1, 0xFF);
scaledest = CLAMP (action / 100, 1, 0xFF);
if (scalesrc != SCALESRC (shell) || scaledest != SCALEDEST (shell))
gimp_display_shell_scale (shell, action);
}
void
......
......@@ -282,9 +282,6 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
G_CALLBACK (gimp_display_shell_vscrollbar_update),
shell);
/* setup scale properly */
gimp_display_shell_scale_setup (shell);
/* set the initial cursor */
gimp_display_shell_set_cursor (shell,
GDK_TOP_LEFT_ARROW,
......
......@@ -406,6 +406,10 @@ static void
gimp_display_shell_real_scaled (GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
/* update the <Image>/View/Zoom menu */
gimp_item_factory_update (shell->menubar_factory, shell);
gimp_item_factory_update (shell->popup_factory, shell);
}
GtkWidget *
......
......@@ -406,6 +406,10 @@ static void
gimp_display_shell_real_scaled (GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
/* update the <Image>/View/Zoom menu */
gimp_item_factory_update (shell->menubar_factory, shell);
gimp_item_factory_update (shell->popup_factory, shell);
}
GtkWidget *
......
......@@ -61,12 +61,14 @@
/* local function prototypes */
static void image_menu_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_background_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_background_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_set_zoom (GtkItemFactory *item_factory,
GimpDisplayShell *shell);
GimpItemFactoryEntry image_menu_entries[] =
......@@ -283,74 +285,74 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_BRANCH (N_("/_View")),
{ { N_("/View/Zoom In"), "equal",
{ { N_("/View/New View"), "",
view_new_view_cmd_callback, 0,
"<StockItem>", GTK_STOCK_NEW },
NULL,
"view/new_view.html", NULL },
/* <Image>/View/Zoom */
{ { N_("/View/Zoom/Zoom In"), "equal",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom Out"), "minus",
{ { N_("/View/Zoom/Zoom Out"), "minus",
view_zoom_out_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom to Fit Window"), "<control><shift>E",
{ { N_("/View/Zoom/Zoom to Fit Window"), "<control><shift>E",
view_zoom_fit_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_FIT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Shrink Wrap"), "<control>E",
view_shrink_wrap_cmd_callback, 0 },
NULL,
"view/shrink_wrap.html", NULL },
/* <Image>/View/Zoom */
MENU_SEPARATOR ("/View/Zoom/---"),
{ { N_("/View/Zoom/16:1"), NULL,
view_zoom_cmd_callback, 1601,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 1601, "<RadioItem>" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/8:1"), NULL,
view_zoom_cmd_callback, 801,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 801, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/4:1"), NULL,
view_zoom_cmd_callback, 401,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 401, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/2:1"), NULL,
view_zoom_cmd_callback, 201,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 201, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:1"), "1",
view_zoom_cmd_callback, 101,
"<StockItem>", GTK_STOCK_ZOOM_100 },
view_zoom_cmd_callback, 101, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:2"), NULL,
view_zoom_cmd_callback, 102,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 102, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:4"), NULL,
view_zoom_cmd_callback, 104,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 104, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:8"), NULL,
view_zoom_cmd_callback, 108,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 108, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:16"), NULL,
view_zoom_cmd_callback, 116,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 116, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { "/View/Zoom/Other", NULL,
NULL, 0, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Dot for Dot"), NULL,
view_dot_for_dot_cmd_callback, 0, "<ToggleItem>" },
NULL,
......@@ -411,19 +413,18 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/toggle_statusbar.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Shrink Wrap"), "<control>E",
view_shrink_wrap_cmd_callback, 0 },
NULL,
"view/shrink_wrap.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/New View"), "",
view_new_view_cmd_callback, 0,
"<StockItem>", GTK_STOCK_NEW },
NULL,
"view/new_view.html", NULL },
/* <Image>/Image */
MENU_BRANCH (N_("/_Image")),
......@@ -1257,19 +1258,25 @@ image_menu_update (GtkItemFactory *item_factory,
/* View */
SET_SENSITIVE ("/View/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
SET_SENSITIVE ("/View/Zoom/8:1", gdisp);
SET_SENSITIVE ("/View/Zoom/4:1", gdisp);
SET_SENSITIVE ("/View/Zoom/2:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:2", gdisp);
SET_SENSITIVE ("/View/Zoom/1:4", gdisp);
SET_SENSITIVE ("/View/Zoom/1:8", gdisp);
SET_SENSITIVE ("/View/Zoom/1:16", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
SET_SENSITIVE ("/View/Zoom/8:1", gdisp);
SET_SENSITIVE ("/View/Zoom/4:1", gdisp);
SET_SENSITIVE ("/View/Zoom/2:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:2", gdisp);
SET_SENSITIVE ("/View/Zoom/1:4", gdisp);
SET_SENSITIVE ("/View/Zoom/1:8", gdisp);
SET_SENSITIVE ("/View/Zoom/1:16", gdisp);
SET_SENSITIVE ("/View/Zoom/Other", gdisp);
if (gdisp)
image_menu_set_zoom (item_factory, shell);
SET_SENSITIVE ("/View/Dot for Dot", gdisp);
SET_ACTIVE ("/View/Dot for Dot", gdisp && shell->dot_for_dot);
......@@ -1279,12 +1286,14 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Display Filters...", gdisp);
SET_SENSITIVE ("/View/Show Selection", gdisp);
SET_ACTIVE ("/View/Show Selection", gdisp && ! shell->select->hidden);
SET_ACTIVE ("/View/Show Selection", (gdisp && shell->select &&
! shell->select->hidden));
SET_SENSITIVE ("/View/Show Layer Boundary", gdisp);
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && ! shell->select->layer_hidden);
SET_ACTIVE ("/View/Show Layer Boundary", (gdisp && shell->select &&
! shell->select->layer_hidden));
SET_SENSITIVE ("/View/Show Guides", gdisp);
SET_ACTIVE ("/View/Show Guides", gdisp && gdisp->draw_guides);
SET_SENSITIVE ("/View/Show Guides", gdisp);
SET_ACTIVE ("/View/Show Guides", gdisp && gdisp->draw_guides);
SET_SENSITIVE ("/View/Snap to Guides", gdisp);
SET_ACTIVE ("/View/Snap to Guides", gdisp && gdisp->snap_to_guides);
......@@ -1300,12 +1309,11 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Show Statusbar", gdisp);
SET_ACTIVE ("/View/Show Statusbar", gdisp && visibility->statusbar);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen", gdisp && fullscreen);
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
/* Image */
SET_SENSITIVE ("/Image/Mode/RGB", gdisp && ! is_rgb);
......@@ -1394,3 +1402,58 @@ image_menu_background_changed (GimpContext *context,
gimp_item_factory_set_color (GTK_ITEM_FACTORY (item_factory),
"/Edit/Fill with BG Color", color, FALSE);
}
static void
image_menu_set_zoom (GtkItemFactory *item_factory,
GimpDisplayShell *shell)
{
const gchar *menu = NULL;
guint scalesrc;
guint scaledest;
scalesrc = SCALESRC (shell);
scaledest = SCALEDEST (shell);
if (scaledest == 1)
{
switch (scalesrc)
{
case 1: menu = "/View/Zoom/1:1"; break;
case 2: menu = "/View/Zoom/1:2"; break;
case 4: menu = "/View/Zoom/1:4"; break;
case 8: menu = "/View/Zoom/1:8"; break;
case 16: menu = "/View/Zoom/1:16"; break;
}
}
else if (scalesrc == 1)
{
switch (scaledest)
{
case 2: menu = "/View/Zoom/2:1"; break;
case 4: menu = "/View/Zoom/4:1"; break;
case 8: menu = "/View/Zoom/8:1"; break;
case 16: menu = "/View/Zoom/16:1"; break;
}
}
if (menu)
{
gimp_item_factory_set_label (item_factory, "/View/Zoom/Other",_("Other"));
gimp_item_factory_set_sensitive (item_factory, "/View/Zoom/Other", FALSE);
}
else
{
gchar *label;
menu = "/View/Zoom/Other";
label = g_strdup_printf (_("Other (%d:%d)"), scaledest, scalesrc);
gimp_item_factory_set_label (item_factory, menu, label);
gimp_item_factory_set_sensitive (item_factory, menu, TRUE);
g_free (label);
}
gimp_item_factory_set_active (item_factory, menu, TRUE);
}
......@@ -92,10 +92,22 @@ view_zoom_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpDisplay *gdisp;
GimpDisplayShell *shell;
guchar scalesrc;
guchar scaledest;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), action);
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
scalesrc = CLAMP (action % 100, 1, 0xFF);
scaledest = CLAMP (action / 100, 1, 0xFF);
if (scalesrc != SCALESRC (shell) || scaledest != SCALEDEST (shell))
gimp_display_shell_scale (shell, action);
}
void
......
......@@ -61,12 +61,14 @@
/* local function prototypes */
static void image_menu_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_background_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_background_changed (GimpContext *context,
const GimpRGB *color,
GimpItemFactory *item_factory);
static void image_menu_set_zoom (GtkItemFactory *item_factory,
GimpDisplayShell *shell);
GimpItemFactoryEntry image_menu_entries[] =
......@@ -283,74 +285,74 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_BRANCH (N_("/_View")),
{ { N_("/View/Zoom In"), "equal",
{ { N_("/View/New View"), "",
view_new_view_cmd_callback, 0,
"<StockItem>", GTK_STOCK_NEW },
NULL,
"view/new_view.html", NULL },
/* <Image>/View/Zoom */
{ { N_("/View/Zoom/Zoom In"), "equal",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom Out"), "minus",
{ { N_("/View/Zoom/Zoom Out"), "minus",
view_zoom_out_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom to Fit Window"), "<control><shift>E",
{ { N_("/View/Zoom/Zoom to Fit Window"), "<control><shift>E",
view_zoom_fit_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_FIT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Shrink Wrap"), "<control>E",
view_shrink_wrap_cmd_callback, 0 },
NULL,
"view/shrink_wrap.html", NULL },
/* <Image>/View/Zoom */
MENU_SEPARATOR ("/View/Zoom/---"),
{ { N_("/View/Zoom/16:1"), NULL,
view_zoom_cmd_callback, 1601,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 1601, "<RadioItem>" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/8:1"), NULL,
view_zoom_cmd_callback, 801,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 801, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/4:1"), NULL,
view_zoom_cmd_callback, 401,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 401, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/2:1"), NULL,
view_zoom_cmd_callback, 201,
"<StockItem>", GTK_STOCK_ZOOM_IN },
view_zoom_cmd_callback, 201, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:1"), "1",
view_zoom_cmd_callback, 101,
"<StockItem>", GTK_STOCK_ZOOM_100 },
view_zoom_cmd_callback, 101, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:2"), NULL,
view_zoom_cmd_callback, 102,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 102, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:4"), NULL,
view_zoom_cmd_callback, 104,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 104, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:8"), NULL,
view_zoom_cmd_callback, 108,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 108, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/1:16"), NULL,
view_zoom_cmd_callback, 116,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
view_zoom_cmd_callback, 116, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { "/View/Zoom/Other", NULL,
NULL, 0, "/View/Zoom/16:1" },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Dot for Dot"), NULL,
view_dot_for_dot_cmd_callback, 0, "<ToggleItem>" },
NULL,
......@@ -411,19 +413,18 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/toggle_statusbar.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Shrink Wrap"), "<control>E",
view_shrink_wrap_cmd_callback, 0 },
NULL,
"view/shrink_wrap.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/New View"), "",
view_new_view_cmd_callback, 0,
"<StockItem>", GTK_STOCK_NEW },
NULL,
"view/new_view.html", NULL },
/* <Image>/Image */
MENU_BRANCH (N_("/_Image")),
......@@ -1257,19 +1258,25 @@ image_menu_update (GtkItemFactory *item_factory,
/* View */
SET_SENSITIVE ("/View/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
SET_SENSITIVE ("/View/Zoom/8:1", gdisp);
SET_SENSITIVE ("/View/Zoom/4:1", gdisp);
SET_SENSITIVE ("/View/Zoom/2:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:2", gdisp);
SET_SENSITIVE ("/View/Zoom/1:4", gdisp);
SET_SENSITIVE ("/View/Zoom/1:8", gdisp);
SET_SENSITIVE ("/View/Zoom/1:16", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
SET_SENSITIVE ("/View/Zoom/8:1", gdisp);
SET_SENSITIVE ("/View/Zoom/4:1", gdisp);
SET_SENSITIVE ("/View/Zoom/2:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:1", gdisp);
SET_SENSITIVE ("/View/Zoom/1:2", gdisp);
SET_SENSITIVE ("/View/Zoom/1:4", gdisp);
SET_SENSITIVE ("/View/Zoom/1:8", gdisp);
SET_SENSITIVE ("/View/Zoom/1:16", gdisp);
SET_SENSITIVE ("/View/Zoom/Other", gdisp);
if (gdisp)
image_menu_set_zoom (item_factory, shell);
SET_SENSITIVE ("/View/Dot for Dot", gdisp);
SET_ACTIVE ("/View/Dot for Dot", gdisp && shell->dot_for_dot);
......@@ -1279,12 +1286,14 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Display Filters...", gdisp);
SET_SENSITIVE ("/View/Show Selection", gdisp);
SET_ACTIVE ("/View/Show Selection", gdisp && ! shell->select->hidden);
SET_ACTIVE ("/View/Show Selection", (gdisp && shell->select &&
! shell->select->hidden));
SET_SENSITIVE ("/View/Show Layer Boundary", gdisp);
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && ! shell->select->layer_hidden);
SET_ACTIVE ("/View/Show Layer Boundary", (gdisp && shell->select &&
! shell->select->layer_hidden));
SET_SENSITIVE ("/View/Show Guides", gdisp);
SET_ACTIVE ("/View/Show Guides", gdisp && gdisp->draw_guides);
SET_SENSITIVE ("/View/Show Guides", gdisp);
SET_ACTIVE ("/View/Show Guides", gdisp && gdisp->draw_guides);
SET_SENSITIVE ("/View/Snap to Guides", gdisp);
SET_ACTIVE ("/View/Snap to Guides", gdisp && gdisp->snap_to_guides);
......@@ -1300,12 +1309,11 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Show Statusbar", gdisp);
SET_ACTIVE ("/View/Show Statusbar", gdisp && visibility->statusbar);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen", gdisp && fullscreen);
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
/* Image */
SET_SENSITIVE ("/Image/Mode/RGB", gdisp && ! is_rgb);
......@@ -1394,3 +1402,58 @@ image_menu_background_changed (GimpContext *context,
gimp_item_factory_set_color (GTK_ITEM_FACTORY (item_factory),
"/Edit/Fill with BG Color", color, FALSE);
}
static void
image_menu_set_zoom (GtkItemFactory *item_factory,
GimpDisplayShell *shell)