summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2014-02-23 12:12:33 -0500
committerShaun McCance <shaunm@gnome.org>2014-02-23 12:12:33 -0500
commit5176d07c5d3f30e3b51bcb3fdaa7ab6c8f1802f9 (patch)
treed9f2c31a8081ec79a19487a356666cb3d7738ed3 /src
parent5f00cbf67a5494b5cfbe85f68f4adfb5ac5842d5 (diff)
downloadyelp-5176d07c5d3f30e3b51bcb3fdaa7ab6c8f1802f9.tar.gz
Hooked up actions for previous and next page
Diffstat (limited to 'src')
-rw-r--r--src/yelp-application.c12
-rw-r--r--src/yelp-window.c33
2 files changed, 26 insertions, 19 deletions
diff --git a/src/yelp-application.c b/src/yelp-application.c
index 0b810cc7..7eb65c37 100644
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@ -150,6 +150,10 @@ yelp_application_init (YelpApplication *app)
"win.search",
NULL);
gtk_application_add_accelerator (GTK_APPLICATION (app),
+ "<Control>p",
+ "win.yelp-view-print",
+ NULL);
+ gtk_application_add_accelerator (GTK_APPLICATION (app),
"<Alt>Left",
"win.yelp-view-go-back",
NULL);
@@ -157,6 +161,14 @@ yelp_application_init (YelpApplication *app)
"<Alt>Right",
"win.yelp-view-go-forward",
NULL);
+ gtk_application_add_accelerator (GTK_APPLICATION (app),
+ "<Control>Page_Up",
+ "win.yelp-view-go-previous",
+ NULL);
+ gtk_application_add_accelerator (GTK_APPLICATION (app),
+ "<Control>Page_Down",
+ "win.yelp-view-go-next",
+ NULL);
}
static void
diff --git a/src/yelp-window.c b/src/yelp-window.c
index f4cce8c9..f05ae587 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -159,8 +159,6 @@ static const gchar *YELP_UI =
"<ui>"
"<menubar>"
"<menu action='PageMenu'>"
- "<menuitem action='NewWindow'/>"
- "<menuitem action='Find'/>"
"<separator/>"
"<menuitem action='YelpViewPrint'/>"
"<separator/>"
@@ -172,24 +170,8 @@ static const gchar *YELP_UI =
"<separator/>"
"<menuitem action='ShowTextCursor'/>"
"</menu>"
- "<menu action='GoMenu'>"
- "<menuitem action='YelpViewGoBack'/>"
- "<menuitem action='YelpViewGoForward'/>"
- "<separator/>"
- "<menuitem action='YelpViewGoPrevious'/>"
- "<menuitem action='YelpViewGoNext'/>"
- "<separator/>"
"<menuitem action='GoAll'/>"
"</menu>"
- "<menu action='BookmarksMenu'>"
- "<menuitem action='AddBookmark'/>"
- "<menuitem action='RemoveBookmark'/>"
- "<separator/>"
- "<placeholder name='Bookmarks'/>"
- "</menu>"
- "</menubar>"
- "<accelerator action='Find'/>"
- "<accelerator action='Search'/>"
"<accelerator action='OpenLocation'/>"
"</ui>";
#endif
@@ -357,10 +339,10 @@ static void
window_construct (YelpWindow *window)
{
GtkWidget *scroll;
- GtkActionGroup *view_actions;
GtkAction *action;
GtkWidget *box, *button, *sw;
gchar *color, *text;
+ GMenu *menu;
YelpWindowPrivate *priv = GET_PRIV (window);
gboolean rtl;
@@ -415,6 +397,7 @@ window_construct (YelpWindow *window)
/** Menu **/
button = gtk_menu_button_new ();
+ gtk_menu_button_set_use_popover (GTK_MENU_BUTTON (button), TRUE);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
gtk_button_set_image (GTK_BUTTON (button),
@@ -422,6 +405,18 @@ window_construct (YelpWindow *window)
GTK_ICON_SIZE_MENU));
gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header), button);
+ menu = g_menu_new ();
+ g_menu_append (menu, _("New Window"), "win.new-window");
+ g_menu_append (menu, _("Find..."), "win.find");
+ g_menu_append (menu, _("Print..."), "win.yelp-view-print");
+ g_menu_append (menu, _("Previous Page"), "win.yelp-view-go-previous");
+ g_menu_append (menu, _("Next Page"), "win.yelp-view-go-next");
+ /* all documents */
+ /* larger/smaller text */
+ /* show text cursor */
+ /* open location */
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (menu));
+
/** Search **/
priv->vbox_view = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (priv->vbox_full), priv->vbox_view, TRUE, TRUE, 0);