aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r--src/FbWinFrame.cc27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index c7e1cb1..8d33a3e 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.22 2003/04/16 22:15:22 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.23 2003/05/01 13:19:36 rathnor Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25#include "ImageControl.hh" 25#include "ImageControl.hh"
@@ -69,6 +69,7 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
69 m_use_titlebar(true), 69 m_use_titlebar(true),
70 m_use_handle(true), 70 m_use_handle(true),
71 m_focused(false), 71 m_focused(false),
72 m_visible(false),
72 m_button_pm(0), 73 m_button_pm(0),
73 m_themelistener(*this) { 74 m_themelistener(*this) {
74 75
@@ -124,12 +125,14 @@ bool FbWinFrame::setOnClickTitlebar(FbTk::RefCount<FbTk::Command> &ref, int mous
124 125
125void FbWinFrame::hide() { 126void FbWinFrame::hide() {
126 m_window.hide(); 127 m_window.hide();
128 m_visible = false;
127} 129}
128 130
129void FbWinFrame::show() { 131void FbWinFrame::show() {
132 m_visible = true;
133 reconfigure();
130 m_window.showSubwindows(); 134 m_window.showSubwindows();
131 m_window.show(); 135 m_window.show();
132 reconfigure();
133} 136}
134 137
135/** 138/**
@@ -534,12 +537,13 @@ void FbWinFrame::reconfigure() {
534 } 537 }
535 } 538 }
536 539
540 if (!m_visible) return;
541
537 // render the theme 542 // render the theme
538 renderButtons(); 543 renderButtons();
539 if (!m_shaded) 544 if (!m_shaded)
540 renderHandles(); 545 renderHandles();
541 redrawTitle(); 546 // titlebar stuff rendered already by reconftitlebar
542 redrawTitlebar();
543} 547}
544 548
545unsigned int FbWinFrame::titleHeight() const { 549unsigned int FbWinFrame::titleHeight() const {
@@ -557,7 +561,7 @@ unsigned int FbWinFrame::buttonHeight() const {
557 aligns and redraws title 561 aligns and redraws title
558*/ 562*/
559void FbWinFrame::redrawTitle() { 563void FbWinFrame::redrawTitle() {
560 if (m_labelbuttons.size() == 0) 564 if (m_labelbuttons.size() == 0 || !m_visible)
561 return; 565 return;
562 566
563 int button_width = label().width()/m_labelbuttons.size(); 567 int button_width = label().width()/m_labelbuttons.size();
@@ -581,12 +585,12 @@ void FbWinFrame::redrawTitle() {
581} 585}
582 586
583void FbWinFrame::redrawTitlebar() { 587void FbWinFrame::redrawTitlebar() {
584 if (!m_use_titlebar) 588 if (!m_use_titlebar || !m_visible)
585 return; 589 return;
586 m_titlebar.clear(); 590 m_titlebar.clear();
587 m_label.clear(); 591 m_label.clear();
588 redrawTitle(); 592 redrawTitle();
589} 593 }
590 594
591/** 595/**
592 Align buttons with title text window 596 Align buttons with title text window
@@ -637,7 +641,7 @@ void FbWinFrame::reconfigureTitlebar() {
637} 641}
638 642
639void FbWinFrame::renderTitlebar() { 643void FbWinFrame::renderTitlebar() {
640 if (!m_use_titlebar) 644 if (!m_use_titlebar || !m_visible)
641 return; 645 return;
642 646
643 // render pixmaps 647 // render pixmaps
@@ -679,12 +683,12 @@ void FbWinFrame::renderTitlebar() {
679 m_titlebar.setBackgroundColor(title_color); 683 m_titlebar.setBackgroundColor(title_color);
680 684
681 renderLabelButtons(); 685 renderLabelButtons();
682 redrawTitle(); 686 redrawTitlebar();
683} 687}
684 688
685 689
686void FbWinFrame::renderHandles() { 690void FbWinFrame::renderHandles() {
687 if (!m_use_handle) 691 if (!m_use_handle || !m_visible)
688 return; 692 return;
689 render(m_theme.handleFocusTexture(), m_handle_focused_color, 693 render(m_theme.handleFocusTexture(), m_handle_focused_color,
690 m_handle_focused_pm, 694 m_handle_focused_pm,
@@ -741,6 +745,7 @@ void FbWinFrame::renderHandles() {
741} 745}
742 746
743void FbWinFrame::renderButtons() { 747void FbWinFrame::renderButtons() {
748 if (!m_visible) return;
744 749
745 render(m_theme.buttonFocusTexture(), m_button_color, m_button_pm, 750 render(m_theme.buttonFocusTexture(), m_button_color, m_button_pm,
746 m_button_size, m_button_size); 751 m_button_size, m_button_size);
@@ -785,7 +790,6 @@ void FbWinFrame::init() {
785 790
786 setEventHandler(*this); 791 setEventHandler(*this);
787 792
788 reconfigureTitlebar();
789 reconfigure(); 793 reconfigure();
790} 794}
791 795
@@ -864,6 +868,7 @@ void FbWinFrame::getUnFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
864} 868}
865 869
866void FbWinFrame::renderLabelButtons() { 870void FbWinFrame::renderLabelButtons() {
871 if (!m_visible) return;
867 Pixmap label_pm = None; 872 Pixmap label_pm = None;
868 Pixmap not_used_pm = None; 873 Pixmap not_used_pm = None;
869 FbTk::Color label_color; 874 FbTk::Color label_color;