[evolution/express2: 3/5] add a close-window action that doesn't become insensitive on the last window. Use this in meego / fu



commit 9b90e087b0c216cbc802663f4c8dc06068f235bb
Author: Michael Meeks <michael meeks novell com>
Date:   Wed Apr 14 20:56:30 2010 +0100

    add a close-window action that doesn't become insensitive on the last window.
    Use this in meego / full-screen mode

 shell/e-shell-view.c           |   14 ++++++++++++++
 shell/e-shell-window-actions.c |    7 +++++++
 shell/e-shell-window.c         |   17 -----------------
 3 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 6cae11c..77215e7 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -659,6 +659,20 @@ shell_view_construct_searchbar (EShellView *shell_view)
 
 	gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1);
 
+	if (e_shell_get_small_screen_mode (shell)) {
+		GtkWidget *image;
+		GtkAction *action;
+		GtkToolItem *item;
+
+		action = e_shell_window_get_action (shell_window, "close-window");
+		image = gtk_image_new_from_icon_name ("window-close-hover",
+						      GTK_ICON_SIZE_DIALOG);
+		item = gtk_tool_button_new (image, gtk_action_get_label (action));
+		gtk_widget_set_name (GTK_WIDGET (item), "MeeGoCloseButton");
+		gtk_activatable_set_related_action (GTK_ACTIVATABLE (item), action);
+		gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1);
+	}
+
 	return widget;
 }
 
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index 9b14730..288c463 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -1446,6 +1446,13 @@ static GtkActionEntry shell_entries[] = {
 	  N_("Close this window"),
 	  G_CALLBACK (action_close_cb) },
 
+	{ "close-window",
+	  GTK_STOCK_CLOSE,
+	  N_("_Close Window"),
+	  "<Control>w",
+	  N_("Close this window"),
+	  G_CALLBACK (action_close_cb) },
+
 	{ "contents",
 	  GTK_STOCK_HELP,
 	  N_("_Contents"),
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index c135a76..62c39fe 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -409,23 +409,6 @@ shell_window_construct_toolbar (EShellWindow *shell_window)
 	gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
 	gtk_box_pack_start (GTK_BOX (box), toolbar, FALSE, FALSE, 0);
 
-	if (e_shell_get_meego_mode (shell_window->priv->shell) &&
-	    e_shell_get_small_screen_mode (shell_window->priv->shell)) {
-		GtkWidget *close_button, *image;
-
-		close_button = gtk_button_new ();
-		gtk_widget_set_name (close_button, "MeeGoCloseButton");
-		image = gtk_image_new_from_icon_name ("window-close-hover",
-						      GTK_ICON_SIZE_DIALOG);
-		gtk_container_add (GTK_CONTAINER (close_button), image);
-		gtk_activatable_set_related_action
-			(GTK_ACTIVATABLE (close_button),
-			 gtk_action_group_get_action (ACTION_GROUP (SHELL),
-						      "close"));
-		gtk_widget_show_all (close_button);
-		gtk_box_pack_end (GTK_BOX (box), close_button, FALSE, FALSE, 0);
-	}
-
 	return box;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]