aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.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/Toolbar.cc
parent60ba709c2f47cc2c7b877aef1b0f297b097853e5 (diff)
downloadfluxbox-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.zip
fluxbox-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.tar.bz2
update code to use ThemeProxy
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 7ade11a..24bc66d 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -328,22 +328,22 @@ void Toolbar::updateStrut() {
328 case TOPLEFT: 328 case TOPLEFT:
329 case TOPCENTER: 329 case TOPCENTER:
330 case TOPRIGHT: 330 case TOPRIGHT:
331 top = height() + 2 * theme().border().width(); 331 top = height() + 2 * theme()->border().width();
332 break; 332 break;
333 case BOTTOMLEFT: 333 case BOTTOMLEFT:
334 case BOTTOMCENTER: 334 case BOTTOMCENTER:
335 case BOTTOMRIGHT: 335 case BOTTOMRIGHT:
336 bottom = height() + 2 * theme().border().width(); 336 bottom = height() + 2 * theme()->border().width();
337 break; 337 break;
338 case RIGHTTOP: 338 case RIGHTTOP:
339 case RIGHTCENTER: 339 case RIGHTCENTER:
340 case RIGHTBOTTOM: 340 case RIGHTBOTTOM:
341 right = width() + 2 * theme().border().width(); 341 right = width() + 2 * theme()->border().width();
342 break; 342 break;
343 case LEFTTOP: 343 case LEFTTOP:
344 case LEFTCENTER: 344 case LEFTCENTER:
345 case LEFTBOTTOM: 345 case LEFTBOTTOM:
346 left = width() + 2 * theme().border().width(); 346 left = width() + 2 * theme()->border().width();
347 break; 347 break;
348 }; 348 };
349 m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom); 349 m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom);
@@ -442,12 +442,12 @@ void Toolbar::reconfigure() {
442 if (doAutoHide()) 442 if (doAutoHide())
443 m_hide_timer.start(); 443 m_hide_timer.start();
444 444
445 frame.bevel_w = theme().bevelWidth(); 445 frame.bevel_w = theme()->bevelWidth();
446 // destroy shape if the theme wasn't specified with one, 446 // destroy shape if the theme wasn't specified with one,
447 // or create one 447 // or create one
448 if (theme().shape() == false && m_shape.get()) 448 if (theme()->shape() == false && m_shape.get())
449 m_shape.reset(0); 449 m_shape.reset(0);
450 else if (theme().shape() && m_shape.get() == 0) { 450 else if (theme()->shape() && m_shape.get() == 0) {
451 m_shape.reset(new FbTk::Shape(frame.window, 0)); 451 m_shape.reset(new FbTk::Shape(frame.window, 0));
452 } 452 }
453 453
@@ -464,9 +464,9 @@ void Toolbar::reconfigure() {
464 464
465 // render frame window 465 // render frame window
466 Pixmap tmp = m_window_pm; 466 Pixmap tmp = m_window_pm;
467 if (!theme().toolbar().usePixmap()) { 467 if (!theme()->toolbar().usePixmap()) {
468 m_window_pm = 0; 468 m_window_pm = 0;
469 frame.window.setBackgroundColor(theme().toolbar().color()); 469 frame.window.setBackgroundColor(theme()->toolbar().color());
470 } else { 470 } else {
471 FbTk::Orientation orient = FbTk::ROT0; 471 FbTk::Orientation orient = FbTk::ROT0;
472 Toolbar::Placement where = *m_rc_placement; 472 Toolbar::Placement where = *m_rc_placement;
@@ -477,14 +477,14 @@ void Toolbar::reconfigure() {
477 477
478 m_window_pm = screen().imageControl().renderImage( 478 m_window_pm = screen().imageControl().renderImage(
479 frame.window.width(), frame.window.height(), 479 frame.window.width(), frame.window.height(),
480 theme().toolbar(), orient); 480 theme()->toolbar(), orient);
481 frame.window.setBackgroundPixmap(m_window_pm); 481 frame.window.setBackgroundPixmap(m_window_pm);
482 } 482 }
483 if (tmp) 483 if (tmp)
484 screen().imageControl().removeImage(tmp); 484 screen().imageControl().removeImage(tmp);
485 485
486 frame.window.setBorderColor(theme().border().color()); 486 frame.window.setBorderColor(theme()->border().color());
487 frame.window.setBorderWidth(theme().border().width()); 487 frame.window.setBorderWidth(theme()->border().width());
488 488
489 bool have_composite = FbTk::Transparent::haveComposite(); 489 bool have_composite = FbTk::Transparent::haveComposite();
490 // have_composite could have changed, so we need to change both 490 // have_composite could have changed, so we need to change both
@@ -497,7 +497,7 @@ void Toolbar::reconfigure() {
497 } 497 }
498 frame.window.clear(); 498 frame.window.clear();
499 499
500 if (theme().shape() && m_shape.get()) 500 if (theme()->shape() && m_shape.get())
501 m_shape->update(); 501 m_shape->update();
502 502
503 ItemList::iterator item_it = m_item_list.begin(); 503 ItemList::iterator item_it = m_item_list.begin();
@@ -637,16 +637,16 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
637 head_h = screen().getHeadHeight(head); 637 head_h = screen().getHeadHeight(head);
638 } 638 }
639 639
640 int bevel_width = theme().bevelWidth(); 640 int bevel_width = theme()->bevelWidth();
641 int border_width = theme().border().width(); 641 int border_width = theme()->border().width();
642 642
643 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; 643 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100;
644 //!! TODO: change this 644 //!! TODO: change this
645 // max height of each toolbar items font... 645 // max height of each toolbar items font...
646 unsigned int max_height = m_tool_factory.maxFontHeight() + 2; 646 unsigned int max_height = m_tool_factory.maxFontHeight() + 2;
647 647
648 if (theme().height() > 0) 648 if (theme()->height() > 0)
649 max_height = theme().height(); 649 max_height = theme()->height();
650 650
651 if (*m_rc_height > 0 && *m_rc_height < 100) 651 if (*m_rc_height > 0 && *m_rc_height < 100)
652 max_height = *m_rc_height; 652 max_height = *m_rc_height;
@@ -971,7 +971,7 @@ void Toolbar::rearrangeItems() {
971 // calculate size for fixed items 971 // calculate size for fixed items
972 ItemList::iterator item_it = m_item_list.begin(); 972 ItemList::iterator item_it = m_item_list.begin();
973 ItemList::iterator item_it_end = m_item_list.end(); 973 ItemList::iterator item_it_end = m_item_list.end();
974 int bevel_width = theme().bevelWidth(); 974 int bevel_width = theme()->bevelWidth();
975 int fixed_width = bevel_width; // combined size of all fixed items 975 int fixed_width = bevel_width; // combined size of all fixed items
976 int relative_items = 0; 976 int relative_items = 0;
977 int last_bw = 0; // we show the largest border of adjoining items 977 int last_bw = 0; // we show the largest border of adjoining items