aboutsummaryrefslogtreecommitdiff
path: root/src/ClockTool.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-12 14:56:20 (GMT)
committerrathnor <rathnor>2004-09-12 14:56:20 (GMT)
commit42c1fd3ae3dd058e146b7350c65b74386123c25c (patch)
treecc549c2c7b12c87f8c33198f5b30f00d9dd30bc6 /src/ClockTool.cc
parentc39234195a46cece2bdb18dfdde6c91c7a190dc4 (diff)
downloadfluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.zip
fluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.tar.bz2
preliminary support for composite/compositing manager. Also general work
for consistency with transparency resources
Diffstat (limited to 'src/ClockTool.cc')
-rw-r--r--src/ClockTool.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index dbc128f..f428fae 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ClockTool.cc,v 1.14 2004/08/31 15:26:38 rathnor Exp $ 23// $Id: ClockTool.cc,v 1.15 2004/09/12 14:56:18 rathnor Exp $
24 24
25#include "ClockTool.hh" 25#include "ClockTool.hh"
26 26
@@ -178,13 +178,15 @@ void ClockTool::move(int x, int y) {
178 178
179void ClockTool::resize(unsigned int width, unsigned int height) { 179void ClockTool::resize(unsigned int width, unsigned int height) {
180 m_button.resize(width, height); 180 m_button.resize(width, height);
181 renderTheme(); 181 reRender();
182 m_button.clear();
182} 183}
183 184
184void ClockTool::moveResize(int x, int y, 185void ClockTool::moveResize(int x, int y,
185 unsigned int width, unsigned int height) { 186 unsigned int width, unsigned int height) {
186 m_button.moveResize(x, y, width, height); 187 m_button.moveResize(x, y, width, height);
187 renderTheme(); 188 reRender();
189 m_button.clear();
188} 190}
189 191
190void ClockTool::show() { 192void ClockTool::show() {
@@ -255,22 +257,29 @@ void ClockTool::updateSizing() {
255 m_button.setBorderWidth(m_theme.border().width()); 257 m_button.setBorderWidth(m_theme.border().width());
256} 258}
257 259
258void ClockTool::renderTheme() { 260void ClockTool::reRender() {
259 Pixmap old_pm = m_pixmap; 261 if (m_theme.texture().usePixmap()) {
262 if (m_pixmap)
263 m_screen.imageControl().removeImage(m_pixmap);
264 m_pixmap = m_screen.imageControl().renderImage(width(), height(),
265 m_theme.texture());
266 m_button.setBackgroundPixmap(m_pixmap);
267 }
268}
269
270void ClockTool::renderTheme(unsigned char alpha) {
260 if (!m_theme.texture().usePixmap()) { 271 if (!m_theme.texture().usePixmap()) {
272 if (m_pixmap)
273 m_screen.imageControl().removeImage(m_pixmap);
261 m_pixmap = 0; 274 m_pixmap = 0;
262 m_button.setBackgroundColor(m_theme.texture().color()); 275 m_button.setBackgroundColor(m_theme.texture().color());
263 } else { 276 } else {
264 m_pixmap = m_screen.imageControl().renderImage(m_button.width(), m_button.height(), m_theme.texture()); 277 reRender();
265 m_button.setBackgroundPixmap(m_pixmap);
266 } 278 }
267 279
268 if (old_pm)
269 m_screen.imageControl().removeImage(old_pm);
270
271 m_button.setJustify(m_theme.justify()); 280 m_button.setJustify(m_theme.justify());
272 m_button.setBorderWidth(m_theme.border().width()); 281 m_button.setBorderWidth(m_theme.border().width());
273 m_button.setBorderColor(m_theme.border().color()); 282 m_button.setBorderColor(m_theme.border().color());
274 m_button.setAlpha(m_theme.alpha()); 283 m_button.setAlpha(alpha);
275 m_button.clear(); 284 m_button.clear();
276} 285}