[gthumb] image viewer: load the zoom menu from memory



commit 990e40c8568f3fed8a9f7e894ba11fada49b1971
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 3 11:19:23 2016 +0100

    image viewer: load the zoom menu from memory

 extensions/image_viewer/Makefile.am             |    9 +++++++--
 extensions/image_viewer/gth-image-viewer-page.c |    2 +-
 extensions/image_viewer/resources.xml           |    6 ++++++
 3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/extensions/image_viewer/Makefile.am b/extensions/image_viewer/Makefile.am
index 239988d..6530c99 100644
--- a/extensions/image_viewer/Makefile.am
+++ b/extensions/image_viewer/Makefile.am
@@ -19,7 +19,9 @@ libimage_viewer_la_SOURCES =          \
        image-viewer.h                  \
        main.c                          \
        preferences.c                   \
-       preferences.h
+       preferences.h                   \
+       resources.c                     \
+       resources.h
 
 libimage_viewer_la_CFLAGS = $(GTHUMB_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb 
 libimage_viewer_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
@@ -36,8 +38,11 @@ extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 @GTHUMB_EXTENSION_IN_RULE@
 @GTHUMB_EXTENSION_RULE@
 
-EXTRA_DIST = $(extensionini_in_files) 
+EXTRA_DIST =                           \
+       $(extensionini_in_files)        \
+       resources.xml
 
 DISTCLEANFILES = $(extensionini_DATA)
 
 -include $(top_srcdir)/git.mk
+-include $(top_srcdir)/extension-resources.mk
\ No newline at end of file
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index a88769d..287202b 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -935,7 +935,7 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
                                                           "win.image-zoom-fit-if-larger",
                                                           NULL);
 
-       self->priv->builder = _gtk_builder_new_from_file ("toolbar-zoom-menu.ui", "image_viewer");
+       self->priv->builder = gtk_builder_new_from_resource 
("/org/gnome/gThumb/image_viewer/data/ui/toolbar-zoom-menu.ui");
        self->priv->buttons[ZOOM_BUTTON] =
                        gth_browser_add_header_bar_menu_button (browser,
                                                                GTH_BROWSER_HEADER_SECTION_VIEWER_VIEW,
diff --git a/extensions/image_viewer/resources.xml b/extensions/image_viewer/resources.xml
new file mode 100644
index 0000000..de1f5df
--- /dev/null
+++ b/extensions/image_viewer/resources.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/gThumb/image_viewer">
+    <file compressed="true">data/ui/toolbar-zoom-menu.ui</file>
+  </gresource>
+</gresources>


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