From 1473bcf655271f6e229526c37e237ee0d49d366d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 15 Aug 2016 09:59:13 +0200 Subject: add functions to toggle slit/toolbar hidden --- doc/asciidoc/fluxbox-keys.txt | 6 ++++++ src/WorkspaceCmd.cc | 20 ++++++++++++++++++++ src/WorkspaceCmd.hh | 10 ++++++++++ 3 files changed, 36 insertions(+) diff --git a/doc/asciidoc/fluxbox-keys.txt b/doc/asciidoc/fluxbox-keys.txt index 560e94d..7d295f2 100644 --- a/doc/asciidoc/fluxbox-keys.txt +++ b/doc/asciidoc/fluxbox-keys.txt @@ -441,9 +441,15 @@ doing so. *ToggleSlitAbove*:: Toggles the slit between its regular and the AboveDock layer +*ToggleSlitHidden*:: + Toggles the slit's autohiding state (autohide doesn't have to be enabled) + *ToggleToolbarAbove*:: Toggles the toolbar between its regular and the AboveDock layer +*ToggleToolbarHidden*:: + Toggles the toolbar's autohiding state (autohide doesn't have to be enabled) + *Deiconify* 'mode' 'destination':: Deiconifies windows (or, restores from a minimized state). + diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index c2a2f8d..bdba96c 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -634,6 +634,16 @@ void ToggleSlitAboveCmd::execute() { #endif } +REGISTER_COMMAND(toggleslithidden, ToggleSlitHiddenCmd, void); +void ToggleSlitHiddenCmd::execute() { +#if USE_SLIT + if (BScreen *screen = Fluxbox::instance()->mouseScreen()) { + screen->slit()->toggleHidden(); + const_cast(screen->slit()->window()).raise(); + } +#endif +} + REGISTER_COMMAND(toggletoolbarabove, ToggleToolbarAboveCmd, void); void ToggleToolbarAboveCmd::execute() { #if USE_TOOLBAR @@ -644,6 +654,16 @@ void ToggleToolbarAboveCmd::execute() { #endif } +REGISTER_COMMAND(toggletoolbarvisible, ToggleToolbarHiddenCmd, void); +void ToggleToolbarHiddenCmd::execute() { +#if USE_TOOLBAR + if (BScreen *screen = Fluxbox::instance()->mouseScreen()) { + screen->toolbar()->toggleHidden(); + const_cast(screen->toolbar()->window()).raise(); + } +#endif +} + REGISTER_COMMAND(closeallwindows, CloseAllWindowsCmd, void); void CloseAllWindowsCmd::execute() { diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index 1766b3a..ae0b577 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh @@ -197,11 +197,21 @@ public: void execute(); }; +class ToggleSlitHiddenCmd: public FbTk::Command { +public: + void execute(); +}; + class ToggleToolbarAboveCmd: public FbTk::Command { public: void execute(); }; +class ToggleToolbarHiddenCmd: public FbTk::Command { +public: + void execute(); +}; + class CloseAllWindowsCmd: public FbTk::Command { public: void execute(); -- cgit v0.11.2