aboutsummaryrefslogtreecommitdiff
path: root/src/SystemTray.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-05 01:39:19 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-05 01:39:19 (GMT)
commitac1bd7e0981222bf340ce7defb2bb8307d42a0a2 (patch)
treec8fb9c618184e7ac44f6138409cab3fab86b23e4 /src/SystemTray.cc
parent60ba709c2f47cc2c7b877aef1b0f297b097853e5 (diff)
downloadfluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.zip
fluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.tar.bz2
update code to use ThemeProxy
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r--src/SystemTray.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index 85f0fba..5ba89c3 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.cc
@@ -153,7 +153,8 @@ private:
153 SystemTray &m_tray; 153 SystemTray &m_tray;
154}; 154};
155 155
156SystemTray::SystemTray(const FbTk::FbWindow& parent, ButtonTheme& theme, BScreen& screen): 156SystemTray::SystemTray(const FbTk::FbWindow& parent,
157 FbTk::ThemeProxy<ButtonTheme> &theme, BScreen& screen):
157 ToolbarItem(ToolbarItem::FIXED), 158 ToolbarItem(ToolbarItem::FIXED),
158 m_window(parent, 0, 0, 1, 1, ExposureMask | ButtonPressMask | ButtonReleaseMask | 159 m_window(parent, 0, 0, 1, 1, ExposureMask | ButtonPressMask | ButtonReleaseMask |
159 SubstructureNotifyMask | SubstructureRedirectMask), 160 SubstructureNotifyMask | SubstructureRedirectMask),
@@ -164,7 +165,7 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, ButtonTheme& theme, BScreen
164 165
165 FbTk::EventManager::instance()->add(*this, m_window); 166 FbTk::EventManager::instance()->add(*this, m_window);
166 FbTk::EventManager::instance()->add(*this, m_selection_owner); 167 FbTk::EventManager::instance()->add(*this, m_selection_owner);
167 m_theme.reconfigSig().attach(this); 168 m_theme->reconfigSig().attach(this);
168 screen.bgChangeSig().attach(this); 169 screen.bgChangeSig().attach(this);
169 170
170 Fluxbox* fluxbox = Fluxbox::instance(); 171 Fluxbox* fluxbox = Fluxbox::instance();
@@ -282,14 +283,14 @@ unsigned int SystemTray::width() const {
282 if (orientation() == FbTk::ROT90 || orientation() == FbTk::ROT270) 283 if (orientation() == FbTk::ROT90 || orientation() == FbTk::ROT270)
283 return m_window.width(); 284 return m_window.width();
284 285
285 return m_num_visible_clients * (height() - 2 * m_theme.border().width()); 286 return m_num_visible_clients * (height() - 2 * m_theme->border().width());
286} 287}
287 288
288unsigned int SystemTray::height() const { 289unsigned int SystemTray::height() const {
289 if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) 290 if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180)
290 return m_window.height(); 291 return m_window.height();
291 292
292 return m_num_visible_clients * (width() - 2 * m_theme.border().width()); 293 return m_num_visible_clients * (width() - 2 * m_theme->border().width());
293} 294}
294 295
295unsigned int SystemTray::borderWidth() const { 296unsigned int SystemTray::borderWidth() const {
@@ -463,7 +464,7 @@ void SystemTray::handleEvent(XEvent &event) {
463 464
464void SystemTray::rearrangeClients() { 465void SystemTray::rearrangeClients() {
465 unsigned int w_rot0 = width(), h_rot0 = height(); 466 unsigned int w_rot0 = width(), h_rot0 = height();
466 const unsigned int bw = m_theme.border().width(); 467 const unsigned int bw = m_theme->border().width();
467 FbTk::translateSize(orientation(), w_rot0, h_rot0); 468 FbTk::translateSize(orientation(), w_rot0, h_rot0);
468 unsigned int trayw = m_num_visible_clients*h_rot0 + bw, trayh = h_rot0; 469 unsigned int trayw = m_num_visible_clients*h_rot0 + bw, trayh = h_rot0;
469 FbTk::translateSize(orientation(), trayw, trayh); 470 FbTk::translateSize(orientation(), trayw, trayh);
@@ -529,14 +530,14 @@ void SystemTray::showClient(TrayWindow *traywin) {
529 530
530void SystemTray::update(FbTk::Subject* subject) { 531void SystemTray::update(FbTk::Subject* subject) {
531 532
532 if (!m_theme.texture().usePixmap()) { 533 if (!m_theme->texture().usePixmap()) {
533 m_window.setBackgroundColor(m_theme.texture().color()); 534 m_window.setBackgroundColor(m_theme->texture().color());
534 } 535 }
535 else { 536 else {
536 if(m_pixmap) 537 if(m_pixmap)
537 m_screen.imageControl().removeImage(m_pixmap); 538 m_screen.imageControl().removeImage(m_pixmap);
538 m_pixmap = m_screen.imageControl().renderImage(width(), height(), 539 m_pixmap = m_screen.imageControl().renderImage(width(), height(),
539 m_theme.texture(), orientation()); 540 m_theme->texture(), orientation());
540 m_window.setBackgroundPixmap(m_pixmap); 541 m_window.setBackgroundPixmap(m_pixmap);
541 } 542 }
542 543