all repos — fluxbox @ c47280236f2e6d3cb9aa267184a4081ec4e844c6

custom fork of the fluxbox windowmanager

Fix order of reconfigure the theme of an IconButton

The font might have an impact to the result of width() and height(). In order
to render the new pixmap correctly fluxbox now first sets the font and the
width of the border and after that it recreates the pixmap.
Mathias Gumz akira@fluxbox.org
commit

c47280236f2e6d3cb9aa267184a4081ec4e844c6

parent

09da97e6f369471b94d58fea63e112cce22a7060

1 files changed, 11 insertions(+), 15 deletions(-)

jump to
M src/IconButton.ccsrc/IconButton.cc

@@ -142,28 +142,24 @@ }

void IconButton::reconfigTheme() { - if (m_theme->texture().usePixmap()) + setFont(m_theme->text().font()); + setGC(m_theme->text().textGC()); + setBorderWidth(m_theme->border().width()); + setBorderColor(m_theme->border().color()); + setJustify(m_theme->text().justify()); + setAlpha(parent()->alpha()); + + if (m_theme->texture().usePixmap()) { m_pm.reset(m_win.screen().imageControl().renderImage( width(), height(), m_theme->texture(), orientation())); - else - m_pm.reset(0); - - setAlpha(parent()->alpha()); - - if (m_pm != 0) setBackgroundPixmap(m_pm); - else + } else{ + m_pm.reset(0); setBackgroundColor(m_theme->texture().color()); - - setGC(m_theme->text().textGC()); - setFont(m_theme->text().font()); - setJustify(m_theme->text().justify()); - setBorderWidth(m_theme->border().width()); - setBorderColor(m_theme->border().color()); + } updateBackground(false); - } void IconButton::reconfigAndClear() {