fix a few small bugs from recent big patch
simonb simonb
5 files changed,
21 insertions(+),
8 deletions(-)
M
src/FbTk/Button.cc
→
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 @@ bool update = false;
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)
M
src/FbTk/Button.hh
→
src/FbTk/Button.hh
@@ -75,7 +75,9 @@ bool pressed() const { return m_pressed; }
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
M
src/FbTk/TextButton.cc
→
src/FbTk/TextButton.cc
@@ -106,7 +106,6 @@ // TODO: do we need to check if the text overlaps the clearing area
// and if so, then clear a rectangle that encompases all the text plus the // requested area? drawText(); - } unsigned int TextButton::textWidth() const {
M
src/FbWinFrame.cc
→
src/FbWinFrame.cc
@@ -246,6 +246,7 @@ }
} void FbWinFrame::clearAll() { + if (m_use_titlebar) { redrawTitlebar();@@ -853,8 +854,13 @@ }
// 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);
M
src/WinButton.cc
→
src/WinButton.cc
@@ -84,7 +84,7 @@ } else {
overrode_pressed = false; } - FbTk::Button::setBackgroundPixmap(pm); + FbTk::Button::setPressedPixmap(pm); } void WinButton::setPressedColor(const FbTk::Color &color) {@@ -236,5 +236,11 @@ drawType();
} 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(); }