aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-12 15:29:50 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-08-26 06:06:47 (GMT)
commit6c0565c482b496b7d34e3731415829e7c4872535 (patch)
tree7b59e1a464c3c915e98f2d292cb5e4e992b3985e
parentf22435d60bf7a52e00608576074dd791e8731bf2 (diff)
downloadfluxbox-6c0565c482b496b7d34e3731415829e7c4872535.zip
fluxbox-6c0565c482b496b7d34e3731415829e7c4872535.tar.bz2
add commands to toggle toolbar and slit layer
toggle(Toolbar|Slit)Above toggles the resp. item between its regular and the AboveDock layer (ie. above everything, even visible on active fullscreen windows) Also required step for autoraising. REQUEST: 222
-rw-r--r--doc/asciidoc/fluxbox-keys.txt6
-rw-r--r--src/Screen.hh5
-rw-r--r--src/Slit.cc7
-rw-r--r--src/Slit.hh1
-rw-r--r--src/Toolbar.cc7
-rw-r--r--src/Toolbar.hh1
-rw-r--r--src/WorkspaceCmd.cc22
-rw-r--r--src/WorkspaceCmd.hh10
8 files changed, 59 insertions, 0 deletions
diff --git a/doc/asciidoc/fluxbox-keys.txt b/doc/asciidoc/fluxbox-keys.txt
index 4360c5f..560e94d 100644
--- a/doc/asciidoc/fluxbox-keys.txt
+++ b/doc/asciidoc/fluxbox-keys.txt
@@ -438,6 +438,12 @@ doing so.
438 Minimizes all windows on the current workspace. If they are already all 438 Minimizes all windows on the current workspace. If they are already all
439 minimized, then it restores them. 439 minimized, then it restores them.
440 440
441*ToggleSlitAbove*::
442 Toggles the slit between its regular and the AboveDock layer
443
444*ToggleToolbarAbove*::
445 Toggles the toolbar between its regular and the AboveDock layer
446
441*Deiconify* 'mode' 'destination':: 447*Deiconify* 'mode' 'destination'::
442Deiconifies windows (or, restores from a minimized state). 448Deiconifies windows (or, restores from a minimized state).
443+ 449+
diff --git a/src/Screen.hh b/src/Screen.hh
index 32a7f7a..a6aa9fb 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -126,6 +126,11 @@ public:
126 Slit *slit() { return m_slit.get(); } 126 Slit *slit() { return m_slit.get(); }
127 /// @return the slit, @see Slit 127 /// @return the slit, @see Slit
128 const Slit *slit() const { return m_slit.get(); } 128 const Slit *slit() const { return m_slit.get(); }
129
130 /// @return the toolbar, @see Toolbar
131 Toolbar *toolbar() { return m_toolbar.get(); }
132 /// @return the toolbar, @see Toolbar
133 const Toolbar *toolbar() const { return m_toolbar.get(); }
129 /** 134 /**
130 * @param w the workspace number 135 * @param w the workspace number
131 * @return workspace for the given workspace number 136 * @return workspace for the given workspace number
diff --git a/src/Slit.cc b/src/Slit.cc
index 57de638..d03f61b 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -1064,6 +1064,13 @@ void Slit::toggleHidden() {
1064 } 1064 }
1065} 1065}
1066 1066
1067void Slit::toggleAboveDock() {
1068 if (m_layeritem->getLayerNum() == m_rc_layernum->getNum())
1069 m_layeritem->moveToLayer(ResourceLayer::ABOVE_DOCK);
1070 else
1071 m_layeritem->moveToLayer(m_rc_layernum->getNum());
1072}
1073
1067void Slit::loadClientList(const char *filename) { 1074void Slit::loadClientList(const char *filename) {
1068 if (filename == 0 || filename[0] == '\0') 1075 if (filename == 0 || filename[0] == '\0')
1069 return; 1076 return;
diff --git a/src/Slit.hh b/src/Slit.hh
index 7d643d6..cffc087 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -103,6 +103,7 @@ public:
103 103
104 void moveToLayer(int layernum); 104 void moveToLayer(int layernum);
105 void toggleHidden(); 105 void toggleHidden();
106 void toggleAboveDock();
106 107
107 BScreen &screen() { return m_screen; } 108 BScreen &screen() { return m_screen; }
108 const BScreen &screen() const { return m_screen; } 109 const BScreen &screen() const { return m_screen; }
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 1bd3fb5..cb52066 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -719,6 +719,13 @@ void Toolbar::toggleHidden() {
719 719
720} 720}
721 721
722void Toolbar::toggleAboveDock() {
723 if (m_layeritem.getLayerNum() == m_rc_layernum->getNum())
724 m_layeritem.moveToLayer(ResourceLayer::ABOVE_DOCK);
725 else
726 m_layeritem.moveToLayer(m_rc_layernum->getNum());
727}
728
722void Toolbar::moveToLayer(int layernum) { 729void Toolbar::moveToLayer(int layernum) {
723 m_layeritem.moveToLayer(layernum); 730 m_layeritem.moveToLayer(layernum);
724 *m_rc_layernum = layernum; 731 *m_rc_layernum = layernum;
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index 9f737b4..a1631bd 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -83,6 +83,7 @@ public:
83 void updateVisibleState(); 83 void updateVisibleState();
84 void toggleHidden(); 84 void toggleHidden();
85 85
86 void toggleAboveDock();
86 87
87 void moveToLayer(int layernum); 88 void moveToLayer(int layernum);
88 89
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 4598568..c2a2f8d 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -26,6 +26,8 @@
26#include "Workspace.hh" 26#include "Workspace.hh"
27#include "Window.hh" 27#include "Window.hh"
28#include "Screen.hh" 28#include "Screen.hh"
29#include "Slit.hh"
30#include "Toolbar.hh"
29#include "fluxbox.hh" 31#include "fluxbox.hh"
30#include "WinClient.hh" 32#include "WinClient.hh"
31#include "FocusControl.hh" 33#include "FocusControl.hh"
@@ -622,6 +624,26 @@ void ShowDesktopCmd::execute() {
622 624
623} 625}
624 626
627REGISTER_COMMAND(toggleslitbarabove, ToggleSlitAboveCmd, void);
628void ToggleSlitAboveCmd::execute() {
629#if USE_SLIT
630 if (BScreen *screen = Fluxbox::instance()->mouseScreen()) {
631 screen->slit()->toggleAboveDock();
632 const_cast<FbTk::FbWindow&>(screen->slit()->window()).raise();
633 }
634#endif
635}
636
637REGISTER_COMMAND(toggletoolbarabove, ToggleToolbarAboveCmd, void);
638void ToggleToolbarAboveCmd::execute() {
639#if USE_TOOLBAR
640 if (BScreen *screen = Fluxbox::instance()->mouseScreen()) {
641 screen->toolbar()->toggleAboveDock();
642 const_cast<FbTk::FbWindow&>(screen->toolbar()->window()).raise();
643 }
644#endif
645}
646
625REGISTER_COMMAND(closeallwindows, CloseAllWindowsCmd, void); 647REGISTER_COMMAND(closeallwindows, CloseAllWindowsCmd, void);
626 648
627void CloseAllWindowsCmd::execute() { 649void CloseAllWindowsCmd::execute() {
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh
index f4609b6..1766b3a 100644
--- a/src/WorkspaceCmd.hh
+++ b/src/WorkspaceCmd.hh
@@ -192,6 +192,16 @@ public:
192 void execute(); 192 void execute();
193}; 193};
194 194
195class ToggleSlitAboveCmd: public FbTk::Command<void> {
196public:
197 void execute();
198};
199
200class ToggleToolbarAboveCmd: public FbTk::Command<void> {
201public:
202 void execute();
203};
204
195class CloseAllWindowsCmd: public FbTk::Command<void> { 205class CloseAllWindowsCmd: public FbTk::Command<void> {
196public: 206public:
197 void execute(); 207 void execute();