all repos — fluxbox @ 063468ea6603aaf866e5d52d4f06bfb0714f1b2f

custom fork of the fluxbox windowmanager

size of relative items in toolbar wasn't being calculated properly
markt markt
commit

063468ea6603aaf866e5d52d4f06bfb0714f1b2f

parent

b3f7488a8deb5b51cdbbc3673eb26b1611ef5110

2 files changed, 12 insertions(+), 15 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/03/19: + * Fixed some problems with toolbar sizing (Mark + thanks Julien Trolet) + Toolbar.cc *07/03/18: * Changed position remembering so it only remembers position relative to the current head (Mark)
M src/Toolbar.ccsrc/Toolbar.cc

@@ -976,7 +976,6 @@ ItemList::iterator item_it = m_item_list.begin();

ItemList::iterator item_it_end = m_item_list.end(); int bevel_width = theme().bevelWidth(); int fixed_width = bevel_width; // combined size of all fixed items - int fixed_items = 0; // number of fixed items int relative_items = 0; int last_bw = 0; // we show the largest border of adjoining items bool first = true;

@@ -1013,28 +1012,23 @@ FbTk::translateSize(orient, tmpw, tmph);

if ((*item_it)->type() == ToolbarItem::FIXED) { fixed_width += tmpw; - fixed_items++; } else if ((*item_it)->type() == ToolbarItem::SQUARE) { - fixed_width += tmph; - //if (bevel_width != 0) fixed_width -= 2*borderW; - fixed_items++; + fixed_width += height; + if (bevel_width) + fixed_width -= 2*(borderW + bevel_width); } else { relative_items++; } } - // calculate what's going to be le ft over to the relative sized items + // calculate what's going to be left over to the relative sized items int relative_width = 0; int rounding_error = 0; - if (fixed_items == 0) // no fixed items, then the rest is the entire width - relative_width = width; - else { - if (relative_items == 0) - relative_width = 0; - else { // size left after fixed items / number of relative items - relative_width = (width - fixed_width)/relative_items; - rounding_error = width - fixed_width - relative_items*(relative_width); - } + if (relative_items == 0) + relative_width = 0; + else { // size left after fixed items / number of relative items + relative_width = (width - fixed_width) / relative_items; + rounding_error = width - fixed_width - relative_items * relative_width; } // now move and resize the items