Commits

Palmer, 2E0EOL committed 10a3d7e

Patch Eye Of Gnome so we can hide the main menu

Comments (0)

Files changed (1)

-diff -urN graphics/eog.dist/files/patch-src-eog-window.c graphics/eog/files/patch-src-eog-window.c
---- graphics/eog.dist/files/patch-src-eog-window.c	1970-01-01 01:00:00.000000000 +0100
-+++ graphics/eog/files/patch-src-eog-window.c	2012-04-07 23:37:47.000000000 +0100
-@@ -0,0 +1,15 @@
-+diff -ur eog-2.32.1.orig/src/eog-window.c eog-2.32.1/src/eog-window.c
+diff -urN graphics/eog/files/patch-data-eog-ui.xml graphics/eog/files/patch-data-eog-ui.xml
+--- graphics/eog/files/patch-data-eog-ui.xml	1970-01-01 01:00:00.000000000 +0100
++++ graphics/eog/files/patch-data-eog-ui.xml	2012-04-09 11:17:51.000000000 +0100
+@@ -0,0 +1,19 @@
++diff -ur eog/work/eog-2.32.1/data/eog-ui.xml eog/work/eog-2.32.1/data/eog-ui.xml
++--- data/eog-ui.xml	2010-11-13 13:16:52.000000000 +0000
+++++ data/eog-ui.xml	2012-04-09 11:02:07.000000000 +0100
++@@ -34,6 +34,7 @@
++       <menuitem action="EditPreferences"/>
++     </menu>
++     <menu action="View">
+++      <menuitem name="MainMenuToggle" action="ViewMainMenu"/>
++       <menuitem name="ToolbarToggle" action="ViewToolbar"/>
++       <menuitem name="StatusbarToggle" action="ViewStatusbar"/>
++       <menuitem name="ImageCollectionToggle" action="ViewImageCollection"/>
++@@ -133,6 +134,7 @@
++     <separator/>
++     <menuitem action="ImageProperties"/>
++     <menuitem action="ImageSetAsWallpaper"/>
+++    <menuitem action="ViewMainMenu"/>
++   </popup>
++ 
++   <accelerator name="ControlEqualAccel" action="ControlEqual"/>
+diff -urN graphics/eog/files/patch-src-eog-config-keys.h graphics/eog/files/patch-src-eog-config-keys.h
+--- graphics/eog/files/patch-src-eog-config-keys.h	1970-01-01 01:00:00.000000000 +0100
++++ graphics/eog/files/patch-src-eog-config-keys.h	2012-04-09 11:24:06.000000000 +0100
+@@ -0,0 +1,10 @@
++--- src/eog-config-keys.h	2010-11-13 13:16:52.000000000 +0000
+++++ src/eog-config-keys.h	2012-04-09 11:22:55.000000000 +0100
++@@ -47,6 +47,7 @@
++ #define EOG_CONF_FULLSCREEN_UPSCALE		"/apps/eog/full_screen/upscale"
++ #define EOG_CONF_FULLSCREEN_SECONDS		"/apps/eog/full_screen/seconds"
++ 
+++#define EOG_CONF_UI_MAINMENU			"/apps/eog/ui/menubar"
++ #define EOG_CONF_UI_TOOLBAR			"/apps/eog/ui/toolbar"
++ #define EOG_CONF_UI_STATUSBAR			"/apps/eog/ui/statusbar"
++ #define EOG_CONF_UI_IMAGE_COLLECTION		"/apps/eog/ui/image_collection"
+diff -urN graphics/eog/files/patch-src-eog-window.c graphics/eog/files/patch-src-eog-window.c
+--- graphics/eog/files/patch-src-eog-window.c	1970-01-01 01:00:00.000000000 +0100
++++ graphics/eog/files/patch-src-eog-window.c	2012-04-09 11:16:33.000000000 +0100
+@@ -0,0 +1,71 @@
++diff -ur eog-2.32.1/src/eog-window.c eog-2.32.1/src/eog-window.c
 +--- src/eog-window.c	2010-11-13 13:16:52.000000000 +0000
 ++++ src/eog-window.c	2012-04-07 23:34:40.000000000 +0100
 +@@ -81,8 +81,8 @@
 + 
 + #define EOG_WINDOW_DEFAULT_WIDTH  540
 + #define EOG_WINDOW_DEFAULT_HEIGHT 450
-+Only in eog-2.32.1/src: eog-window.c.orig
++@@ -2242,6 +2242,18 @@
++ 	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
++ 	g_assert (GTK_IS_WIDGET (menubar));
++ 
+++	visible = gconf_client_get_bool (priv->client, EOG_CONF_UI_MAINMENU, &error);
+++	visible = visible && !fullscreen_mode;
+++	if (error) {
+++		g_error_free (error);
+++		error = NULL;
+++		visible = !fullscreen_mode;
+++	}
+++	action = gtk_ui_manager_get_action (priv->ui_mgr, "/MainMenu/View/MainMenuToggle");
+++	g_assert (action != NULL);
+++	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+++	g_object_set (G_OBJECT (menubar), "visible", visible, NULL);
+++
++ 	visible = gconf_client_get_bool (priv->client, EOG_CONF_UI_TOOLBAR, &error);
++ 	visible = visible && !fullscreen_mode;
++ 	if (error) {
++@@ -2883,6 +2895,7 @@
++ 	EogWindow *window;
++ 	EogWindowPrivate *priv;
++ 	gboolean visible;
+++	GtkWidget *menubar;
++ 
++ 	g_return_if_fail (EOG_IS_WINDOW (user_data));
++ 
++@@ -2892,9 +2905,18 @@
++ 	if (priv->mode != EOG_WINDOW_MODE_NORMAL &&
++             priv->mode != EOG_WINDOW_MODE_FULLSCREEN) return;
++ 
+++	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
+++	g_assert (GTK_IS_WIDGET (menubar));
+++
++ 	visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
++ 
++-	if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewToolbar") == 0) {
+++	if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewMainMenu") == 0) {
+++		g_object_set (G_OBJECT (menubar), "visible", visible, NULL);
+++
+++		if (priv->mode == EOG_WINDOW_MODE_NORMAL)
+++			gconf_client_set_bool (priv->client, EOG_CONF_UI_MAINMENU, visible, NULL);
+++
+++	} else if (g_ascii_strcasecmp (gtk_action_get_name (action), "ViewToolbar") == 0) {
++ 		g_object_set (G_OBJECT (priv->toolbar), "visible", visible, NULL);
++ 
++ 		if (priv->mode == EOG_WINDOW_MODE_NORMAL)
++@@ -3924,6 +3946,9 @@
++ };
++ 
++ static const GtkToggleActionEntry toggle_entries_window[] = {
+++	{ "ViewMainMenu", NULL, N_("_MainMenu"), NULL,
+++	  N_("Change visibility of the main menu"),
+++	  G_CALLBACK (eog_window_cmd_show_hide_bar), TRUE },
++ 	{ "ViewToolbar", NULL, N_("_Toolbar"), NULL,
++ 	  N_("Changes the visibility of the toolbar in the current window"),
++ 	  G_CALLBACK (eog_window_cmd_show_hide_bar), TRUE },