Mercurial > octave
diff libgui/src/documentation.h @ 25976:a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
* documentation.cc (documentation::documentation): initialize new shortcuts
with values for editor zoom shortcuts and connect them to the related
slots of the documentation_browser;
(documentation_browser::documentation_browser): initialize the new
class variable for storing the current zoom level
(documentation_browser::zoom_in): new slot for zooming in;
(documentation_browser::zoom_out): new slot for zooming out;
(documentation_browser::zoom_normal): new slot for resetting the zoom level
* documentation.h: updated some comments;
(class documentation_browser): new slots for zooming in, out and resetting,
new constants for min and max zoom level,
new class variable for storing the current zoom level;
(class documentation): new shortcuts for zooming in, out and resetting
* shortcut-manager.cc (do_fill_treewidget): new section for zooming in editor
and doc browser, add zoom shortcuts to this section
author | Torsten <mttl@mailbox.org> |
---|---|
date | Mon, 29 Oct 2018 21:25:13 +0100 |
parents | 506419b5f817 |
children | 49ffd0e0242d |
line wrap: on
line diff
--- a/libgui/src/documentation.h Mon Oct 29 10:09:32 2018 -0700 +++ b/libgui/src/documentation.h Mon Oct 29 21:25:13 2018 +0100 @@ -33,7 +33,8 @@ namespace octave { - // The documentation browser + //! Documentation browser derived from Textbrowser + class documentation_browser : public QTextBrowser { Q_OBJECT @@ -51,13 +52,33 @@ const QString& keyword = QString ()); void notice_settings (const QSettings *settings); + //! Zooming in and out while taking care of the zoom level + //!@{ + void zoom_in (void); + void zoom_out (void); + void zoom_normal (void); + //!@} + private: QHelpEngine *m_help_engine; + + //! Store the current zoom level + int m_zoom_level; + + //! Minimal and maximal zoom level avoiding calling + //! zoom_in and zoom_out without actually zooming but + //! with changing the stored zoom level + enum + { + min_zoom_level = -5, + max_zoom_level = 10 + }; }; - // The documentaiton main class (splitter) + //! The documentaiton main class derived from QSplitter + class documentation : public QSplitter { Q_OBJECT @@ -105,9 +126,13 @@ int m_search_anchor_position; QComboBox *m_filter; QString m_collection; + QShortcut *m_show_shortcut; QShortcut *m_findnext_shortcut; QShortcut *m_findprev_shortcut; + QShortcut *m_zoom_in_shortcut; + QShortcut *m_zoom_out_shortcut; + QShortcut *m_zoom_normal_shortcut; }; }