diff options
Diffstat (limited to 'src/Slit.cc')
-rw-r--r-- | src/Slit.cc | 16 |
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 | } |
205 | private: | 206 | private: |
@@ -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 { | |||
245 | public: | 247 | public: |
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 | } |
255 | private: | 257 | private: |
256 | Slit &m_slit; | 258 | Slit &m_slit; |