[gedit] Use a glade template for the print preview



commit e3ae7360106cd8fa6036cf265c5fd071866d1dc0
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Apr 26 23:45:39 2013 +0200

    Use a glade template for the print preview

 gedit/Makefile.am            |    1 +
 gedit/gedit-print-preview.c  |  291 +++++++++++------------------------------
 gedit/gedit-print-preview.h  |    4 +-
 gedit/gedit-print-preview.ui |  296 ++++++++++++++++++++++++++++++++++++++++++
 gedit/gedit.gresource.xml    |    1 +
 5 files changed, 375 insertions(+), 218 deletions(-)
---
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index 8574483..0b06442 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -262,6 +262,7 @@ EXTRA_DIST =                                \
        gedit-encodings-dialog.ui       \
        gedit-preferences-dialog.ui     \
        gedit-replace-dialog.ui         \
+       gedit-print-preview.ui          \
        gedit-print-preferences.ui
 
 CLEANFILES = $(BUILT_SOURCES) $(BUILT_SOURCES_PRIVATE)
diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c
index 648fee5..9b0596d 100644
--- a/gedit/gedit-print-preview.c
+++ b/gedit/gedit-print-preview.c
@@ -49,9 +49,6 @@ struct _GeditPrintPreviewPrivate
        GtkPrintContext *context;
        GtkPrintOperationPreview *gtk_preview;
 
-       GtkWidget *layout;
-       GtkWidget *scrolled_window;
-
        GtkToolItem *next;
        GtkToolItem *prev;
        GtkWidget   *page_entry;
@@ -61,6 +58,9 @@ struct _GeditPrintPreviewPrivate
        GtkToolItem *zoom_fit;
        GtkToolItem *zoom_in;
        GtkToolItem *zoom_out;
+       GtkToolItem *close;
+
+       GtkWidget *layout;
 
        /* real size of the page in inches */
        double paper_w;
@@ -82,7 +82,7 @@ struct _GeditPrintPreviewPrivate
        guint cur_page;
 };
 
-G_DEFINE_TYPE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_GRID)
 
 static void
 gedit_print_preview_get_property (GObject    *object,
@@ -149,6 +149,21 @@ gedit_print_preview_class_init (GeditPrintPreviewClass *klass)
 
        widget_class->grab_focus = gedit_print_preview_grab_focus;
 
+       /* Bind class to template */
+       gtk_widget_class_set_template_from_resource (widget_class,
+                                                    "/org/gnome/gedit/ui/gedit-print-preview.ui");
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, prev);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, next);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, multi);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, page_entry);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, last);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, zoom_one);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, zoom_fit);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, zoom_in);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, zoom_out);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, close);
+       gtk_widget_class_bind_child (widget_class, GeditPrintPreviewPrivate, layout);
+
        g_type_class_add_private (object_class, sizeof (GeditPrintPreviewPrivate));
 }
 
@@ -536,168 +551,6 @@ close_button_clicked (GtkWidget         *button,
        gtk_widget_destroy (GTK_WIDGET (preview));
 }
 
-static void
-create_bar (GeditPrintPreview *preview)
-{
-       GeditPrintPreviewPrivate *priv;
-       GtkWidget *toolbar;
-       GtkToolItem *i;
-       AtkObject *atko;
-       GtkWidget *status;
-
-       priv = preview->priv;
-
-       toolbar = gtk_toolbar_new ();
-       gtk_toolbar_set_style (GTK_TOOLBAR (toolbar),
-                              GTK_TOOLBAR_BOTH_HORIZ);
-       gtk_widget_show (toolbar);
-       gtk_box_pack_start (GTK_BOX (preview),
-                           toolbar,
-                           FALSE, FALSE, 0);
-
-       priv->prev = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
-       gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->prev),
-                                  "P_revious Page");
-       gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->prev), TRUE);
-       gtk_tool_item_set_tooltip_text (priv->prev, _("Show the previous page"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->prev, -1);
-       g_signal_connect (priv->prev,
-                         "clicked",
-                         G_CALLBACK (prev_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->prev));
-
-       priv->next = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
-       gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->next),
-                                  "_Next Page");
-       gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->next), TRUE);
-       gtk_tool_item_set_tooltip_text (priv->next, _("Show the next page"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->next, -1);
-       g_signal_connect (priv->next,
-                         "clicked",
-                         G_CALLBACK (next_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->next));
-
-       i = gtk_separator_tool_item_new ();
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-
-       status = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
-       priv->page_entry = gtk_entry_new ();
-       gtk_entry_set_width_chars (GTK_ENTRY (priv->page_entry), 3);
-       gtk_entry_set_max_length (GTK_ENTRY (priv->page_entry), 6);
-       gtk_widget_set_tooltip_text (priv->page_entry, _("Current page (Alt+P)"));
-
-       g_signal_connect (priv->page_entry,
-                         "activate",
-                         G_CALLBACK (page_entry_activated),
-                         preview);
-       g_signal_connect (priv->page_entry,
-                         "insert-text",
-                         G_CALLBACK (page_entry_insert_text),
-                         NULL);
-       g_signal_connect (priv->page_entry,
-                         "focus-out-event",
-                         G_CALLBACK (page_entry_focus_out),
-                         preview);
-
-       gtk_box_pack_start (GTK_BOX (status),
-                           priv->page_entry,
-                           FALSE, FALSE, 0);
-       /* gtk_label_set_mnemonic_widget ((GtkLabel *) l, mp->priv->page_entry); */
-
-       /* We are displaying 'XXX of XXX'. */
-       gtk_box_pack_start (GTK_BOX (status),
-                           /* Translators: the "of" from "1 of 19" in print preview. */
-                           gtk_label_new (_("of")),
-                           FALSE, FALSE, 0);
-
-       priv->last = gtk_label_new ("");
-       gtk_box_pack_start (GTK_BOX (status),
-                           priv->last,
-                           FALSE, FALSE, 0);
-       atko = gtk_widget_get_accessible (priv->last);
-       atk_object_set_name (atko, _("Page total"));
-       atk_object_set_description (atko, _("The total number of pages in the document"));
-
-       gtk_widget_show_all (status);
-
-       i = gtk_tool_item_new ();
-       gtk_container_add (GTK_CONTAINER (i), status);
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-
-       i = gtk_separator_tool_item_new ();
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-
-       priv->multi = gtk_tool_button_new_from_stock (GTK_STOCK_DND_MULTIPLE);
-       gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->multi),
-                                  "_Show Multiple Pages");
-       gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->multi), TRUE);
-       gtk_tool_item_set_tooltip_text (priv->multi, _("Show multiple pages"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->multi, -1);
-       g_signal_connect (priv->multi,
-                         "clicked",
-                         G_CALLBACK (multi_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->multi));
-
-       i = gtk_separator_tool_item_new ();
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-
-       priv->zoom_one = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_100);
-       gtk_tool_item_set_tooltip_text (priv->zoom_one, _("Zoom 1:1"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_one, -1);
-       g_signal_connect (priv->zoom_one,
-                         "clicked",
-                         G_CALLBACK (zoom_one_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->zoom_one));
-
-       priv->zoom_fit = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_FIT);
-       gtk_tool_item_set_tooltip_text (priv->zoom_fit, _("Zoom to fit the whole page"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_fit, -1);
-       g_signal_connect (priv->zoom_fit,
-                         "clicked",
-                         G_CALLBACK (zoom_fit_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->zoom_fit));
-
-       priv->zoom_in = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_IN);
-       gtk_tool_item_set_tooltip_text (priv->zoom_in, _("Zoom the page in"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_in, -1);
-       g_signal_connect (priv->zoom_in,
-                         "clicked",
-                         G_CALLBACK (zoom_in_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->zoom_in));
-
-       priv->zoom_out = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_OUT);
-       gtk_tool_item_set_tooltip_text (priv->zoom_out, _("Zoom the page out"));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_out, -1);
-       g_signal_connect (priv->zoom_out,
-                         "clicked",
-                         G_CALLBACK (zoom_out_button_clicked),
-                         preview);
-       gtk_widget_show (GTK_WIDGET (priv->zoom_out));
-
-       i = gtk_separator_tool_item_new ();
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-
-       i = gtk_tool_button_new (NULL, _("_Close Preview"));
-       gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (i), TRUE);
-       gtk_tool_item_set_is_important (i, TRUE);
-       gtk_tool_item_set_tooltip_text (i, _("Close print preview"));
-       g_signal_connect (i, "clicked",
-                         G_CALLBACK (close_button_clicked), preview);
-       gtk_widget_show (GTK_WIDGET (i));
-       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1);
-}
-
 static gint
 get_first_page_displayed (GeditPrintPreview *preview)
 {
@@ -933,30 +786,65 @@ preview_layout_key_press (GtkWidget         *widget,
 }
 
 static void
-create_preview_layout (GeditPrintPreview *preview)
+gedit_print_preview_init (GeditPrintPreview *preview)
 {
        GeditPrintPreviewPrivate *priv;
-       AtkObject *atko;
-
-       priv = preview->priv;
 
-       priv->layout = gtk_layout_new (NULL, NULL);
-       /* gtk_widget_set_double_buffered (priv->layout, FALSE); */
+       priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
+                                           GEDIT_TYPE_PRINT_PREVIEW,
+                                           GeditPrintPreviewPrivate);
 
-       atko = gtk_widget_get_accessible (GTK_WIDGET (priv->layout));
-       atk_object_set_name (atko, _("Page Preview"));
-       atk_object_set_description (atko, _("The preview of a page in the document to be printed"));
+       preview->priv = priv;
 
-       gtk_widget_add_events (priv->layout,
-                              GDK_POINTER_MOTION_MASK |
-                              GDK_BUTTON_PRESS_MASK |
-                              GDK_KEY_PRESS_MASK);
+       priv->operation = NULL;
+       priv->context = NULL;
+       priv->gtk_preview = NULL;
 
-       gtk_widget_set_can_focus (priv->layout, TRUE);
+       gtk_widget_init_template (GTK_WIDGET (preview));
 
-       g_signal_connect (priv->layout,
-                         "key-press-event",
-                         G_CALLBACK (preview_layout_key_press),
+       g_signal_connect (priv->prev,
+                         "clicked",
+                         G_CALLBACK (prev_button_clicked),
+                         preview);
+       g_signal_connect (priv->next,
+                         "clicked",
+                         G_CALLBACK (next_button_clicked),
+                         preview);
+       g_signal_connect (priv->page_entry,
+                         "activate",
+                         G_CALLBACK (page_entry_activated),
+                         preview);
+       g_signal_connect (priv->page_entry,
+                         "insert-text",
+                         G_CALLBACK (page_entry_insert_text),
+                         NULL);
+       g_signal_connect (priv->page_entry,
+                         "focus-out-event",
+                         G_CALLBACK (page_entry_focus_out),
+                         preview);
+       g_signal_connect (priv->multi,
+                         "clicked",
+                         G_CALLBACK (multi_button_clicked),
+                         preview);
+       g_signal_connect (priv->zoom_one,
+                         "clicked",
+                         G_CALLBACK (zoom_one_button_clicked),
+                         preview);
+       g_signal_connect (priv->zoom_fit,
+                         "clicked",
+                         G_CALLBACK (zoom_fit_button_clicked),
+                         preview);
+       g_signal_connect (priv->zoom_in,
+                         "clicked",
+                         G_CALLBACK (zoom_in_button_clicked),
+                         preview);
+       g_signal_connect (priv->zoom_out,
+                         "clicked",
+                         G_CALLBACK (zoom_out_button_clicked),
+                         preview);
+       g_signal_connect (priv->close,
+                         "clicked",
+                         G_CALLBACK (close_button_clicked),
                          preview);
 
        g_object_set (priv->layout, "has-tooltip", TRUE, NULL);
@@ -964,41 +852,12 @@ create_preview_layout (GeditPrintPreview *preview)
                          "query-tooltip",
                          G_CALLBACK (preview_layout_query_tooltip),
                          preview);
+       g_signal_connect (priv->layout,
+                         "key-press-event",
+                         G_CALLBACK (preview_layout_key_press),
+                         preview);
 
-       priv->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
-                                       GTK_POLICY_AUTOMATIC,
-                                       GTK_POLICY_AUTOMATIC);
-
-       gtk_container_add (GTK_CONTAINER (priv->scrolled_window), priv->layout);
-       gtk_box_pack_end (GTK_BOX (preview),
-                         priv->scrolled_window,
-                         TRUE, TRUE, 0);
-
-       gtk_widget_show_all (GTK_WIDGET (priv->scrolled_window));
        gtk_widget_grab_focus (GTK_WIDGET (priv->layout));
-}
-
-static void
-gedit_print_preview_init (GeditPrintPreview *preview)
-{
-       GeditPrintPreviewPrivate *priv;
-
-       priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
-                                           GEDIT_TYPE_PRINT_PREVIEW,
-                                           GeditPrintPreviewPrivate);
-
-       preview->priv = priv;
-
-       priv->operation = NULL;
-       priv->context = NULL;
-       priv->gtk_preview = NULL;
-
-       gtk_orientable_set_orientation (GTK_ORIENTABLE (preview),
-                                       GTK_ORIENTATION_VERTICAL);
-
-       create_bar (preview);
-       create_preview_layout (preview);
 
        /* FIXME */
        priv->cur_page = 0;
diff --git a/gedit/gedit-print-preview.h b/gedit/gedit-print-preview.h
index 5b61642..7e11911 100644
--- a/gedit/gedit-print-preview.h
+++ b/gedit/gedit-print-preview.h
@@ -48,14 +48,14 @@ typedef struct _GeditPrintPreviewClass   GeditPrintPreviewClass;
 
 struct _GeditPrintPreview
 {
-       GtkBox parent;
+       GtkGrid parent;
 
        GeditPrintPreviewPrivate *priv;
 };
 
 struct _GeditPrintPreviewClass
 {
-       GtkBoxClass parent_class;
+       GtkGridClass parent_class;
 
        void (* close)          (GeditPrintPreview          *preview);
 };
diff --git a/gedit/gedit-print-preview.ui b/gedit/gedit-print-preview.ui
new file mode 100644
index 0000000..0947b90
--- /dev/null
+++ b/gedit/gedit-print-preview.ui
@@ -0,0 +1,296 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.8 -->
+  <template class="GeditPrintPreview" parent="GtkGrid">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="has_focus">False</property>
+    <property name="is_focus">False</property>
+    <child>
+      <object class="GtkToolbar" id="toolbar1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="has_focus">False</property>
+        <property name="is_focus">False</property>
+        <property name="toolbar_style">both-horiz</property>
+        <child>
+          <object class="GtkToolButton" id="prev">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Show the previous page</property>
+            <property name="label" translatable="yes">P_revious Page</property>
+            <property name="use_underline">True</property>
+            <property name="stock_id">gtk-go-back</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="next">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Show the next page</property>
+            <property name="label" translatable="yes">_Next Page</property>
+            <property name="use_underline">True</property>
+            <property name="stock_id">gtk-go-forward</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparatorToolItem" id="toolseparator1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolItem" id="toolbutton1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="has_focus">False</property>
+                <property name="is_focus">False</property>
+                <property name="column_spacing">4</property>
+                <child>
+                  <object class="GtkEntry" id="page_entry">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="has_focus">False</property>
+                    <property name="is_focus">False</property>
+                    <property name="max_length">6</property>
+                    <property name="width_chars">3</property>
+                    <property name="primary_icon_tooltip_text" translatable="yes">Current page 
(Alt+P)</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="has_focus">False</property>
+                    <property name="is_focus">False</property>
+                    <property name="label" translatable="yes" comments="the &quot;of&quot; from &quot;1 of 
19&quot; in print preview">of</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="last">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="has_focus">False</property>
+                    <property name="is_focus">False</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="last-atkobject">
+                        <property name="AtkObject::accessible-name" translatable="yes">Page total</property>
+                        <property name="AtkObject::accessible-description" translatable="yes">The total 
number of pages in the document</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">2</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">False</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparatorToolItem" id="toolseparator2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="multi">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Show multiple pages</property>
+            <property name="stock_id">gtk-dnd-multiple</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparatorToolItem" id="toolseparator3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="zoom_one">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Zoom 1:1</property>
+            <property name="stock_id">gtk-zoom-100</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="zoom_fit">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Zoom to fit the whole page</property>
+            <property name="stock_id">gtk-zoom-fit</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="zoom_in">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Zoom the page in</property>
+            <property name="stock_id">gtk-zoom-in</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="zoom_out">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Zoom the page out</property>
+            <property name="stock_id">gtk-zoom-out</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparatorToolItem" id="toolseparator4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolButton" id="close">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Close print preview</property>
+            <property name="label" translatable="yes">_Close Preview</property>
+            <property name="is_important">True</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="homogeneous">True</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScrolledWindow" id="scrolledwindow1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="has_focus">False</property>
+        <property name="is_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="shadow_type">in</property>
+        <child>
+          <object class="GtkLayout" id="layout">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | 
GDK_STRUCTURE_MASK</property>
+            <child internal-child="accessible">
+              <object class="AtkObject" id="layout1-atkobject">
+                <property name="AtkObject::accessible-name" translatable="yes">Page Preview</property>
+                <property name="AtkObject::accessible-description" translatable="yes">The preview of a page 
in the document to be printed</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+  </template>
+</interface>
diff --git a/gedit/gedit.gresource.xml b/gedit/gedit.gresource.xml
index d391d3a..3035ff2 100644
--- a/gedit/gedit.gresource.xml
+++ b/gedit/gedit.gresource.xml
@@ -7,6 +7,7 @@
     <file preprocess="xml-stripblanks">gedit-encodings-dialog.ui</file>
     <file preprocess="xml-stripblanks">gedit-preferences-dialog.ui</file>
     <file preprocess="xml-stripblanks">gedit-replace-dialog.ui</file>
+    <file preprocess="xml-stripblanks">gedit-print-preview.ui</file>
     <file preprocess="xml-stripblanks">gedit-print-preferences.ui</file>
   </gresource>
 </gresources>


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