aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/ppview-toolbar.c24
2 files changed, 32 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f07ce364..0d37f95a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-10 Cosimo Cecchi <cosimoc@svn.gnome.org>
+
+ * src/ppview-toolbar.c: (ppview_toolbar_set_window):
+
+ Forces the display of "Close print preview" on the relative toolbar
+ button in the print preview window. See bug #109063. Patch by
+ Cyril Brulebois.
+
2007-09-09 Christian Persch <chpe@gnome.org>
* configure.ac:
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index 59842eca1..b13acaa4c 100644
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -28,6 +28,7 @@
#include <gtk/gtkentry.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkstock.h>
+#include <gtk/gtktoolbar.h>
#include <gtk/gtkuimanager.h>
static void ppview_toolbar_class_init (PPViewToolbarClass *klass);
@@ -224,6 +225,10 @@ toolbar_update_sensitivity (PPViewToolbar *t)
static void
ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window)
{
+ GtkAction *action;
+ GtkWidget *widget;
+ GtkToolbarStyle style;
+
g_return_if_fail (t->priv->window == NULL);
t->priv->window = window;
@@ -238,6 +243,25 @@ ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window)
t->priv->ui_id = gtk_ui_manager_add_ui_from_string
(t->priv->manager, ui_info, -1, NULL);
+ action = gtk_action_group_get_action (t->priv->action_group,
+ "PPVClose");
+ g_object_set (action,
+ "short-label",
+ _("Close print preview"),
+ "is-important",
+ TRUE,
+ NULL);
+
+ /* Force the display of the text only when needed */
+ widget = gtk_ui_manager_get_widget (t->priv->manager,
+ "/PPViewToolbar");
+ style = gtk_toolbar_get_style (GTK_TOOLBAR (widget));
+ if (style == GTK_TOOLBAR_ICONS)
+ {
+ gtk_toolbar_set_style (GTK_TOOLBAR (widget),
+ GTK_TOOLBAR_BOTH_HORIZ);
+ }
+
toolbar_update_sensitivity (t);
}