aboutsummaryrefslogtreecommitdiff
path: root/src/FocusModelMenuItem.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
commite169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch)
treeae9e92c7e885791c7f47645184070cbcd441ab94 /src/FocusModelMenuItem.hh
parentc82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff)
parent91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff)
downloadfluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip
fluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2
Merge branch 'master' into to_push
Diffstat (limited to 'src/FocusModelMenuItem.hh')
-rw-r--r--src/FocusModelMenuItem.hh18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/FocusModelMenuItem.hh b/src/FocusModelMenuItem.hh
index d75e8a0..7541659 100644
--- a/src/FocusModelMenuItem.hh
+++ b/src/FocusModelMenuItem.hh
@@ -24,7 +24,7 @@
24#define FOCUSMODELMENUITEM_HH 24#define FOCUSMODELMENUITEM_HH
25 25
26 26
27#include "FbTk/MenuItem.hh" 27#include "FbTk/RadioMenuItem.hh"
28#include "FbTk/RefCount.hh" 28#include "FbTk/RefCount.hh"
29 29
30namespace FbTk { 30namespace FbTk {
@@ -33,22 +33,22 @@ template <class T> class Command;
33 33
34#include "FocusControl.hh" 34#include "FocusControl.hh"
35 35
36class FocusModelMenuItem : public FbTk::MenuItem { 36class FocusModelMenuItem : public FbTk::RadioMenuItem {
37public: 37public:
38 FocusModelMenuItem(const FbTk::FbString &label, FocusControl &focus_control, 38 FocusModelMenuItem(const FbTk::FbString &label, FocusControl &focus_control,
39 FocusControl::FocusModel model, 39 FocusControl::FocusModel model,
40 FbTk::RefCount<FbTk::Command<void> > &cmd): 40 FbTk::RefCount<FbTk::Command<void> > &cmd):
41 FbTk::MenuItem(label, cmd), 41 FbTk::RadioMenuItem(label, cmd),
42 m_focus_control(focus_control), 42 m_focus_control(focus_control),
43 m_focusmodel(model) { 43 m_focusmodel(model) {
44 setCloseOnClick(false); 44 setCloseOnClick(false);
45 } 45 }
46 46
47 bool isEnabled() const { return m_focus_control.focusModel() != m_focusmodel; } 47 bool isSelected() const { return m_focus_control.focusModel() == m_focusmodel; }
48 48
49 void click(int button, int time, unsigned int mods) { 49 void click(int button, int time, unsigned int mods) {
50 m_focus_control.setFocusModel(m_focusmodel); 50 m_focus_control.setFocusModel(m_focusmodel);
51 FbTk::MenuItem::click(button, time, mods); 51 FbTk::RadioMenuItem::click(button, time, mods);
52 } 52 }
53 53
54private: 54private:
@@ -56,23 +56,23 @@ private:
56 FocusControl::FocusModel m_focusmodel; 56 FocusControl::FocusModel m_focusmodel;
57}; 57};
58 58
59class TabFocusModelMenuItem : public FbTk::MenuItem { 59class TabFocusModelMenuItem : public FbTk::RadioMenuItem {
60public: 60public:
61 TabFocusModelMenuItem(const FbTk::FbString &label, 61 TabFocusModelMenuItem(const FbTk::FbString &label,
62 FocusControl &focus_control, 62 FocusControl &focus_control,
63 FocusControl::TabFocusModel model, 63 FocusControl::TabFocusModel model,
64 FbTk::RefCount<FbTk::Command<void> > &cmd): 64 FbTk::RefCount<FbTk::Command<void> > &cmd):
65 FbTk::MenuItem(label, cmd), 65 FbTk::RadioMenuItem(label, cmd),
66 m_focus_control(focus_control), 66 m_focus_control(focus_control),
67 m_tabfocusmodel(model) { 67 m_tabfocusmodel(model) {
68 setCloseOnClick(false); 68 setCloseOnClick(false);
69 } 69 }
70 70
71 bool isEnabled() const { return m_focus_control.tabFocusModel() != m_tabfocusmodel; } 71 bool isSelected() const { return m_focus_control.tabFocusModel() == m_tabfocusmodel; }
72 72
73 void click(int button, int time, unsigned int mods) { 73 void click(int button, int time, unsigned int mods) {
74 m_focus_control.setTabFocusModel(m_tabfocusmodel); 74 m_focus_control.setTabFocusModel(m_tabfocusmodel);
75 FbTk::MenuItem::click(button, time, mods); 75 FbTk::RadioMenuItem::click(button, time, mods);
76 } 76 }
77 77
78private: 78private: