aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/IconbarTheme.cc38
-rw-r--r--src/IconbarTheme.hh4
2 files changed, 39 insertions, 3 deletions
diff --git a/src/IconbarTheme.cc b/src/IconbarTheme.cc
index 2689083..ed320e4 100644
--- a/src/IconbarTheme.cc
+++ b/src/IconbarTheme.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTheme.cc,v 1.4 2003/08/13 10:03:06 fluxgen Exp $ 23// $Id: IconbarTheme.cc,v 1.5 2003/08/19 21:26:45 fluxgen Exp $
24 24
25#include "IconbarTheme.hh" 25#include "IconbarTheme.hh"
26#include "FbTk/App.hh" 26#include "FbTk/App.hh"
@@ -36,7 +36,8 @@ IconbarTheme::IconbarTheme(int screen_num,
36 m_unfocused_border(*this, name + ".unfocused", altname + ".Unfocused"), 36 m_unfocused_border(*this, name + ".unfocused", altname + ".Unfocused"),
37 m_border(*this, name, altname), 37 m_border(*this, name, altname),
38 m_focused_text(*this, name + ".focused", altname + ".Focused"), 38 m_focused_text(*this, name + ".focused", altname + ".Focused"),
39 m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused") { 39 m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused"),
40 m_name(name) {
40 41
41 FbTk::ThemeManager::instance().loadTheme(*this); 42 FbTk::ThemeManager::instance().loadTheme(*this);
42 43
@@ -56,3 +57,36 @@ void IconbarTheme::setAntialias(bool value) {
56 m_unfocused_text.setAntialias(value); 57 m_unfocused_text.setAntialias(value);
57} 58}
58 59
60// fallback resources
61bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) {
62 using namespace FbTk;
63 ThemeManager &tm = ThemeManager::instance();
64
65 if (&m_focused_texture == &item)
66 return tm.loadItem(item, "window.title.focus", "Window.Title.Focus");
67 else if (&m_unfocused_texture == &item) {
68 return (tm.loadItem(item, m_focused_texture.name(), m_focused_texture.altName()) ?
69 true :
70 tm.loadItem(item, "window.title.unfocus", "Window.Title.Unfocus"));
71 } else if (&m_empty_texture == &item) {
72 return (tm.loadItem(item, m_focused_texture.name(), m_focused_texture.altName()) ?
73 true :
74 tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel"));
75 } else if (item.name() == m_name + ".borderWidth" ||
76 item.name() == m_name + ".focused.borderWidth" ||
77 item.name() == m_name + ".unfocused.borderWidth")
78 return tm.loadItem(item, "borderWidth", "BorderWidth");
79 else if (item.name() == m_name + ".borderColor" ||
80 item.name() == m_name + ".focused.borderColor" ||
81 item.name() == m_name + ".unfocused.borderColor")
82 return tm.loadItem(item, "borderColor", "BorderColor");
83 else if (item.name() == m_name + ".focused.font" ||
84 item.name() == m_name + ".unfocused.font")
85 return tm.loadItem(item, "window.font", "Window.Font");
86 else if (item.name() == m_name + ".focused.textColor")
87 return tm.loadItem(item, "window.label.focus.textColor", "Window.Label.Focus.TextColor");
88 else if (item.name() == m_name + ".unfocused.textColor")
89 return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor");
90
91 return false;
92}
diff --git a/src/IconbarTheme.hh b/src/IconbarTheme.hh
index 18ec0cd..7545454 100644
--- a/src/IconbarTheme.hh
+++ b/src/IconbarTheme.hh
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTheme.hh,v 1.4 2003/08/13 10:03:06 fluxgen Exp $ 23// $Id: IconbarTheme.hh,v 1.5 2003/08/19 21:26:45 fluxgen Exp $
24 24
25#ifndef ICONBARTHEME_HH 25#ifndef ICONBARTHEME_HH
26#define ICONBARTHEME_HH 26#define ICONBARTHEME_HH
@@ -37,6 +37,7 @@ public:
37 virtual ~IconbarTheme(); 37 virtual ~IconbarTheme();
38 38
39 void reconfigTheme(); 39 void reconfigTheme();
40 bool fallback(FbTk::ThemeItem_base &item);
40 41
41 void setAntialias(bool antialias); 42 void setAntialias(bool antialias);
42 43
@@ -55,6 +56,7 @@ private:
55 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture; 56 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture;
56 BorderTheme m_focused_border, m_unfocused_border, m_border; 57 BorderTheme m_focused_border, m_unfocused_border, m_border;
57 TextTheme m_focused_text, m_unfocused_text; 58 TextTheme m_focused_text, m_unfocused_text;
59 std::string m_name;
58}; 60};
59 61
60#endif // ICONBARTHEME_HH 62#endif // ICONBARTHEME_HH