aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-18 05:44:17 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-18 05:44:17 (GMT)
commitc01bd6e9fd98dd0f70ffc1d01df86e73719cd5e0 (patch)
tree7e25c017727402a33fd8e4c851b5bab9e6add568 /src/Slit.cc
parent31df2d8bd618cae590d9b0e76aee11021d4c77d3 (diff)
downloadfluxbox-c01bd6e9fd98dd0f70ffc1d01df86e73719cd5e0.zip
fluxbox-c01bd6e9fd98dd0f70ffc1d01df86e73719cd5e0.tar.bz2
holding control will now keep the menu open
Diffstat (limited to 'src/Slit.cc')
-rw-r--r--src/Slit.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index b18dddc..0b952c5 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -184,6 +184,7 @@ public:
184 setCommand(cmd); 184 setCommand(cmd);
185 FbTk::MenuItem::setSelected(client.visible()); 185 FbTk::MenuItem::setSelected(client.visible());
186 setToggleItem(true); 186 setToggleItem(true);
187 setCloseOnClick(false);
187 } 188 }
188 const string &label() const { 189 const string &label() const {
189 return m_client.matchName(); 190 return m_client.matchName();
@@ -191,7 +192,7 @@ public:
191 bool isSelected() const { 192 bool isSelected() const {
192 return m_client.visible(); 193 return m_client.visible();
193 } 194 }
194 void click(int button, int time) { 195 void click(int button, int time, unsigned int mods) {
195 if (button == 4 || button == 2) { // wheel up 196 if (button == 4 || button == 2) { // wheel up
196 m_slit.clientUp(&m_client); 197 m_slit.clientUp(&m_client);
197 } else if (button == 5 || button == 3) { // wheel down 198 } else if (button == 5 || button == 3) { // wheel down
@@ -199,7 +200,7 @@ public:
199 } else { 200 } else {
200 m_client.setVisible(!m_client.visible()); 201 m_client.setVisible(!m_client.visible());
201 FbTk::MenuItem::setSelected(m_client.visible()); 202 FbTk::MenuItem::setSelected(m_client.visible());
202 FbTk::MenuItem::click(button, time); 203 FbTk::MenuItem::click(button, time, mods);
203 } 204 }
204 } 205 }
205private: 206private:
@@ -214,16 +215,17 @@ public:
214 m_slit(slit), 215 m_slit(slit),
215 m_label(label) { 216 m_label(label) {
216 setLabel(m_label); // update label 217 setLabel(m_label); // update label
218 setCloseOnClick(false);
217 } 219 }
218 220
219 void click(int button, int time) { 221 void click(int button, int time, unsigned int mods) {
220 // toggle direction 222 // toggle direction
221 if (m_slit.direction() == Slit::HORIZONTAL) 223 if (m_slit.direction() == Slit::HORIZONTAL)
222 m_slit.setDirection(Slit::VERTICAL); 224 m_slit.setDirection(Slit::VERTICAL);
223 else 225 else
224 m_slit.setDirection(Slit::HORIZONTAL); 226 m_slit.setDirection(Slit::HORIZONTAL);
225 setLabel(m_label); 227 setLabel(m_label);
226 FbTk::MenuItem::click(button, time); 228 FbTk::MenuItem::click(button, time, mods);
227 } 229 }
228 230
229 void setLabel(const FbTk::FbString &label) { 231 void setLabel(const FbTk::FbString &label) {
@@ -245,12 +247,12 @@ class PlaceSlitMenuItem: public FbTk::MenuItem {
245public: 247public:
246 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command> &cmd): 248 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command> &cmd):
247 FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) { 249 FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) {
248 250 setCloseOnClick(false);
249 } 251 }
250 bool isEnabled() const { return m_slit.placement() != m_place; } 252 bool isEnabled() const { return m_slit.placement() != m_place; }
251 void click(int button, int time) { 253 void click(int button, int time, unsigned int mods) {
252 m_slit.setPlacement(m_place); 254 m_slit.setPlacement(m_place);
253 FbTk::MenuItem::click(button, time); 255 FbTk::MenuItem::click(button, time, mods);
254 } 256 }
255private: 257private:
256 Slit &m_slit; 258 Slit &m_slit;