src/WinButton.{cc,hh}: cosmetic
This commit is contained in:
parent
c8d0945a8f
commit
edcb6d57ce
2 changed files with 17 additions and 44 deletions
|
@ -114,60 +114,32 @@ void WinButton::setPressedColor(const FbTk::Color &color) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Pixmap WinButton::getBackgroundPixmap() const {
|
Pixmap WinButton::getPixmap(const FbTk::ThemeProxy<WinButtonTheme> &theme) const {
|
||||||
switch(m_type) {
|
switch(m_type) {
|
||||||
case MAXIMIZE:
|
case MAXIMIZE:
|
||||||
return m_theme->maximizePixmap().pixmap().drawable();
|
return theme->maximizePixmap().pixmap().drawable();
|
||||||
break;
|
|
||||||
case MINIMIZE:
|
case MINIMIZE:
|
||||||
return m_theme->iconifyPixmap().pixmap().drawable();
|
return theme->iconifyPixmap().pixmap().drawable();
|
||||||
break;
|
|
||||||
case STICK:
|
case STICK:
|
||||||
if (m_listen_to.isStuck())
|
if (m_listen_to.isStuck())
|
||||||
return m_theme->stuckPixmap().pixmap().drawable();
|
return theme->stuckPixmap().pixmap().drawable();
|
||||||
return m_theme->stickPixmap().pixmap().drawable();
|
else
|
||||||
break;
|
return theme->stickPixmap().pixmap().drawable();
|
||||||
case CLOSE:
|
case CLOSE:
|
||||||
return m_theme->closePixmap().pixmap().drawable();
|
return theme->closePixmap().pixmap().drawable();
|
||||||
break;
|
|
||||||
case SHADE:
|
case SHADE:
|
||||||
if (m_listen_to.isShaded())
|
if (m_listen_to.isShaded())
|
||||||
return m_theme->unshadePixmap().pixmap().drawable();
|
return theme->unshadePixmap().pixmap().drawable();
|
||||||
return m_theme->shadePixmap().pixmap().drawable();
|
else
|
||||||
break;
|
return theme->shadePixmap().pixmap().drawable();
|
||||||
case MENUICON:
|
case MENUICON:
|
||||||
if (m_icon_pixmap.drawable())
|
if (m_icon_pixmap.drawable())
|
||||||
return m_theme->titlePixmap().pixmap().drawable();
|
return theme->titlePixmap().pixmap().drawable();
|
||||||
return m_theme->menuiconPixmap().pixmap().drawable();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pixmap WinButton::getPressedPixmap() const {
|
|
||||||
switch(m_type) {
|
|
||||||
case MAXIMIZE:
|
|
||||||
return m_pressed_theme->maximizePixmap().pixmap().drawable();
|
|
||||||
case MINIMIZE:
|
|
||||||
return m_pressed_theme->iconifyPixmap().pixmap().drawable();
|
|
||||||
case STICK:
|
|
||||||
if (m_listen_to.isStuck())
|
|
||||||
return m_pressed_theme->stuckPixmap().pixmap().drawable();
|
|
||||||
return m_pressed_theme->stickPixmap().pixmap().drawable();
|
|
||||||
case CLOSE:
|
|
||||||
return m_pressed_theme->closePixmap().pixmap().drawable();
|
|
||||||
case SHADE:
|
|
||||||
if (m_listen_to.isShaded())
|
|
||||||
return m_pressed_theme->unshadePixmap().pixmap().drawable();
|
|
||||||
else
|
else
|
||||||
return m_pressed_theme->shadePixmap().pixmap().drawable();
|
return theme->menuiconPixmap().pixmap().drawable();
|
||||||
case MENUICON:
|
default:
|
||||||
if (m_icon_pixmap.drawable())
|
|
||||||
return m_theme->titlePixmap().pixmap().drawable();
|
|
||||||
else
|
|
||||||
return m_pressed_theme->menuiconPixmap().pixmap().drawable();
|
|
||||||
}
|
|
||||||
return None;
|
return None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear is used to force this to clear the window (e.g. called from clear())
|
// clear is used to force this to clear the window (e.g. called from clear())
|
||||||
|
|
|
@ -52,13 +52,14 @@ public:
|
||||||
void setBackgroundColor(const FbTk::Color &color);
|
void setBackgroundColor(const FbTk::Color &color);
|
||||||
void setPressedColor(const FbTk::Color &color);
|
void setPressedColor(const FbTk::Color &color);
|
||||||
|
|
||||||
Pixmap getBackgroundPixmap() const;
|
Pixmap getBackgroundPixmap() const { return getPixmap(m_theme); }
|
||||||
Pixmap getPressedPixmap() const;
|
Pixmap getPressedPixmap() const { return getPixmap(m_pressed_theme); }
|
||||||
/// override for redrawing
|
/// override for redrawing
|
||||||
void clear();
|
void clear();
|
||||||
void updateAll();
|
void updateAll();
|
||||||
private:
|
private:
|
||||||
void drawType();
|
void drawType();
|
||||||
|
Pixmap getPixmap(const FbTk::ThemeProxy<WinButtonTheme> &) const;
|
||||||
Type m_type; ///< the button type
|
Type m_type; ///< the button type
|
||||||
FluxboxWindow &m_listen_to;
|
FluxboxWindow &m_listen_to;
|
||||||
FbTk::ThemeProxy<WinButtonTheme> &m_theme, &m_pressed_theme;
|
FbTk::ThemeProxy<WinButtonTheme> &m_theme, &m_pressed_theme;
|
||||||
|
|
Loading…
Reference in a new issue