2003-10-13 23:41:07 +00:00
|
|
|
#include "ButtonTheme.hh"
|
|
|
|
#include "FbTk/App.hh"
|
|
|
|
|
|
|
|
//!! TODO: still missing *.pressed.picColor
|
|
|
|
ButtonTheme::ButtonTheme(int screen_num,
|
|
|
|
const std::string &name,
|
|
|
|
const std::string &alt_name):
|
|
|
|
ToolTheme(screen_num, name, alt_name),
|
|
|
|
m_pic_color(*this, name + ".picColor", alt_name + ".PicColor"),
|
|
|
|
m_pressed_texture(*this, name + ".pressed", alt_name + ".Pressed"),
|
|
|
|
m_gc(RootWindow(FbTk::App::instance()->display(), screen_num)) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ButtonTheme::fallback(FbTk::ThemeItem_base &item) {
|
|
|
|
|
2004-08-25 17:16:40 +00:00
|
|
|
/* Don't fallback these for theme backwards compatibility
|
2003-10-13 23:41:07 +00:00
|
|
|
if (item.name().find(".borderWidth") != std::string::npos) {
|
|
|
|
return FbTk::ThemeManager::instance().loadItem(item, "borderWidth", "BorderWidth");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item.name().find(".borderColor") != std::string::npos) {
|
|
|
|
return FbTk::ThemeManager::instance().loadItem(item, "borderColor", "BorderColor");
|
|
|
|
}
|
2004-08-25 17:16:40 +00:00
|
|
|
*/
|
2004-07-18 18:46:03 +00:00
|
|
|
if (item.name().find(".pressed") != std::string::npos) {
|
|
|
|
// copy texture
|
|
|
|
*m_pressed_texture = texture();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-10-13 23:41:07 +00:00
|
|
|
return ToolTheme::fallback(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ButtonTheme::reconfigTheme() {
|
|
|
|
m_gc.setForeground(*m_pic_color);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|