aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-19 03:59:56 (GMT)
committerrathnor <rathnor>2003-07-19 03:59:56 (GMT)
commita827c24e36aa3cf42566fe44dde5848df7679d14 (patch)
treec92a16e1fa0eab7feb6c5f0caeee5b2e11460443 /src/FbTk/Menu.cc
parent2e3bd41f4e0e5d10c65888b277f944d75938fab8 (diff)
downloadfluxbox-a827c24e36aa3cf42566fe44dde5848df7679d14.zip
fluxbox-a827c24e36aa3cf42566fe44dde5848df7679d14.tar.bz2
fix alpha setting for menus when multiple screens by moving from static in menu
to part of MenuTheme
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index c9943b3..3674ae1 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.28 2003/07/10 11:57:37 fluxgen Exp $ 25// $Id: Menu.cc,v 1.29 2003/07/19 03:59:56 rathnor Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -77,7 +77,6 @@ namespace FbTk {
77 77
78static Menu *shown = 0; 78static Menu *shown = 0;
79 79
80unsigned char Menu::s_alpha = 255;
81Menu *Menu::s_focused = 0; 80Menu *Menu::s_focused = 0;
82 81
83Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): 82Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl):
@@ -92,7 +91,7 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl):
92 m_border_width(0), 91 m_border_width(0),
93 m_themeobserver(*this), 92 m_themeobserver(*this),
94 m_trans(new Transparent(getRootPixmap(screen_num), 0, 93 m_trans(new Transparent(getRootPixmap(screen_num), 0,
95 s_alpha, screen_num)), 94 tm.alpha(), screen_num)),
96 m_need_update(true) { 95 m_need_update(true) {
97 96
98 // make sure we get updated when the theme is reloaded 97 // make sure we get updated when the theme is reloaded
@@ -139,7 +138,7 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl):
139 138
140 m_root_pm = getRootPixmap(screen_num); 139 m_root_pm = getRootPixmap(screen_num);
141 m_trans->setSource(m_root_pm, screen_num); 140 m_trans->setSource(m_root_pm, screen_num);
142 m_trans->setAlpha(s_alpha); 141 m_trans->setAlpha(alpha());
143 142
144 //set attributes for menu window 143 //set attributes for menu window
145 unsigned long attrib_mask = CWOverrideRedirect | CWEventMask; 144 unsigned long attrib_mask = CWOverrideRedirect | CWEventMask;
@@ -952,8 +951,8 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_
952 item_x, item_y, 951 item_x, item_y,
953 menu.item_w, menu.item_h, False); 952 menu.item_w, menu.item_h, False);
954 953
955 if (m_trans->alpha() != s_alpha) 954 if (m_trans->alpha() != alpha())
956 m_trans->setAlpha(s_alpha); 955 m_trans->setAlpha(alpha());
957 if (m_trans.get() && render_trans) { 956 if (m_trans.get() && render_trans) {
958 957
959 if (m_trans->alpha() != 255) { 958 if (m_trans->alpha() != 255) {
@@ -1338,8 +1337,8 @@ void Menu::reconfigure() {
1338 menu.window.setBorderWidth(m_border_width); 1337 menu.window.setBorderWidth(m_border_width);
1339 menu.title.setBorderWidth(m_border_width); 1338 menu.title.setBorderWidth(m_border_width);
1340 1339
1341 if (m_trans.get() && m_trans->alpha() != s_alpha) 1340 if (m_trans.get() && m_trans->alpha() != alpha())
1342 m_trans->setAlpha(s_alpha); 1341 m_trans->setAlpha(alpha());
1343 1342
1344 update(); 1343 update();
1345} 1344}
@@ -1348,8 +1347,8 @@ void Menu::renderTransFrame() {
1348 if (m_trans.get() == 0 || moving) 1347 if (m_trans.get() == 0 || moving)
1349 return; 1348 return;
1350 1349
1351 if (m_trans->alpha() != s_alpha) 1350 if (m_trans->alpha() != alpha())
1352 m_trans->setAlpha(s_alpha); 1351 m_trans->setAlpha(alpha());
1353 1352
1354 if (m_trans->alpha() != 255) { 1353 if (m_trans->alpha() != 255) {
1355 1354