aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-01-10 21:53:37 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-01-10 21:53:37 (GMT)
commitc47280236f2e6d3cb9aa267184a4081ec4e844c6 (patch)
treed6ada1fe92137b0f02ee212bc0b348aca5e46118
parent09da97e6f369471b94d58fea63e112cce22a7060 (diff)
downloadfluxbox-c47280236f2e6d3cb9aa267184a4081ec4e844c6.zip
fluxbox-c47280236f2e6d3cb9aa267184a4081ec4e844c6.tar.bz2
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.
-rw-r--r--src/IconButton.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index f7b4f5f..f1dd1f0 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -142,28 +142,24 @@ void IconButton::setPixmap(bool use) {
142 142
143void IconButton::reconfigTheme() { 143void IconButton::reconfigTheme() {
144 144
145 if (m_theme->texture().usePixmap()) 145 setFont(m_theme->text().font());
146 setGC(m_theme->text().textGC());
147 setBorderWidth(m_theme->border().width());
148 setBorderColor(m_theme->border().color());
149 setJustify(m_theme->text().justify());
150 setAlpha(parent()->alpha());
151
152 if (m_theme->texture().usePixmap()) {
146 m_pm.reset(m_win.screen().imageControl().renderImage( 153 m_pm.reset(m_win.screen().imageControl().renderImage(
147 width(), height(), m_theme->texture(), 154 width(), height(), m_theme->texture(),
148 orientation())); 155 orientation()));
149 else
150 m_pm.reset(0);
151
152 setAlpha(parent()->alpha());
153
154 if (m_pm != 0)
155 setBackgroundPixmap(m_pm); 156 setBackgroundPixmap(m_pm);
156 else 157 } else{
158 m_pm.reset(0);
157 setBackgroundColor(m_theme->texture().color()); 159 setBackgroundColor(m_theme->texture().color());
158 160 }
159 setGC(m_theme->text().textGC());
160 setFont(m_theme->text().font());
161 setJustify(m_theme->text().justify());
162 setBorderWidth(m_theme->border().width());
163 setBorderColor(m_theme->border().color());
164 161
165 updateBackground(false); 162 updateBackground(false);
166
167} 163}
168 164
169void IconButton::reconfigAndClear() { 165void IconButton::reconfigAndClear() {