Commit 6e454ee8 authored by Felipe Borges's avatar Felipe Borges
Browse files

shell: Add shortcuts help window

Use GTK+'s new shortcut window to document our shortcuts.
See: https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows

https://bugzilla.gnome.org/show_bug.cgi?id=757828
parent 91ac78bc
......@@ -169,6 +169,7 @@ endif
EXTRA_DIST = \
evince.css \
evince-menus.ui \
help-overlay.ui \
evince-icon.rc \
evince.gresource.xml \
ev-gdbus.xml \
......
......@@ -1091,6 +1091,8 @@ ev_application_startup (GApplication *gapplication)
GError *error = NULL;
const gchar **it;
g_application_set_resource_base_path (gapplication, "/org/gnome/evince");
G_APPLICATION_CLASS (ev_application_parent_class)->startup (gapplication);
g_action_map_add_action_entries (G_ACTION_MAP (application),
......@@ -1098,7 +1100,7 @@ ev_application_startup (GApplication *gapplication)
application);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/org/gnome/evince/shell/ui/menus.ui", &error);
gtk_builder_add_from_resource (builder, "/org/gnome/evince/ui/menus.ui", &error);
g_assert_no_error (error);
gtk_application_set_app_menu (GTK_APPLICATION (application),
......
......@@ -195,7 +195,7 @@ ev_toolbar_constructed (GObject *object)
G_OBJECT_CLASS (ev_toolbar_parent_class)->constructed (object);
builder = gtk_builder_new_from_resource ("/org/gnome/evince/shell/ui/menus.ui");
builder = gtk_builder_new_from_resource ("/org/gnome/evince/ui/menus.ui");
button = ev_toolbar_create_button (ev_toolbar, "win.open",
"document-open-symbolic",
......
......@@ -6782,7 +6782,7 @@ ev_window_init (EvWindow *ev_window)
css_provider = gtk_css_provider_new ();
_gtk_css_provider_load_from_resource (css_provider,
"/org/gnome/evince/shell/ui/evince.css",
"/org/gnome/evince/ui/evince.css",
&error);
g_assert_no_error (error);
gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (GTK_WIDGET (ev_window)),
......@@ -7091,7 +7091,7 @@ ev_window_init (EvWindow *ev_window)
ev_window);
/* Popups */
builder = gtk_builder_new_from_resource ("/org/gnome/evince/shell/ui/menus.ui");
builder = gtk_builder_new_from_resource ("/org/gnome/evince/ui/menus.ui");
ev_window->priv->view_popup_menu = g_object_ref (G_MENU_MODEL (gtk_builder_get_object (builder, "view-popup-menu")));
ev_window->priv->attachment_popup_menu = g_object_ref (G_MENU_MODEL (gtk_builder_get_object (builder, "attachments-popup")));
g_object_unref (builder);
......
......@@ -12,7 +12,7 @@
.content-view.document-page {
border-style: solid;
border-width: 3px 3px 6px 4px;
border-image: url("resource:///org/gnome/evince/shell/ui/thumbnail-frame.png") 3 3 6 4;
border-image: url("resource:///org/gnome/evince/ui/thumbnail-frame.png") 3 3 6 4;
background-color: @theme_bg_color;
}
......
......@@ -16,7 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<gresources>
<gresource prefix="/org/gnome/evince/shell">
<gresource prefix="/org/gnome/evince">
<file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks">help-overlay.ui</file>
<file alias="ui/evince.css" compressed="true">evince.css</file>
<file alias="ui/thumbnail-frame.png" compressed="true">thumbnail-frame.png</file>
<file alias="ui/menus.ui" compressed="true" preprocess="xml-stripblanks">evince-menus.ui</file>
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="help_overlay">
<property name="modal">True</property>
<child>
<object class="GtkShortcutsSection">
<property name="visible">True</property>
<property name="section-name">shortcuts</property>
<property name="max-height">12</property>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Opening, closing, saving and printing</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Open a document</property>
<property name="accelerator">&lt;Primary&gt;O</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Open a copy of the current document</property>
<property name="accelerator">&lt;Primary&gt;N</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Save a copy of the current document</property>
<property name="accelerator">&lt;Primary&gt;S</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Print the current document</property>
<property name="accelerator">&lt;Primary&gt;P</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Close the current document window</property>
<property name="accelerator">&lt;Primary&gt;W</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Reload the document</property>
<property name="accelerator">&lt;Primary&gt;R</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Selecting and copying text</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Copy highlighted text</property>
<property name="accelerator">&lt;Primary&gt;C</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Select all the text in a document</property>
<property name="accelerator">&lt;Primary&gt;A</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Moving around the document</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Move up/down a page</property>
<property name="accelerator">Left Up Down Right</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Move up/down a page several lines at a time</property>
<property name="accelerator">Page_Up Page_Down</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to page number</property>
<property name="accelerator">&lt;Primary&gt;L</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to the beginning/end of a page</property>
<property name="accelerator">Home End</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to the beginning of the document</property>
<property name="accelerator">&lt;Primary&gt;Home</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to the end of the document</property>
<property name="accelerator">&lt;Primary&gt;End</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Finding text</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Show the search bar</property>
<property name="accelerator">&lt;Primary&gt;F</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to the next search result</property>
<property name="accelerator">&lt;Primary&gt;G</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to the previous search result</property>
<property name="accelerator">&lt;Primary&gt;&lt;shift&gt;G</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Rotating and zooming</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Rotate the page 90 degrees counter-clockwise</property>
<property name="accelerator">&lt;Primary&gt;Left</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Rotate the page 90 degrees clockwise</property>
<property name="accelerator">&lt;Primary&gt;Right</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Zoom in</property>
<property name="accelerator">&lt;Primary&gt;plus</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Zoom out</property>
<property name="accelerator">&lt;Primary&gt;minus</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Touchpad gestures</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Zoom in</property>
<property name="shortcut-type">gesture-pinch</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Zoom in</property>
<property name="shortcut-type">gesture-stretch</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to next page</property>
<property name="shortcut-type">gesture-two-finger-swipe-right</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes">Go to previous page</property>
<property name="shortcut-type">gesture-two-finger-swipe-left</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment