more button state fixing for shade, should be right now

plus noticed typo in theme for unshade
This commit is contained in:
simonb 2006-04-14 15:26:25 +00:00
parent 3a7c01abed
commit 83a3429c39
2 changed files with 11 additions and 3 deletions

View file

@ -187,9 +187,9 @@ Pixmap WinButton::getPressedPixmap() const {
return m_theme.closePressedPixmap().pixmap().drawable();
case SHADE:
if (m_listen_to.isShaded())
return m_theme.shadePressedPixmap().pixmap().drawable();
else
return m_theme.unshadePressedPixmap().pixmap().drawable();
else
return m_theme.shadePressedPixmap().pixmap().drawable();
case MENUICON:
if (m_icon_pixmap.drawable())
if (m_listen_to.isFocused())
@ -382,5 +382,13 @@ void WinButton::update(FbTk::Subject *subj) {
if (my_pm != None)
setBackgroundPixmap(my_pm);
// incorrect, pressed_pixmap is stateful in shade, so we'll do oneoff for now
if (m_type == SHADE) {
Pixmap p_pm = getPressedPixmap();
if (p_pm != None)
setPressedPixmap(p_pm);
}
clear();
}

View file

@ -44,7 +44,7 @@ WinButtonTheme::WinButtonTheme(int screen_num, FbWinFrameTheme &frame_theme):
m_shade_unfocus_pm(*this, "window.shade.unfocus.pixmap", "Window.Shade.Unfocus.Pixmap"),
m_shade_pressed_pm(*this, "window.shade.pressed.pixmap", "Window.Shade.Pressed.Pixmap"),
m_unshade_pm(*this, "window.unshade.pixmap", "Window.Unshade.Pixmap"),
m_unshade_unfocus_pm(*this, "window.unshade.unfocus.pixmap", "Window.Unhade.Unfocus.Pixmap"),
m_unshade_unfocus_pm(*this, "window.unshade.unfocus.pixmap", "Window.Unshade.Unfocus.Pixmap"),
m_unshade_pressed_pm(*this, "window.unshade.pressed.pixmap", "Window.Unshade.Pressed.Pixmap"),
m_menuicon_pm(*this, "window.menuicon.pixmap", "Window.MenuIcon.Pixmap"),
m_menuicon_unfocus_pm(*this, "window.menuicon.unfocus.pixmap", "Window.MenuIcon.Unfocus.Pixmap"),