From ddcecec37e0ea559c9292423a257b47c423ddb9e Mon Sep 17 00:00:00 2001 From: simonb Date: Wed, 13 Apr 2005 14:39:25 +0000 Subject: fix a few small bugs from recent big patch --- src/FbTk/Button.cc | 8 ++++---- src/FbTk/Button.hh | 2 ++ src/FbTk/TextButton.cc | 1 - src/FbWinFrame.cc | 10 ++++++++-- src/WinButton.cc | 8 +++++++- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/FbTk/Button.cc b/src/FbTk/Button.cc index 414979b..cc515f8 100644 --- a/src/FbTk/Button.cc +++ b/src/FbTk/Button.cc @@ -92,10 +92,10 @@ void Button::buttonPressEvent(XButtonEvent &event) { bool update = false; if (m_pressed_pm != 0) { update = true; - FbWindow::setBackgroundPixmap(m_pressed_pm); + FbTk::FbWindow::setBackgroundPixmap(m_pressed_pm); } else if (m_pressed_color.isAllocated()) { update = true; - FbWindow::setBackgroundColor(m_pressed_color); + FbTk::FbWindow::setBackgroundColor(m_pressed_color); } m_pressed = true; @@ -110,11 +110,11 @@ void Button::buttonReleaseEvent(XButtonEvent &event) { if (m_background_pm) { if (m_pressed_pm != 0) { update = true; - FbTk::FbWindow::setBackgroundPixmap(m_background_pm); + setBackgroundPixmap(m_background_pm); } } else if (m_pressed_color.isAllocated()) { update = true; - FbTk::FbWindow::setBackgroundColor(m_background_color); + setBackgroundColor(m_background_color); } if (update) diff --git a/src/FbTk/Button.hh b/src/FbTk/Button.hh index 48aff02..02b7b51 100644 --- a/src/FbTk/Button.hh +++ b/src/FbTk/Button.hh @@ -75,7 +75,9 @@ public: GC gc() const { return m_gc; } Pixmap backgroundPixmap() const { return m_background_pm; } + Pixmap pressedPixmap() const { return m_pressed_pm; } const Color &backgroundColor() const { return m_background_color; } + const Color &pressedColor() const { return m_pressed_color; } private: Pixmap m_background_pm; ///< background pixmap Color m_background_color; ///< background color diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index bdf5002..fdbdc78 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc @@ -106,7 +106,6 @@ void TextButton::clearArea(int x, int y, // and if so, then clear a rectangle that encompases all the text plus the // requested area? drawText(); - } unsigned int TextButton::textWidth() const { diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index c030712..ba98740 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -246,6 +246,7 @@ void FbWinFrame::notifyMoved(bool clear) { } void FbWinFrame::clearAll() { + if (m_use_titlebar) { redrawTitlebar(); @@ -853,8 +854,13 @@ void FbWinFrame::reconfigure() { // render the theme - renderAll(); - applyAll(); + if (isVisible()) { + renderAll(); + applyAll(); + clearAll(); + } else { + m_need_render = true; + } if (m_shape.get() && theme().shapePlace() == Shape::NONE || m_disable_shape) m_shape.reset(0); diff --git a/src/WinButton.cc b/src/WinButton.cc index 9ae2593..4802518 100644 --- a/src/WinButton.cc +++ b/src/WinButton.cc @@ -84,7 +84,7 @@ void WinButton::setPressedPixmap(Pixmap pm) { overrode_pressed = false; } - FbTk::Button::setBackgroundPixmap(pm); + FbTk::Button::setPressedPixmap(pm); } void WinButton::setPressedColor(const FbTk::Color &color) { @@ -236,5 +236,11 @@ void WinButton::clear() { } void WinButton::update(FbTk::Subject *subj) { + // pressed_pixmap isn't stateful in any current buttons, so no need + // to potentially override that. Just make sure background pm is ok + Pixmap my_pm = getBackgroundPixmap(); + if (my_pm != None) + setBackgroundPixmap(my_pm); + clear(); } -- cgit v0.11.2