aboutsummaryrefslogtreecommitdiff
path: root/src/Xinerama.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xinerama.hh')
-rw-r--r--src/Xinerama.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Xinerama.hh b/src/Xinerama.hh
index eab2e37..876005f 100644
--- a/src/Xinerama.hh
+++ b/src/Xinerama.hh
@@ -29,7 +29,7 @@
29 29
30#include "FbTk/RefCount.hh" 30#include "FbTk/RefCount.hh"
31#include "FbTk/SimpleCommand.hh" 31#include "FbTk/SimpleCommand.hh"
32#include "FbTk/MenuItem.hh" 32#include "FbTk/RadioMenuItem.hh"
33 33
34// provides a generic way for giving an object a xinerama head menu 34// provides a generic way for giving an object a xinerama head menu
35// The object must have two functions: 35// The object must have two functions:
@@ -38,18 +38,18 @@
38 38
39/// this class holds the xinerama items 39/// this class holds the xinerama items
40template <typename ItemType> 40template <typename ItemType>
41class XineramaHeadMenuItem : public FbTk::MenuItem { 41class XineramaHeadMenuItem : public FbTk::RadioMenuItem {
42public: 42public:
43 XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum, 43 XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum,
44 FbTk::RefCount<FbTk::Command<void> > &cmd): 44 FbTk::RefCount<FbTk::Command<void> > &cmd):
45 FbTk::MenuItem(label,cmd), m_object(object), m_headnum(headnum) {} 45 FbTk::RadioMenuItem(label,cmd), m_object(object), m_headnum(headnum) {}
46 XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum): 46 XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum):
47 FbTk::MenuItem(label), m_object(object), m_headnum(headnum) {} 47 FbTk::RadioMenuItem(label), m_object(object), m_headnum(headnum) {}
48 48
49 bool isEnabled() const { return m_object.getOnHead() != m_headnum; } 49 bool isSelected() const { return m_object.getOnHead() == m_headnum; }
50 void click(int button, int time, unsigned int mods) { 50 void click(int button, int time, unsigned int mods) {
51 m_object.saveOnHead(m_headnum); 51 m_object.saveOnHead(m_headnum);
52 FbTk::MenuItem::click(button, time, mods); 52 FbTk::RadioMenuItem::click(button, time, mods);
53 } 53 }
54 54
55private: 55private: