aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index b6e2900..f2ed082 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -39,7 +39,7 @@
39#include "FbTk/STLUtil.hh" 39#include "FbTk/STLUtil.hh"
40#include "FbTk/I18n.hh" 40#include "FbTk/I18n.hh"
41#include "FbTk/Menu.hh" 41#include "FbTk/Menu.hh"
42#include "FbTk/MenuItem.hh" 42#include "FbTk/RadioMenuItem.hh"
43#include "FbTk/BoolMenuItem.hh" 43#include "FbTk/BoolMenuItem.hh"
44#include "FbTk/RefCount.hh" 44#include "FbTk/RefCount.hh"
45#include "FbTk/SimpleCommand.hh" 45#include "FbTk/SimpleCommand.hh"
@@ -99,18 +99,18 @@ void FbTk::Resource<FbTk::Container::Alignment>::setFromString(const char *str)
99 99
100namespace { 100namespace {
101 101
102class ToolbarModeMenuItem : public FbTk::MenuItem { 102class ToolbarModeMenuItem : public FbTk::RadioMenuItem {
103public: 103public:
104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler, 104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler,
105 string mode, 105 string mode,
106 FbTk::RefCount<FbTk::Command<void> > &cmd): 106 FbTk::RefCount<FbTk::Command<void> > &cmd):
107 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 107 FbTk::RadioMenuItem(label, cmd), m_handler(handler), m_mode(mode) {
108 setCloseOnClick(false); 108 setCloseOnClick(false);
109 } 109 }
110 bool isEnabled() const { return m_handler.mode() != m_mode; } 110 bool isSelected() const { return m_handler.mode() == m_mode; }
111 void click(int button, int time, unsigned int mods) { 111 void click(int button, int time, unsigned int mods) {
112 m_handler.setMode(m_mode); 112 m_handler.setMode(m_mode);
113 FbTk::MenuItem::click(button, time, mods); 113 FbTk::RadioMenuItem::click(button, time, mods);
114 } 114 }
115 115
116private: 116private:
@@ -118,18 +118,18 @@ private:
118 string m_mode; 118 string m_mode;
119}; 119};
120 120
121class ToolbarAlignMenuItem: public FbTk::MenuItem { 121class ToolbarAlignMenuItem: public FbTk::RadioMenuItem {
122public: 122public:
123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler, 123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler,
124 FbTk::Container::Alignment mode, 124 FbTk::Container::Alignment mode,
125 FbTk::RefCount<FbTk::Command<void> > &cmd): 125 FbTk::RefCount<FbTk::Command<void> > &cmd):
126 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 126 FbTk::RadioMenuItem(label, cmd), m_handler(handler), m_mode(mode) {
127 setCloseOnClick(false); 127 setCloseOnClick(false);
128 } 128 }
129 bool isEnabled() const { return m_handler.alignment() != m_mode; } 129 bool isSelected() const { return m_handler.alignment() == m_mode; }
130 void click(int button, int time, unsigned int mods) { 130 void click(int button, int time, unsigned int mods) {
131 m_handler.setAlignment(m_mode); 131 m_handler.setAlignment(m_mode);
132 FbTk::MenuItem::click(button, time, mods); 132 FbTk::RadioMenuItem::click(button, time, mods);
133 } 133 }
134 134
135private: 135private: