diff libgui/src/documentation.h @ 26017:390d59717711

adding a toolbar with common browse tools to the doc browser (bug 54938) * documentation.cc (documentation::documentation): remove obsolete shortcut initialization, initialize a toolbar and call method for adding actions, add tool bar into the browser layout, remove connections for the show and hide find bar shortcuts; (add_action): new method for simplifying the creation of tool bar actions; (construct_tool_bar): add actions to the doc browser and its tool bar; (notice_settings): get icon size and shortcuts from the settings file; (activate_find): new slot for the find action, showing/hiding the bar and setting/resetting focus; (zoom_normal) renamed into zoom_original * documentation.h: renamed zoom_normal into zoom_original, new slot activate_find, new methods construct_tool_bar and add_action, new class variables for the actions and the parent dock-widget * zoom-original.svg, zoom-original.png: new icon for windows or if not contained in system icon set * module.mk: new icon png file * resource.qrc: new icon png file * shortcut-manager.cc (do_init_data): New shortcuts for the doc browsers new actions; (fill_tree_widget): add doc browser shortcuts to the tree widget in the preferences dialog
author Torsten <mttl@mailbox.org>
date Sun, 04 Nov 2018 13:28:27 +0100
parents 49ffd0e0242d
children 20b87596b99a
line wrap: on
line diff
--- a/libgui/src/documentation.h	Fri Nov 02 16:11:49 2018 -0700
+++ b/libgui/src/documentation.h	Sun Nov 04 13:28:27 2018 +0100
@@ -29,6 +29,7 @@
 #include <QShortcut>
 #include <QSplitter>
 #include <QTextBrowser>
+#include <QToolBar>
 #include <QtHelp/QHelpEngine>
 
 namespace octave
@@ -56,7 +57,7 @@
     //!@{
     void zoom_in (void);
     void zoom_out (void);
-    void zoom_normal (void);
+    void zoom_original (void);
     //!@}
 
   protected:
@@ -106,6 +107,7 @@
 
   private slots:
 
+    void activate_find (void);
     void global_search (void);
     void global_search_started (void);
     void global_search_finished (int hits);
@@ -123,6 +125,11 @@
 
   private:
 
+    void construct_tool_bar (void);
+    QAction *add_action (const QIcon& icon, const QString& text,
+                         const char *member, QWidget *receiver = nullptr,
+                         QToolBar *tool_bar = nullptr);
+
     QHelpEngine *m_help_engine;
     QString m_internal_search;
     documentation_browser *m_doc_browser;
@@ -131,12 +138,20 @@
     QComboBox *m_filter;
     QString m_collection;
 
-    QShortcut *m_show_shortcut;
+    QWidget *m_doc_widget;
+    QToolBar *m_tool_bar;
+
+    QAction *m_action_go_home;
+    QAction *m_action_go_prev;
+    QAction *m_action_go_next;
+
+    QAction *m_action_find;
     QShortcut *m_findnext_shortcut;
     QShortcut *m_findprev_shortcut;
-    QShortcut *m_zoom_in_shortcut;
-    QShortcut *m_zoom_out_shortcut;
-    QShortcut *m_zoom_normal_shortcut;
+
+    QAction *m_action_zoom_in;
+    QAction *m_action_zoom_out;
+    QAction *m_action_zoom_original;
   };
 }