all repos — fluxbox @ f8f393c02f5306321b4d0742b1d8ffcee0a1a080

custom fork of the fluxbox windowmanager

fixed some rendering issues
fluxgen fluxgen
commit

f8f393c02f5306321b4d0742b1d8ffcee0a1a080

parent

214a68012baa13303813561ce7ac3c47aa9f067e

2 files changed, 22 insertions(+), 16 deletions(-)

jump to
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.55 2004/02/27 11:55:27 fluxgen Exp $ +// $Id: Menu.cc,v 1.56 2004/02/27 14:21:13 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -736,14 +736,14 @@ return true;

} -void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_trans, +int Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_trans, int x, int y, unsigned int w, unsigned int h) { if (index >= menuitems.size() || menuitems.size() == 0 || menu.persub == 0) - return; + return 0; MenuItem *item = menuitems[index]; - if (! item) return; + if (! item) return 0; bool dotext = true, dohilite = true, dosel = true; const char *text = item->label().c_str();

@@ -990,7 +990,7 @@ menu.frame.updateTransparent(item_x, item_y,

menu.item_w, menu.item_h); } - + return item_y; } void Menu::setLabel(const char *labelstr) {

@@ -1228,6 +1228,7 @@ id_d = menu.persub;

// draw the sublevels and the number of items the exposure spans unsigned int i, ii; + int max_y = 0; for (i = sbl; i <= sbl_d; i++) { // set the iterator to the first item in the sublevel needing redrawing unsigned int index = id + i * menu.persub;

@@ -1236,15 +1237,20 @@ Menuitems::iterator it = menuitems.begin() + index;

Menuitems::iterator it_end = menuitems.end(); for (ii = id; ii <= id_d && it != it_end; ++it, ii++) { unsigned int index = ii + (i * menu.persub); - drawItem(index, - (which_sub == static_cast<signed>(index)), // highlight - true, // clear - false, // render trans - ee.x, ee.y, ee.width, ee.height); + max_y = max(drawItem(index, + (which_sub == static_cast<signed>(index)), // highlight + true, // clear + false, // render trans + ee.x, ee.y, ee.width, ee.height), max_y); } } } - menu.frame.updateTransparent(ee.x, ee.y, ee.width, ee.height); + if (menu.persub != 0) { + int index_min = id + sbl * menu.persub; + int min_y = (index_min - (index_min/menu.persub)*menu.persub) * menu.item_h; + menu.frame.updateTransparent(0, min_y, + width(), max_y + menu.item_h); + } } }
M src/FbTk/Menu.hhsrc/FbTk/Menu.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.hh,v 1.29 2003/12/18 18:03:23 fluxgen Exp $ +// $Id: Menu.hh,v 1.30 2004/02/27 14:22:27 fluxgen Exp $ #ifndef FBTK_MENU_HH #define FBTK_MENU_HH

@@ -165,10 +165,10 @@ inline void setMovable(bool b) { movable = b; }

inline void setHideTree(bool h) { hide_tree = h; } virtual void itemSelected(int button, unsigned int index) { } - virtual void drawItem(unsigned int index, bool highlight = false, - bool clear= false, bool render_trans = true, - int x= -1, int y= -1, - unsigned int width= 0, unsigned int height= 0); + virtual int drawItem(unsigned int index, bool highlight = false, + bool clear= false, bool render_trans = true, + int x= -1, int y= -1, + unsigned int width= 0, unsigned int height= 0); virtual void redrawTitle(); virtual void internal_hide(); inline Menu *parent() { return m_parent; }