[eog] Put "Exit Fullscreen" button into toolbar
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Put "Exit Fullscreen" button into toolbar
- Date: Wed, 21 Oct 2015 19:07:18 +0000 (UTC)
commit 2c5e528a948afd811f3a15936ae746032c1ea892
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Tue Sep 29 18:25:08 2015 +0200
Put "Exit Fullscreen" button into toolbar
So that the button has the same background as the toolbar itself.
https://bugzilla.gnome.org/show_bug.cgi?id=755799
data/fullscreen-toolbar.ui | 18 +++++++++++++++++-
src/eog-window.c | 31 +++++--------------------------
2 files changed, 22 insertions(+), 27 deletions(-)
---
diff --git a/data/fullscreen-toolbar.ui b/data/fullscreen-toolbar.ui
index cf31252..b16c00d 100644
--- a/data/fullscreen-toolbar.ui
+++ b/data/fullscreen-toolbar.ui
@@ -5,7 +5,7 @@
<object class="GtkToolbar" id="fullscreen_toolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="toolbar_style">icons</property>
+ <property name="toolbar_style">both-horiz</property>
<child>
<object class="GtkToolButton" id="first_button">
<property name="visible">True</property>
@@ -226,5 +226,21 @@
<property name="homogeneous">True</property>
</packing>
</child>
+ <child>
+ <object class="GtkToolButton" id="exit_fullscreen_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Leave Fullscreen</property>
+ <property name="use_underline">True</property>
+ <property name="tooltip_text" translatable="yes">Leave fullscreen mode</property>
+ <property name="icon_name">view-restore</property>
+ <property name="halign">end</property>
+ <property name="is_important">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
</object>
</interface>
diff --git a/src/eog-window.c b/src/eog-window.c
index 0f222c1..09de1b7 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1894,28 +1894,6 @@ exit_fullscreen_button_clicked_cb (GtkWidget *button, EogWindow *window)
}
static GtkWidget *
-eog_window_get_exit_fullscreen_button (EogWindow *window)
-{
- GtkWidget *button;
- GtkWidget *image;
-
- button = gtk_button_new_with_mnemonic (_("_Leave Fullscreen"));
- image = gtk_image_new_from_icon_name ("view-restore-symbolic",
- GTK_ICON_SIZE_BUTTON);
- gtk_button_set_image (GTK_BUTTON (button), image);
- gtk_button_set_always_show_image (GTK_BUTTON (button), TRUE);
- gtk_widget_set_tooltip_text(button,
- _("Leave fullscreen mode"));
-
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (exit_fullscreen_button_clicked_cb),
- window);
-
- return button;
-}
-
-static GtkWidget *
eog_window_create_fullscreen_popup (EogWindow *window)
{
GtkWidget *revealer;
@@ -1940,10 +1918,10 @@ eog_window_create_fullscreen_popup (EogWindow *window)
gtk_box_pack_start (GTK_BOX (hbox), toolbar, TRUE, TRUE, 0);
- g_object_unref (builder);
-
- button = eog_window_get_exit_fullscreen_button (window);
- gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+ button = GTK_WIDGET (gtk_builder_get_object (builder, "exit_fullscreen_button"));
+ g_signal_connect (button, "clicked",
+ G_CALLBACK (exit_fullscreen_button_clicked_cb),
+ window);
/* Disable timer when the pointer enters the toolbar window. */
g_signal_connect (revealer,
@@ -1951,6 +1929,7 @@ eog_window_create_fullscreen_popup (EogWindow *window)
G_CALLBACK (fullscreen_leave_notify_cb),
window);
+ g_object_unref (builder);
return revealer;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]