all repos — fluxbox @ 9ff23f01ca0a0a6c83a3a5e5d933fffbb59dfab8

custom fork of the fluxbox windowmanager

fix some rotation issues
simonb simonb
commit

9ff23f01ca0a0a6c83a3a5e5d933fffbb59dfab8

parent

c5b67f9a42731e5841bfd40e41268ed308225b30

4 files changed, 25 insertions(+), 38 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.16: *06/04/17: + * Fix some rotated toolbar+textbutton issues (Simon) + Toolbar.cc IconbarTool.cc FbTk/TextButton.cc * Fix /bin/sh portability for fbsetbg and startfluxbox (Simon) (fluxbox-generate_menu is seriously broken wrt portability atm though :-/)
M src/FbTk/TextButton.ccsrc/FbTk/TextButton.cc

@@ -76,6 +76,8 @@ resize(height(), width());

} else { m_orientation = orient; } + updateBackground(false); + clear(); return true; }
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -701,12 +701,16 @@

Pixmap tmp = m_focused_pm; Pixmap err_tmp = m_focused_err_pm; unsigned int icon_width, icon_height; + unsigned int icon_width_off=0, icon_height_off=0; + if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) { icon_width = m_icon_container.maxWidthPerClient(); icon_height = m_icon_container.height(); + icon_width_off = 1; } else { icon_width = m_icon_container.width(); icon_height = m_icon_container.maxWidthPerClient(); + icon_height_off = 1; } if (!m_theme.focusedTexture().usePixmap()) {

@@ -716,8 +720,8 @@ } else {

m_focused_pm = m_screen.imageControl().renderImage(icon_width, icon_height, m_theme.focusedTexture(), orientation()); - m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1, - icon_height, + m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+icon_width_off, + icon_height+icon_height_off, m_theme.focusedTexture(), orientation()); }

@@ -736,8 +740,8 @@ } else {

m_unfocused_pm = m_screen.imageControl().renderImage(icon_width, icon_height, m_theme.unfocusedTexture(), orientation()); - m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+1, - icon_height, + m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+icon_width_off, + icon_height+icon_height_off, m_theme.unfocusedTexture(), orientation()); } if (tmp)

@@ -780,9 +784,15 @@ button.setAlpha(m_alpha);

// The last button is always the regular width bool wider_button = false; - if (!m_icon_container.empty()) - wider_button = (button.width() != m_icon_container.back()->width() || // height to cover both orients - button.height() != m_icon_container.back()->height()); + if (!m_icon_container.empty()) { + if (button.orientation() == FbTk::ROT0 || button.orientation() == FbTk::ROT180) + wider_button = button.width() != m_icon_container.back()->width(); + else + wider_button = button.height() != m_icon_container.back()->height(); +// wider_button = (button.width() != m_icon_container.maxWidthPerClient() || // height to cover both orients + +// button.height() != m_icon_container.back()->height()); + } if (button.win().isFocused()) { // focused texture m_icon_container.setSelected(m_icon_container.find(&button));
M src/Toolbar.ccsrc/Toolbar.cc

@@ -609,21 +609,6 @@

void Toolbar::setPlacement(Toolbar::Placement where) { // disable vertical toolbar -/* - switch (where) { - case LEFTTOP: - case LEFTCENTER: - case LEFTBOTTOM: - case RIGHTTOP: - case RIGHTCENTER: - case RIGHTBOTTOM: - where = BOTTOMCENTER; - break; - default: - break; - } -*/ - *m_rc_placement = where; int head_x = 0, head_y = 0,

@@ -637,10 +622,6 @@ head_y = screen().getHeadY(head);

head_w = screen().getHeadWidth(head); head_h = screen().getHeadHeight(head); } - - FbTk::Orientation was_orient = FbTk::ROT0; - if (!m_item_list.empty()) - was_orient = m_item_list.front()->orientation(); // all save orient (for rendering) int bevel_width = theme().bevelWidth(); int border_width = theme().border().width();

@@ -784,18 +765,10 @@ m_shape->setPlaces(Shape::TOPLEFT | Shape::BOTTOMLEFT);

break; } - if (was_orient != orient) { - // hide for all this moving around - if (*m_rc_visible) - frame.window.hide(); - ItemList::iterator item_it = m_item_list.begin(); - ItemList::iterator item_it_end = m_item_list.end(); - for (; item_it != item_it_end; ++item_it) { - (*item_it)->setOrientation(orient); - } - if (*m_rc_visible) - frame.window.show(); - } + ItemList::iterator item_it = m_item_list.begin(); + ItemList::iterator item_it_end = m_item_list.end(); + for (; item_it != item_it_end; ++item_it) + (*item_it)->setOrientation(orient); } void Toolbar::updateVisibleState() {