diff libgui/src/documentation.h @ 25121:9578133ca03e stable

Add a Ctrl+F unhide/hide in-page find footer to the Documentation window (bug #53006) * documentation.cc: Add <QShortcut>, <QToolButton> and "resource-manager" to list of headers. (documentation::documentation): Create new browser_find widget and make it the parent of m_doc_browser for short-cut key behavior reasons. Layout a footer with a "Find:" QLabel, a QLineEdit to hold search text, a forward-find QToolButton and a backward-find QToolButton. Connect QLineEdit's returnPressed() signal and forward_button's pressed() signal to documentation window's find_forward() slot. Connect backward_button's pressed() signal to documentation window's find_backward() slot. Add a QShortcut for "Ctrl+F" with parent browser_find and connect its activated() signal to the documentation window's toggle_hidden_find() slot. Default is find_footer hidden. (documentation::find_forward): Added. Call m_doc_brower's find() method in the forward direction. (documentation::find_backward): Added. Call m_doc_brower's find() method in the backward direction. (documentation::toggle_hidden_find): Added. Toggle find_footer's hidden status and put the focus either in m_find_line_edit or m_doc_browser accordingly. * documentation.h: Add new member QLineEdit pointer variable m_find_line_edit. (documentation::find_foward): Added. New slot, void input. (documentation::find_backward): Ditto. (documentation::toggle_hidden_find): Ditto.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Tue, 03 Apr 2018 20:17:42 -0500
parents 1cd3aeda7598
children 17387d4edd1d
line wrap: on
line diff
--- a/libgui/src/documentation.h	Mon Apr 02 20:41:58 2018 +0200
+++ b/libgui/src/documentation.h	Tue Apr 03 20:17:42 2018 -0500
@@ -86,11 +86,15 @@
     void global_search_finished (int hits);
     void filter_update (const QString& expression);
     void filter_update_history (void);
+    void find_forward (void);
+    void find_backward (void);
+    void toggle_hidden_find (void);
 
   private:
 
     QHelpEngine *m_help_engine;
     documentation_browser *m_doc_browser;
+    QLineEdit *m_find_line_edit;
     QComboBox *m_filter;
     QString m_collection;