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
1 files changed,
11 insertions(+),
15 deletions(-)
jump to
M
src/IconButton.cc
→
src/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() {