┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2024-08-18 21:41:34 +0000
committerFelix Ernst <[email protected]>2024-08-18 21:41:34 +0000
commitf220e3b0783a24a6c7195f170297cf4b12a29d85 (patch)
tree7ffe5976d8489b68d5b0624c46f391327ce73fb3 /src/dolphinmainwindow.h
parent9bac6eca0c21bf8ca8243d8038ad7d29a0094c9c (diff)
Implement "Focus Places Panel"
This commit implements an action to move focus to the Places panel analogous to "Focus Terminal Panel" functionality-wise. The implementation of the "Focus Terminal Panel" and "Focus Places Panel" actions is streamlined while improving their code quality. The "Focus Terminal Panel" action is moved into the "Show Panels" sub-menu because it makes more sense to be there considering that its previous location (the "Tools" menu) is meant for external applications and not for functionality internal to Dolphin. This commit also makes it so the keyboard focus is moved to and from the Places panel whenever it is toggled visible or invisible. This is now consistent with the focus handling when the Terminal panel is shown or hidden. The "Focus Places Panel" is one of the actions which was wished for in KDE's accessibility chat room because people relying on keyboard controls might need to press the Tab key a lot to move from the view to the Places panel. The new default shortcut is Ctrl+P.
Diffstat (limited to 'src/dolphinmainwindow.h')
-rw-r--r--src/dolphinmainwindow.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 5f2ed20ca..37994b85a 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -403,10 +403,21 @@ private Q_SLOTS:
void togglePanelLockState();
/**
- * Is invoked if the Terminal panel got visible/invisible and takes care
- * that the active view has the focus if the Terminal panel is invisible.
+ * Is invoked whenever the Terminal panel visibility is changed by the user and then moves the focus
+ * to the active view if the panel was hidden.
+ * @note The opposite action (putting focus to the Terminal) is not handled
+ * here but in TerminalPanel::showEvent().
+ * @param visible the new visibility state of the terminal panel
*/
- void slotTerminalPanelVisibilityChanged();
+ void slotTerminalPanelVisibilityChanged(bool visible);
+
+ /**
+ * Is invoked whenever the Places panel visibility is changed by the user and then either moves the focus
+ * - to the Places panel if it was made visible, or
+ * - to the active view if the panel was hidden.
+ * @param visible the new visibility state of the Places panel
+ */
+ void slotPlacesPanelVisibilityChanged(bool visible);
/** Goes back one step of the URL history. */
void goBack();
@@ -456,8 +467,11 @@ private Q_SLOTS:
/** Opens a terminal window for the URL. */
void openTerminalJob(const QUrl &url);
- /** Focus a Terminal Panel. */
- void focusTerminalPanel();
+ /** Toggles focus to/from a Terminal Panel. */
+ void toggleTerminalPanelFocus();
+
+ /** Toggles focus to/from the Places Panel. */
+ void togglePlacesPanelFocus();
/** Opens the settings dialog for Dolphin. */
void editSettings();