diff options
author | fluxgen <fluxgen> | 2004-02-27 14:22:27 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-02-27 14:22:27 (GMT) |
commit | f8f393c02f5306321b4d0742b1d8ffcee0a1a080 (patch) | |
tree | 323628dbe7df9977c08b79267afe45d2a1d8fd5d /src | |
parent | 214a68012baa13303813561ce7ac3c47aa9f067e (diff) | |
download | fluxbox_lack-f8f393c02f5306321b4d0742b1d8ffcee0a1a080.zip fluxbox_lack-f8f393c02f5306321b4d0742b1d8ffcee0a1a080.tar.bz2 |
fixed some rendering issues
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Menu.cc | 28 | ||||
-rw-r--r-- | src/FbTk/Menu.hh | 10 |
2 files changed, 22 insertions, 16 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 6d43268..de62627 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.55 2004/02/27 11:55:27 fluxgen Exp $ | 25 | // $Id: Menu.cc,v 1.56 2004/02/27 14:21:13 fluxgen Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -736,14 +736,14 @@ bool Menu::hasSubmenu(unsigned int index) const { | |||
736 | } | 736 | } |
737 | 737 | ||
738 | 738 | ||
739 | void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_trans, | 739 | int Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_trans, |
740 | int x, int y, unsigned int w, unsigned int h) { | 740 | int x, int y, unsigned int w, unsigned int h) { |
741 | if (index >= menuitems.size() || menuitems.size() == 0 || | 741 | if (index >= menuitems.size() || menuitems.size() == 0 || |
742 | menu.persub == 0) | 742 | menu.persub == 0) |
743 | return; | 743 | return 0; |
744 | 744 | ||
745 | MenuItem *item = menuitems[index]; | 745 | MenuItem *item = menuitems[index]; |
746 | if (! item) return; | 746 | if (! item) return 0; |
747 | 747 | ||
748 | bool dotext = true, dohilite = true, dosel = true; | 748 | bool dotext = true, dohilite = true, dosel = true; |
749 | const char *text = item->label().c_str(); | 749 | const char *text = item->label().c_str(); |
@@ -990,7 +990,7 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_ | |||
990 | menu.item_w, menu.item_h); | 990 | menu.item_w, menu.item_h); |
991 | } | 991 | } |
992 | 992 | ||
993 | 993 | return item_y; | |
994 | } | 994 | } |
995 | 995 | ||
996 | void Menu::setLabel(const char *labelstr) { | 996 | void Menu::setLabel(const char *labelstr) { |
@@ -1228,6 +1228,7 @@ void Menu::exposeEvent(XExposeEvent &ee) { | |||
1228 | 1228 | ||
1229 | // draw the sublevels and the number of items the exposure spans | 1229 | // draw the sublevels and the number of items the exposure spans |
1230 | unsigned int i, ii; | 1230 | unsigned int i, ii; |
1231 | int max_y = 0; | ||
1231 | for (i = sbl; i <= sbl_d; i++) { | 1232 | for (i = sbl; i <= sbl_d; i++) { |
1232 | // set the iterator to the first item in the sublevel needing redrawing | 1233 | // set the iterator to the first item in the sublevel needing redrawing |
1233 | unsigned int index = id + i * menu.persub; | 1234 | unsigned int index = id + i * menu.persub; |
@@ -1236,15 +1237,20 @@ void Menu::exposeEvent(XExposeEvent &ee) { | |||
1236 | Menuitems::iterator it_end = menuitems.end(); | 1237 | Menuitems::iterator it_end = menuitems.end(); |
1237 | for (ii = id; ii <= id_d && it != it_end; ++it, ii++) { | 1238 | for (ii = id; ii <= id_d && it != it_end; ++it, ii++) { |
1238 | unsigned int index = ii + (i * menu.persub); | 1239 | unsigned int index = ii + (i * menu.persub); |
1239 | drawItem(index, | 1240 | max_y = max(drawItem(index, |
1240 | (which_sub == static_cast<signed>(index)), // highlight | 1241 | (which_sub == static_cast<signed>(index)), // highlight |
1241 | true, // clear | 1242 | true, // clear |
1242 | false, // render trans | 1243 | false, // render trans |
1243 | ee.x, ee.y, ee.width, ee.height); | 1244 | ee.x, ee.y, ee.width, ee.height), max_y); |
1244 | } | 1245 | } |
1245 | } | 1246 | } |
1246 | } | 1247 | } |
1247 | menu.frame.updateTransparent(ee.x, ee.y, ee.width, ee.height); | 1248 | if (menu.persub != 0) { |
1249 | int index_min = id + sbl * menu.persub; | ||
1250 | int min_y = (index_min - (index_min/menu.persub)*menu.persub) * menu.item_h; | ||
1251 | menu.frame.updateTransparent(0, min_y, | ||
1252 | width(), max_y + menu.item_h); | ||
1253 | } | ||
1248 | } | 1254 | } |
1249 | } | 1255 | } |
1250 | 1256 | ||
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 7c8b6ef..1adcfa9 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -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.hh,v 1.29 2003/12/18 18:03:23 fluxgen Exp $ | 25 | // $Id: Menu.hh,v 1.30 2004/02/27 14:22:27 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef FBTK_MENU_HH | 27 | #ifndef FBTK_MENU_HH |
28 | #define FBTK_MENU_HH | 28 | #define FBTK_MENU_HH |
@@ -165,10 +165,10 @@ protected: | |||
165 | inline void setHideTree(bool h) { hide_tree = h; } | 165 | inline void setHideTree(bool h) { hide_tree = h; } |
166 | 166 | ||
167 | virtual void itemSelected(int button, unsigned int index) { } | 167 | virtual void itemSelected(int button, unsigned int index) { } |
168 | virtual void drawItem(unsigned int index, bool highlight = false, | 168 | virtual int drawItem(unsigned int index, bool highlight = false, |
169 | bool clear= false, bool render_trans = true, | 169 | bool clear= false, bool render_trans = true, |
170 | int x= -1, int y= -1, | 170 | int x= -1, int y= -1, |
171 | unsigned int width= 0, unsigned int height= 0); | 171 | unsigned int width= 0, unsigned int height= 0); |
172 | virtual void redrawTitle(); | 172 | virtual void redrawTitle(); |
173 | virtual void internal_hide(); | 173 | virtual void internal_hide(); |
174 | inline Menu *parent() { return m_parent; } | 174 | inline Menu *parent() { return m_parent; } |