aboutsummaryrefslogtreecommitdiff
path: root/src/AlphaMenu.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-02-22 21:17:11 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-02-22 21:17:11 (GMT)
commit4f921f77f459a983a75edb8bd3fb7b0bb2015298 (patch)
treeabac675a3c5d91a303009e7abe738a3c03c70648 /src/AlphaMenu.cc
parentd11aa42ace928efc3dd1eebc8988b6bbbc005b2b (diff)
downloadfluxbox_pavel-4f921f77f459a983a75edb8bd3fb7b0bb2015298.zip
fluxbox_pavel-4f921f77f459a983a75edb8bd3fb7b0bb2015298.tar.bz2
don't use hardcoded references to positions in the menu
Diffstat (limited to 'src/AlphaMenu.cc')
-rw-r--r--src/AlphaMenu.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/AlphaMenu.cc b/src/AlphaMenu.cc
index 03aca47..f15c9d1 100644
--- a/src/AlphaMenu.cc
+++ b/src/AlphaMenu.cc
@@ -51,18 +51,18 @@ AlphaMenu::AlphaMenu(FbTk::ThemeProxy<FbTk::MenuTheme> &tm,
51 "Focused Window Alpha", 51 "Focused Window Alpha",
52 "Transparency level of the focused window"); 52 "Transparency level of the focused window");
53 53
54 FbTk::MenuItem *focused_alpha_item = 54 m_focused_alpha_item =
55 new FbTk::IntMenuItem(focused_alpha_label, m_focused_alpha, 0, 255, *this); 55 new FbTk::IntMenuItem(focused_alpha_label, m_focused_alpha, 0, 255, *this);
56 insert(focused_alpha_item); 56 insert(m_focused_alpha_item);
57 57
58 const FbTk::FbString unfocused_alpha_label = 58 const FbTk::FbString unfocused_alpha_label =
59 _FB_XTEXT(Configmenu, UnfocusedAlpha, 59 _FB_XTEXT(Configmenu, UnfocusedAlpha,
60 "Unfocused Window Alpha", 60 "Unfocused Window Alpha",
61 "Transparency level of unfocused windows"); 61 "Transparency level of unfocused windows");
62 62
63 FbTk::MenuItem *unfocused_alpha_item = 63 m_unfocused_alpha_item =
64 new FbTk::IntMenuItem(unfocused_alpha_label, m_unfocused_alpha, 0, 255, *this); 64 new FbTk::IntMenuItem(unfocused_alpha_label, m_unfocused_alpha, 0, 255, *this);
65 insert(unfocused_alpha_item); 65 insert(m_unfocused_alpha_item);
66 66
67 const FbTk::FbString usedefault_label = _FB_XTEXT(Windowmenu, DefaultAlpha, 67 const FbTk::FbString usedefault_label = _FB_XTEXT(Windowmenu, DefaultAlpha,
68 "Use Defaults", 68 "Use Defaults",
@@ -79,18 +79,16 @@ void AlphaMenu::move(int x, int y) {
79 FbTk::Menu::move(x, y); 79 FbTk::Menu::move(x, y);
80 80
81 if (isVisible()) { 81 if (isVisible()) {
82 // TODO: hardcoding the indices is a bad idea 82 m_focused_alpha_item->updateLabel();
83 ((FbTk::IntMenuItem *)find(0))->updateLabel(); 83 m_unfocused_alpha_item->updateLabel();
84 ((FbTk::IntMenuItem *)find(1))->updateLabel();
85 frameWindow().updateBackground(false); 84 frameWindow().updateBackground(false);
86 FbTk::Menu::clearWindow(); 85 FbTk::Menu::clearWindow();
87 } 86 }
88} 87}
89 88
90void AlphaMenu::show() { 89void AlphaMenu::show() {
91 // TODO: hardcoding the indices is a bad idea 90 m_focused_alpha_item->updateLabel();
92 ((FbTk::IntMenuItem *)find(0))->updateLabel(); 91 m_unfocused_alpha_item->updateLabel();
93 ((FbTk::IntMenuItem *)find(1))->updateLabel();
94 frameWindow().updateBackground(false); 92 frameWindow().updateBackground(false);
95 FbTk::Menu::clearWindow(); 93 FbTk::Menu::clearWindow();
96 94