diff options
author | Jonathan White <support@dmapps.us> | 2020-04-22 01:46:21 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2020-05-15 03:21:32 +0300 |
commit | 49487f9d4a717436856320b8a1601be4cfbd348b (patch) | |
tree | 9215fd8fc23468086c2aaaf48db4b509e214c11b /src/gui/DatabaseWidget.h | |
parent | 51429810189cf17501b925712920f9340ec4f4d1 (diff) |
Fix changing focus around the main window using tab
* Override Qt's default [broken] behavior of handling Tab/Shift+Tab to navigate around the MainWindow. Completely fixes trapped focus.
* Improve handling of search results when navigating the UI.
* Fix selecting first entry after ending a search.
* Add keyboard shortcuts to directly focus on search (F1), Group List (F2), and Entry List (F3)
* Fixes #2878, #4636, and #4221
Diffstat (limited to 'src/gui/DatabaseWidget.h')
-rw-r--r-- | src/gui/DatabaseWidget.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h index d54c63439..0d0afe8f1 100644 --- a/src/gui/DatabaseWidget.h +++ b/src/gui/DatabaseWidget.h @@ -76,12 +76,15 @@ public: explicit DatabaseWidget(const QString& filePath, QWidget* parent = nullptr); ~DatabaseWidget(); + void setFocus(Qt::FocusReason reason); + QSharedPointer<Database> database() const; DatabaseWidget::Mode currentMode() const; bool isLocked() const; bool isSaving() const; bool isSearchActive() const; + bool isEntryViewActive() const; bool isEntryEditActive() const; bool isGroupEditActive() const; @@ -161,7 +164,8 @@ public slots: void cloneEntry(); void deleteSelectedEntries(); void deleteEntries(QList<Entry*> entries); - void setFocus(); + void focusOnEntries(); + void focusOnGroups(); void copyTitle(); void copyUsername(); void copyPassword(); @@ -217,6 +221,7 @@ public slots: protected: void closeEvent(QCloseEvent* event) override; void showEvent(QShowEvent* event) override; + bool focusNextPrevChild(bool next) override; private slots: void entryActivationSignalReceived(Entry* entry, EntryModel::ModelColumn column); @@ -228,7 +233,7 @@ private slots: void emitGroupContextMenuRequested(const QPoint& pos); void emitEntryContextMenuRequested(const QPoint& pos); void onEntryChanged(Entry* entry); - void onGroupChanged(Group* group); + void onGroupChanged(); void onDatabaseModified(); void connectDatabaseSignals(); void loadDatabase(bool accepted); |