aboutsummaryrefslogtreecommitdiff
path: root/src/ButtonTheme.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ButtonTheme.cc')
-rw-r--r--src/ButtonTheme.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ButtonTheme.cc b/src/ButtonTheme.cc
new file mode 100644
index 0000000..225bbb7
--- /dev/null
+++ b/src/ButtonTheme.cc
@@ -0,0 +1,33 @@
1#include "ButtonTheme.hh"
2#include "FbTk/App.hh"
3
4//!! TODO: still missing *.pressed.picColor
5ButtonTheme::ButtonTheme(int screen_num,
6 const std::string &name,
7 const std::string &alt_name):
8 ToolTheme(screen_num, name, alt_name),
9 m_pic_color(*this, name + ".picColor", alt_name + ".PicColor"),
10 m_pressed_texture(*this, name + ".pressed", alt_name + ".Pressed"),
11 m_gc(RootWindow(FbTk::App::instance()->display(), screen_num)) {
12
13}
14
15bool ButtonTheme::fallback(FbTk::ThemeItem_base &item) {
16
17 if (item.name().find(".borderWidth") != std::string::npos) {
18 return FbTk::ThemeManager::instance().loadItem(item, "borderWidth", "BorderWidth");
19 }
20
21 if (item.name().find(".borderColor") != std::string::npos) {
22 return FbTk::ThemeManager::instance().loadItem(item, "borderColor", "BorderColor");
23 }
24
25 return ToolTheme::fallback(item);
26}
27
28void ButtonTheme::reconfigTheme() {
29 m_gc.setForeground(*m_pic_color);
30}
31
32
33