aboutsummaryrefslogtreecommitdiff
path: root/src/AlphaMenu.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/AlphaMenu.hh')
-rw-r--r--src/AlphaMenu.hh15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/AlphaMenu.hh b/src/AlphaMenu.hh
index 6323fe1..70f9c50 100644
--- a/src/AlphaMenu.hh
+++ b/src/AlphaMenu.hh
@@ -38,7 +38,7 @@ public:
38 38
39 virtual void setFocusedAlpha(int alpha) = 0; 39 virtual void setFocusedAlpha(int alpha) = 0;
40 virtual void setUnfocusedAlpha(int alpha) = 0; 40 virtual void setUnfocusedAlpha(int alpha) = 0;
41 virtual void setUseDefaultAlpha(bool use_default) = 0; 41 virtual void setDefaultAlpha() = 0;
42 42
43 virtual ~AlphaObject() {}; 43 virtual ~AlphaObject() {};
44}; 44};
@@ -69,22 +69,11 @@ public:
69 69
70 bool isSelected() const { return m_object->getUseDefaultAlpha(); } 70 bool isSelected() const { return m_object->getUseDefaultAlpha(); }
71 void click(int button, int time, unsigned int mods) { 71 void click(int button, int time, unsigned int mods) {
72 bool newval = !m_object->getUseDefaultAlpha(); 72 m_object->setDefaultAlpha();
73 m_object->setUseDefaultAlpha(newval);
74 // items 1 and 2 (the focused/unfocused values) are only enabled if we don't use default values
75 m_parent.setItemEnabled(1, !newval);
76 m_parent.setItemEnabled(2, !newval);
77 m_parent.show(); // cheat to refreshing the window 73 m_parent.show(); // cheat to refreshing the window
78 FbTk::MenuItem::click(button, time, mods); 74 FbTk::MenuItem::click(button, time, mods);
79 } 75 }
80 76
81 void updateLabel() {
82 bool val = m_object->getUseDefaultAlpha();
83 m_parent.setItemEnabled(1, !val);
84 m_parent.setItemEnabled(2, !val);
85 m_parent.updateMenu();
86 }
87
88private: 77private:
89 AlphaObject *m_object; 78 AlphaObject *m_object;
90 AlphaMenu &m_parent; 79 AlphaMenu &m_parent;