[eog/wip/gaction-migration] Convert fullscreen toolbar to GAction/GtkBuilder
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/wip/gaction-migration] Convert fullscreen toolbar to GAction/GtkBuilder
- Date: Thu, 18 Dec 2014 17:12:43 +0000 (UTC)
commit 3a0d54caf6c70bb46271d36b0ecabc9c8d8033e7
Author: Felix Riemann <friemann gnome org>
Date: Thu Dec 18 18:12:00 2014 +0100
Convert fullscreen toolbar to GAction/GtkBuilder
data/fullscreen-toolbar.ui | 218 ++++++++++++++++++++++++++++++++++++++++++++
src/eog-window.c | 15 ++-
src/eog.gresource.xml | 1 +
3 files changed, 228 insertions(+), 6 deletions(-)
---
diff --git a/data/fullscreen-toolbar.ui b/data/fullscreen-toolbar.ui
new file mode 100644
index 0000000..85b92bf
--- /dev/null
+++ b/data/fullscreen-toolbar.ui
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.1 -->
+<interface>
+ <requires lib="gtk+" version="3.14"/>
+ <object class="GtkToolbar" id="fullscreen_toolbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="toolbar_style">icons</property>
+ <child>
+ <object class="GtkToolButton" id="first_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.GoFirst</property>
+ <property name="label" translatable="yes">_First Image</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">go-first</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="prev_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.GoPrevious</property>
+ <property name="label" translatable="yes">_Previous Image</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">go-previous</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="next_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.GoNext</property>
+ <property name="label" translatable="yes">_Next Image</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">go-next</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="last_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.GoLast</property>
+ <property name="label" translatable="yes">_Last Image</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">go-last</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparatorToolItem" id="separator1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="zoom_in_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.ViewZoomIn</property>
+ <property name="label" translatable="yes">_Zoom In</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">zoom-in</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="zoom_out_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.ViewZoomOut</property>
+ <property name="label" translatable="yes">Zoom _Out</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">zoom-out</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="zoom_normal_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.ViewZoomNormal</property>
+ <property name="label" translatable="yes">_Normal Size</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">zoom-original</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleToolButton" id="zoom_fit_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.ViewZoomFit</property>
+ <property name="label" translatable="yes">_Best Fit</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">zoom-fit-best</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparatorToolItem" id="separator2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="rotate_left_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.EditRotate270</property>
+ <property name="label" translatable="yes">Rotate Counter_clockwise</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">object-rotate-left</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="rotate_right_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.EditRotate90</property>
+ <property name="label" translatable="yes">_Rotate Clockwise</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">object-rotate-right</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparatorToolItem" id="separator3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleToolButton" id="gallery_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.ViewImageGallery</property>
+ <property name="label" translatable="yes">_Image Gallery</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">eog-image-gallery</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparatorToolItem" id="separator4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleToolButton" id="pause_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">win.PauseSlideshow</property>
+ <property name="label" translatable="yes">_Best Fit</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">media-playback-pause</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/src/eog-window.c b/src/eog-window.c
index df4dee9..9b01bdd 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1861,7 +1861,7 @@ exit_fullscreen_button_clicked_cb (GtkWidget *button, EogWindow *window)
}
g_return_if_fail (action != NULL);
- g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (FALSE));
+ g_action_change_state (action, g_variant_new_boolean (FALSE));
}
static GtkWidget *
@@ -1890,6 +1890,7 @@ eog_window_create_fullscreen_popup (EogWindow *window)
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *toolbar;
+ GtkBuilder *builder;
eog_debug (DEBUG_WINDOW);
@@ -1901,14 +1902,16 @@ eog_window_create_fullscreen_popup (EogWindow *window)
gtk_widget_set_halign (revealer, GTK_ALIGN_FILL);
gtk_container_add (GTK_CONTAINER (revealer), hbox);
- toolbar = gtk_ui_manager_get_widget (window->priv->ui_mgr,
- "/FullscreenToolbar");
- g_assert (GTK_IS_WIDGET (toolbar));
- gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
+ builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/fullscreen-toolbar.ui");
+ toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_toolbar"));
+ g_assert (GTK_IS_TOOLBAR (toolbar));
+
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_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
/* Disable timer when the pointer enters the toolbar window. */
g_signal_connect (revealer,
diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml
index bee47b3..5388ce2 100644
--- a/src/eog.gresource.xml
+++ b/src/eog.gresource.xml
@@ -8,6 +8,7 @@
<file compressed="true" preprocess="xml-stripblanks">eog-preferences-dialog.ui</file>
<file compressed="true" preprocess="xml-stripblanks">eog-view-popup.ui</file>
<file compressed="true" preprocess="xml-stripblanks">eog-ui.xml</file>
+ <file compressed="true" preprocess="xml-stripblanks">fullscreen-toolbar.ui</file>
</gresource>
</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]