fix a few small bugs from recent big patch

This commit is contained in:
simonb 2005-04-13 14:39:25 +00:00
parent 88c66f0687
commit ddcecec37e
5 changed files with 21 additions and 8 deletions

View file

@ -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)

View file

@ -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

View file

@ -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 {

View file

@ -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);

View file

@ -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();
}