1
0
mirror of https://gitlab.gnome.org/GNOME/evince synced 2024-07-04 16:48:55 +00:00

shell: Use composite template for EvToolbar

This adapts to the most recent used pattern and simplifies
the code.

It was required to modify EvZoomAction to fit the template model.
EvZoomAction needs the model (EvDocumentModel) to be fully-functional.
The said model is not available at the widget creation time when using
templates because the model is only available programmatically. Therefore,
we partially revert commit 55b21fe75e
by using again ev_zoom_action_set_model. In the process, the "document-model"
property is also removed, as it is not needed (never emmited, no consumers).
The G_PARAM_CONSTRUCT_ONLY condition of the property is partially kept by
making sure that we throw a critical if the model is already set.
This commit is contained in:
Pablo Correa Gómez 2022-03-29 18:11:19 +02:00 committed by Germán Poo-Caamaño
parent 0168051fe5
commit 61152289ac
7 changed files with 284 additions and 328 deletions

View File

@ -40,22 +40,23 @@ enum
};
typedef struct {
EvWindow *window;
EvWindow *window;
GtkWidget *action_menu_button;
GtkWidget *zoom_action;
GtkWidget *page_selector;
GtkWidget *find_button;
GtkWidget *open_button;
GtkWidget *annots_button;
GtkWidget *sidebar_button;
GtkWidget *open_button;
GtkWidget *sidebar_button;
GtkWidget *page_selector;
GtkWidget *annots_button;
GtkWidget *zoom_action;
GtkWidget *find_button;
GtkWidget *action_menu_button;
EvToolbarMode toolbar_mode;
EvToolbarMode toolbar_mode;
} EvToolbarPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (EvToolbar, ev_toolbar, HDY_TYPE_HEADER_BAR)
G_DEFINE_TYPE_WITH_CODE (EvToolbar, ev_toolbar, HDY_TYPE_HEADER_BAR,
G_ADD_PRIVATE (EvToolbar))
# define GET_PRIVATE(o) ev_toolbar_get_instance_private (o)
#define GET_PRIVATE(o) ev_toolbar_get_instance_private (o)
static void
ev_toolbar_set_property (GObject *object,
@ -76,84 +77,8 @@ ev_toolbar_set_property (GObject *object,
}
static void
ev_toolbar_set_button_action (EvToolbar *ev_toolbar,
GtkButton *button,
const gchar *action_name,
const gchar *tooltip)
{
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), action_name);
gtk_button_set_label (button, NULL);
gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
if (tooltip)
gtk_widget_set_tooltip_text (GTK_WIDGET (button), tooltip);
}
static GtkWidget *
ev_toolbar_create_button (EvToolbar *ev_toolbar,
const gchar *action_name,
const gchar *icon_name,
const gchar *label,
const gchar *tooltip)
{
GtkWidget *button = gtk_button_new ();
GtkWidget *image;
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
if (icon_name)
gtk_button_set_image (GTK_BUTTON (button), image);
if (label)
gtk_button_set_label (GTK_BUTTON (button), label);
ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action_name, tooltip);
return button;
}
static GtkWidget *
ev_toolbar_create_toggle_button (EvToolbar *ev_toolbar,
const gchar *action_name,
const gchar *icon_name,
const gchar *tooltip)
{
GtkWidget *button = gtk_toggle_button_new ();
GtkWidget *image;
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_button_set_image (GTK_BUTTON (button), image);
ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action_name, tooltip);
return button;
}
static GtkWidget *
ev_toolbar_create_menu_button (EvToolbar *ev_toolbar,
const gchar *icon_name,
GMenuModel *menu,
GtkAlign menu_align)
{
GtkWidget *button;
GtkPopover *popup;
button = gtk_menu_button_new ();
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_set_focus_on_click (button, FALSE);
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON (button))),
icon_name, GTK_ICON_SIZE_MENU);
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
popup = gtk_menu_button_get_popover (GTK_MENU_BUTTON (button));
gtk_popover_set_position (popup, GTK_POS_BOTTOM);
gtk_widget_set_halign (GTK_WIDGET (popup), menu_align);
return button;
}
static void
zoom_selector_activated (GtkWidget *zoom_action,
EvToolbar *ev_toolbar)
ev_toolbar_zoom_selector_activated (GtkWidget *zoom_action,
EvToolbar *ev_toolbar)
{
EvToolbarPrivate *priv = GET_PRIVATE (ev_toolbar);
@ -187,87 +112,36 @@ ev_toolbar_constructed (GObject *object)
{
EvToolbar *ev_toolbar = EV_TOOLBAR (object);
EvToolbarPrivate *priv = GET_PRIVATE (ev_toolbar);
GtkBuilder *builder;
GtkWidget *tool_item;
GtkWidget *vbox;
GtkWidget *button;
GMenuModel *menu;
G_OBJECT_CLASS (ev_toolbar_parent_class)->constructed (object);
builder = gtk_builder_new_from_resource ("/org/gnome/evince/gtk/menus.ui");
button = ev_toolbar_create_button (ev_toolbar, "win.open",
NULL,
_("Open…"),
_("Open an existing document"));
priv->open_button = button;
gtk_container_add (GTK_CONTAINER (ev_toolbar), button);
/* Sidebar */
button = ev_toolbar_create_toggle_button (ev_toolbar, "win.show-side-pane",
EV_STOCK_VIEW_SIDEBAR,
_("Side pane"));
priv->sidebar_button = button;
hdy_header_bar_pack_start (HDY_HEADER_BAR (ev_toolbar), button);
/* Page selector */
/* Use EvPageActionWidget for now, since the page selector action is also used by the previewer */
tool_item = GTK_WIDGET (g_object_new (EV_TYPE_PAGE_ACTION_WIDGET, NULL));
gtk_widget_set_tooltip_text (tool_item, _("Select page or search in the index"));
atk_object_set_name (gtk_widget_get_accessible (tool_item), _("Select page"));
priv->page_selector = tool_item;
ev_page_action_widget_set_model (EV_PAGE_ACTION_WIDGET (tool_item),
ev_page_action_widget_set_model (EV_PAGE_ACTION_WIDGET (priv->page_selector),
ev_window_get_document_model (priv->window));
hdy_header_bar_pack_start (HDY_HEADER_BAR (ev_toolbar), tool_item);
/* Edit Annots */
button = ev_toolbar_create_toggle_button (ev_toolbar, "win.toggle-edit-annots", "document-edit-symbolic",
_("Annotate the document"));
atk_object_set_name (gtk_widget_get_accessible (button), _("Annotate document"));
priv->annots_button = button;
hdy_header_bar_pack_start (HDY_HEADER_BAR (ev_toolbar), button);
/* Action Menu */
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "action-menu"));
button = ev_toolbar_create_menu_button (ev_toolbar, "open-menu-symbolic",
menu, GTK_ALIGN_END);
gtk_widget_set_tooltip_text (button, _("File options"));
atk_object_set_name (gtk_widget_get_accessible (button), _("File options"));
priv->action_menu_button = button;
hdy_header_bar_pack_end (HDY_HEADER_BAR (ev_toolbar), button);
/* Find */
button = ev_toolbar_create_toggle_button (ev_toolbar, "win.toggle-find", "edit-find-symbolic",
NULL);
priv->find_button = button;
hdy_header_bar_pack_end (HDY_HEADER_BAR (ev_toolbar), button);
g_signal_connect (button,
"notify::sensitive",
G_CALLBACK (ev_toolbar_find_button_sensitive_changed),
ev_toolbar);
/* Zoom selector */
vbox = ev_zoom_action_new (ev_window_get_document_model (priv->window));
priv->zoom_action = vbox;
atk_object_set_name (gtk_widget_get_accessible (vbox), _("Set zoom level"));
g_signal_connect (vbox, "activated",
G_CALLBACK (zoom_selector_activated),
ev_toolbar);
hdy_header_bar_pack_end (HDY_HEADER_BAR (ev_toolbar), vbox);
g_object_unref (builder);
ev_zoom_action_set_model (EV_ZOOM_ACTION (priv->zoom_action),
ev_window_get_document_model (priv->window));
}
static void
ev_toolbar_class_init (EvToolbarClass *klass)
{
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_object_class->set_property = ev_toolbar_set_property;
g_object_class->constructed = ev_toolbar_constructed;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/evince/ui/ev-toolbar.ui");
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, open_button);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, sidebar_button);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, page_selector);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, annots_button);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, action_menu_button);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, find_button);
gtk_widget_class_bind_template_child_private (widget_class, EvToolbar, zoom_action);
gtk_widget_class_bind_template_callback (widget_class, ev_toolbar_find_button_sensitive_changed);
gtk_widget_class_bind_template_callback (widget_class, ev_toolbar_zoom_selector_activated);
g_object_class_install_property (g_object_class,
PROP_WINDOW,
g_param_spec_object ("window",
@ -284,7 +158,9 @@ ev_toolbar_init (EvToolbar *ev_toolbar)
{
EvToolbarPrivate *priv = GET_PRIVATE (ev_toolbar);
priv->toolbar_mode = EV_TOOLBAR_MODE_NORMAL;
priv->toolbar_mode = EV_TOOLBAR_MODE_NORMAL;
gtk_widget_init_template (GTK_WIDGET (ev_toolbar));
}
GtkWidget *

View File

@ -29,13 +29,6 @@ enum {
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_DOCUMENT_MODEL,
};
enum {
ZOOM_MODES_SECTION,
ZOOM_FREE_SECTION
@ -259,6 +252,38 @@ entry_icon_press_cb (GtkEntry *entry,
gtk_popover_popup (priv->popup);
}
void
ev_zoom_action_set_model (EvZoomAction *zoom_action,
EvDocumentModel *model)
{
EvZoomActionPrivate *priv;
g_return_if_fail (EV_IS_ZOOM_ACTION (zoom_action));
g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
priv = GET_PRIVATE (zoom_action);
g_return_if_fail (priv->model == NULL);
priv->model = model;
ev_zoom_action_populate_free_zoom_section (zoom_action);
g_object_add_weak_pointer (G_OBJECT (priv->model),
(gpointer)&priv->model);
ev_zoom_action_update_zoom_level (zoom_action);
g_signal_connect_object (priv->model, "notify::document",
G_CALLBACK (document_changed_cb),
zoom_action, 0);
g_signal_connect_object (priv->model, "notify::scale",
G_CALLBACK (zoom_changed_cb),
zoom_action, 0);
g_signal_connect_object (priv->model, "notify::max-scale",
G_CALLBACK (max_zoom_changed_cb),
zoom_action, 0);
}
static void
ev_zoom_action_finalize (GObject *object)
{
@ -275,24 +300,6 @@ ev_zoom_action_finalize (GObject *object)
G_OBJECT_CLASS (ev_zoom_action_parent_class)->finalize (object);
}
static void
ev_zoom_action_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
EvZoomAction *zoom_action = EV_ZOOM_ACTION (object);
EvZoomActionPrivate *priv = GET_PRIVATE (zoom_action);
switch (prop_id) {
case PROP_DOCUMENT_MODEL:
priv->model = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
setup_initial_entry_size (EvZoomAction *zoom_action)
{
@ -313,26 +320,6 @@ ev_zoom_action_constructed (GObject *object)
priv->zoom_free_section =
g_menu_model_get_item_link (G_MENU_MODEL (priv->menu),
ZOOM_FREE_SECTION, G_MENU_LINK_SECTION);
ev_zoom_action_populate_free_zoom_section (zoom_action);
g_object_add_weak_pointer (G_OBJECT (priv->model),
(gpointer)&priv->model);
if (ev_document_model_get_document (priv->model)) {
ev_zoom_action_update_zoom_level (zoom_action);
} else {
ev_zoom_action_set_zoom_level (zoom_action, 1.);
gtk_widget_set_sensitive (GTK_WIDGET (zoom_action), FALSE);
}
g_signal_connect_object (priv->model, "notify::document",
G_CALLBACK (document_changed_cb),
zoom_action, 0);
g_signal_connect_object (priv->model, "notify::scale",
G_CALLBACK (zoom_changed_cb),
zoom_action, 0);
g_signal_connect_object (priv->model, "notify::max-scale",
G_CALLBACK (max_zoom_changed_cb),
zoom_action, 0);
setup_initial_entry_size (zoom_action);
}
@ -345,7 +332,6 @@ ev_zoom_action_class_init (EvZoomActionClass *klass)
object_class->finalize = ev_zoom_action_finalize;
object_class->constructed = ev_zoom_action_constructed;
object_class->set_property = ev_zoom_action_set_property;
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/evince/ui/zoom-action.ui");
@ -358,16 +344,6 @@ ev_zoom_action_class_init (EvZoomActionClass *klass)
gtk_widget_class_bind_template_callback (widget_class, entry_activated_cb);
gtk_widget_class_bind_template_callback (widget_class, focus_out_cb);
g_object_class_install_property (object_class,
PROP_DOCUMENT_MODEL,
g_param_spec_object ("document-model",
"DocumentModel",
"The document model",
EV_TYPE_DOCUMENT_MODEL,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
signals[ACTIVATED] =
g_signal_new ("activated",
G_OBJECT_CLASS_TYPE (object_class),
@ -390,13 +366,3 @@ ev_zoom_action_init (EvZoomAction *zoom_action)
*/
gtk_popover_bind_model (priv->popup, G_MENU_MODEL (priv->menu), NULL);
}
GtkWidget *
ev_zoom_action_new (EvDocumentModel *model)
{
g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), NULL);
return GTK_WIDGET (g_object_new (EV_TYPE_ZOOM_ACTION,
"document-model", model,
NULL));
}

View File

@ -44,8 +44,8 @@ struct _EvZoomActionClass {
GtkBoxClass parent_class;
};
GType ev_zoom_action_get_type (void);
GtkWidget *ev_zoom_action_new (EvDocumentModel *model);
GType ev_zoom_action_get_type (void);
void ev_zoom_action_set_model (EvZoomAction *zoom_action,
EvDocumentModel *model);
G_END_DECLS

View File

@ -18,109 +18,6 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-->
<interface>
<menu id="action-menu">
<section>
<attribute name="display-hint">horizontal-buttons</attribute>
<item>
<attribute name="label" translatable="yes">Print…</attribute>
<attribute name="action">win.print</attribute>
<attribute name="verb-icon">printer-symbolic</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Fullscreen</attribute>
<attribute name="action">win.fullscreen</attribute>
<attribute name="verb-icon">view-fullscreen-symbolic</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Send To…</attribute>
<attribute name="action">win.send-to</attribute>
<attribute name="verb-icon">send-to-symbolic</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Window</attribute>
<attribute name="action">win.new</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Open a C_opy</attribute>
<attribute name="action">win.open-copy</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open Containing _Folder</attribute>
<attribute name="action">win.open-containing-folder</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Save As…</attribute>
<attribute name="action">win.save-as</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Present as _Slideshow</attribute>
<attribute name="action">win.presentation</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Continuous</attribute>
<attribute name="action">win.continuous</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Dual</attribute>
<attribute name="action">win.dual-page</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Odd Pages Left</attribute>
<attribute name="action">win.dual-odd-left</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Right to Left Document</attribute>
<attribute name="action">win.rtl</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Ro_tate ⤵</attribute>
<attribute name="action">win.rotate-right</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Ni_ght Mode</attribute>
<attribute name="action">win.inverted-colors</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Prop_erties</attribute>
<attribute name="action">win.show-properties</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Save Current Settings as Defa_ult</attribute>
<attribute name="action">win.save-settings</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">win.help</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Document Viewer</attribute>
<attribute name="action">win.about</attribute>
</item>
</section>
</menu>
<menu id="view-popup-menu">
<section>
<item>

215
shell/evince-toolbar.ui Normal file
View File

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="EvToolbar" parent="HdyHeaderBar">
<child>
<object class="GtkButton" id="open_button">
<property name="action-name">win.open</property>
<property name="label" translatable="yes">Open…</property>
<property name="tooltip-text" translatable="yes">Open an existing document</property>
</object>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="sidebar_button">
<property name="action-name">win.show-side-pane</property>
<property name="tooltip-text" translatable="yes">Side pane</property>
<child>
<object class="GtkImage">
<property name="icon-name">view-sidebar-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
<child>
<object class="EvPageActionWidget" id="page_selector">
<property name="tooltip-text" translatable="yes">Select page or search in the index</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="AtkObject::accessible-name" translatable="yes">Select page</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="annots_button">
<property name="action-name">win.toggle-edit-annots</property>
<property name="tooltip-text" translatable="yes">Annotate the document</property>
<child>
<object class="GtkImage">
<property name="icon-name">document-edit-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<child internal-child="accessible">
<object class="AtkObject">
<property name="AtkObject::accessible-name" translatable="yes">Annotate document</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="action_menu_button">
<property name="direction">1</property>
<property name="tooltip-text" translatable="yes">File options</property>
<property name="menu-model">action-menu</property>
<child>
<object class="GtkImage">
<property name="icon-name">open-menu-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<child internal-child="accessible">
<object class="AtkObject">
<property name="AtkObject::accessible-name" translatable="yes">File options</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="find_button">
<property name="action-name">win.toggle-find</property>
<signal name="notify::sensitive" handler="ev_toolbar_find_button_sensitive_changed"/>
<child>
<object class="GtkImage">
<property name="icon-name">edit-find-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="EvZoomAction" id="zoom_action">
<signal name="activated" handler="ev_toolbar_zoom_selector_activated"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="AtkObject::accessible-name" translatable="yes">Set zoom level</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</template>
<menu id="action-menu">
<section>
<attribute name="display-hint">horizontal-buttons</attribute>
<item>
<attribute name="label" translatable="yes">Print…</attribute>
<attribute name="action">win.print</attribute>
<attribute name="verb-icon">printer-symbolic</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Fullscreen</attribute>
<attribute name="action">win.fullscreen</attribute>
<attribute name="verb-icon">view-fullscreen-symbolic</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Send To…</attribute>
<attribute name="action">win.send-to</attribute>
<attribute name="verb-icon">send-to-symbolic</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Window</attribute>
<attribute name="action">win.new</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Open a C_opy</attribute>
<attribute name="action">win.open-copy</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open Containing _Folder</attribute>
<attribute name="action">win.open-containing-folder</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Save As…</attribute>
<attribute name="action">win.save-as</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Present as _Slideshow</attribute>
<attribute name="action">win.presentation</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Continuous</attribute>
<attribute name="action">win.continuous</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Dual</attribute>
<attribute name="action">win.dual-page</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Odd Pages Left</attribute>
<attribute name="action">win.dual-odd-left</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Right to Left Document</attribute>
<attribute name="action">win.rtl</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Ro_tate ⤵</attribute>
<attribute name="action">win.rotate-right</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Ni_ght Mode</attribute>
<attribute name="action">win.inverted-colors</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Prop_erties</attribute>
<attribute name="action">win.show-properties</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Save Current Settings as Defa_ult</attribute>
<attribute name="action">win.save-settings</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">win.help</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Document Viewer</attribute>
<attribute name="action">win.about</attribute>
</item>
</section>
</menu>
</interface>

View File

@ -28,6 +28,7 @@
<file alias="ui/recent-view.ui" compressed="true" preprocess="xml-stripblanks">evince-recent-view.ui</file>
<file alias="ui/sidebar.ui" compressed="true" preprocess="xml-stripblanks">evince-sidebar.ui</file>
<file alias="ui/sidebar-bookmarks.ui" compressed="true" preprocess="xml-stripblanks">evince-sidebar-bookmarks.ui</file>
<file alias="ui/ev-toolbar.ui" compressed="true" preprocess="xml-stripblanks">evince-toolbar.ui</file>
<file alias="ui/zoom-action.ui" compressed="true" preprocess="xml-stripblanks">evince-zoom-action.ui</file>
</gresource>
</gresources>

View File

@ -43,6 +43,7 @@ resource_data = files(
'evince-recent-view.ui',
'evince-sidebar.ui',
'evince-sidebar-bookmarks.ui',
'evince-toolbar.ui',
'evince-zoom-action.ui',
'help-overlay.ui',
)