diff options
Diffstat (limited to 'src/BoolMenuItem.hh')
-rw-r--r-- | src/BoolMenuItem.hh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/BoolMenuItem.hh b/src/BoolMenuItem.hh index c7e3d6c..03f6fb3 100644 --- a/src/BoolMenuItem.hh +++ b/src/BoolMenuItem.hh | |||
@@ -65,15 +65,20 @@ public: | |||
65 | FbTk::MenuItem(label, cmd), m_res(res) { | 65 | FbTk::MenuItem(label, cmd), m_res(res) { |
66 | FbTk::MenuItem::setSelected(*m_res); | 66 | FbTk::MenuItem::setSelected(*m_res); |
67 | setToggleItem(true); | 67 | setToggleItem(true); |
68 | setCloseOnClick(false); | ||
68 | } | 69 | } |
69 | BoolResMenuItem(const FbTk::FbString &label, Type &res): | 70 | BoolResMenuItem(const FbTk::FbString &label, Type &res): |
70 | FbTk::MenuItem(label), m_res(res) { | 71 | FbTk::MenuItem(label), m_res(res) { |
71 | FbTk::MenuItem::setSelected(*m_res); | 72 | FbTk::MenuItem::setSelected(*m_res); |
72 | setToggleItem(true); | 73 | setToggleItem(true); |
74 | setCloseOnClick(false); | ||
73 | } | 75 | } |
74 | bool isSelected() const { return *m_res; } | 76 | bool isSelected() const { return *m_res; } |
75 | // toggle state | 77 | // toggle state |
76 | void click(int button, int time) { setSelected(!*m_res); FbTk::MenuItem::click(button, time); } | 78 | void click(int button, int time, unsigned int mods) { |
79 | setSelected(!*m_res); | ||
80 | FbTk::MenuItem::click(button, time, mods); | ||
81 | } | ||
77 | void setSelected(bool value) { | 82 | void setSelected(bool value) { |
78 | m_res = value; | 83 | m_res = value; |
79 | FbTk::MenuItem::setSelected(*m_res); | 84 | FbTk::MenuItem::setSelected(*m_res); |