diff options
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r-- | src/IconButton.cc | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc index 8830b93..5cb47d1 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc | |||
@@ -115,22 +115,7 @@ void IconButton::setPixmap(bool use) { | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | void IconButton::updateBackground() { | 118 | void IconButton::reconfigTheme() { |
119 | // TODO: this ignores attention state, which isn't in Focusable.hh yet | ||
120 | if (m_win.isFocused()) { | ||
121 | if (m_focused_pm != 0) | ||
122 | setBackgroundPixmap(m_focused_pm); | ||
123 | else | ||
124 | setBackgroundColor(m_theme.focusedTexture().color()); | ||
125 | } else { | ||
126 | if (m_unfocused_pm != 0) | ||
127 | setBackgroundPixmap(m_unfocused_pm); | ||
128 | else | ||
129 | setBackgroundColor(m_theme.unfocusedTexture().color()); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | void IconButton::renderTextures() { | ||
134 | 119 | ||
135 | if (m_theme.focusedTexture().usePixmap()) | 120 | if (m_theme.focusedTexture().usePixmap()) |
136 | m_focused_pm.reset(m_win.screen().imageControl().renderImage( | 121 | m_focused_pm.reset(m_win.screen().imageControl().renderImage( |
@@ -146,6 +131,35 @@ void IconButton::renderTextures() { | |||
146 | else | 131 | else |
147 | m_unfocused_pm.reset( 0 ); | 132 | m_unfocused_pm.reset( 0 ); |
148 | 133 | ||
134 | setAlpha(parent()->alpha()); | ||
135 | |||
136 | // TODO: this ignores attention state, which isn't in Focusable.hh yet | ||
137 | if (m_win.isFocused()) { | ||
138 | if (m_focused_pm != 0) | ||
139 | setBackgroundPixmap(m_focused_pm); | ||
140 | else | ||
141 | setBackgroundColor(m_theme.focusedTexture().color()); | ||
142 | |||
143 | setGC(m_theme.focusedText().textGC()); | ||
144 | setFont(m_theme.focusedText().font()); | ||
145 | setJustify(m_theme.focusedText().justify()); | ||
146 | setBorderWidth(m_theme.focusedBorder().width()); | ||
147 | setBorderColor(m_theme.focusedBorder().color()); | ||
148 | |||
149 | } else { | ||
150 | if (m_unfocused_pm != 0) | ||
151 | setBackgroundPixmap(m_unfocused_pm); | ||
152 | else | ||
153 | setBackgroundColor(m_theme.unfocusedTexture().color()); | ||
154 | |||
155 | setGC(m_theme.unfocusedText().textGC()); | ||
156 | setFont(m_theme.unfocusedText().font()); | ||
157 | setJustify(m_theme.unfocusedText().justify()); | ||
158 | setBorderWidth(m_theme.unfocusedBorder().width()); | ||
159 | setBorderColor(m_theme.unfocusedBorder().color()); | ||
160 | |||
161 | } | ||
162 | |||
149 | } | 163 | } |
150 | 164 | ||
151 | void IconButton::update(FbTk::Subject *subj) { | 165 | void IconButton::update(FbTk::Subject *subj) { |