diff options
author | markt <markt> | 2007-10-13 21:51:37 (GMT) |
---|---|---|
committer | markt <markt> | 2007-10-13 21:51:37 (GMT) |
commit | a59428d67a95a9df16554962f0a6257d6378328a (patch) | |
tree | f856ed9300c34f7a17d499f22d895610cfbc08e5 /src/IconbarTheme.cc | |
parent | 41b5c6dadb1f474675660cef18b812d4c2338ed2 (diff) | |
download | fluxbox-a59428d67a95a9df16554962f0a6257d6378328a.zip fluxbox-a59428d67a95a9df16554962f0a6257d6378328a.tar.bz2 |
merged changes from pre-devel
Diffstat (limited to 'src/IconbarTheme.cc')
-rw-r--r-- | src/IconbarTheme.cc | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/IconbarTheme.cc b/src/IconbarTheme.cc index f4e4c55..2ee8360 100644 --- a/src/IconbarTheme.cc +++ b/src/IconbarTheme.cc | |||
@@ -37,8 +37,7 @@ IconbarTheme::IconbarTheme(int screen_num, | |||
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 | m_name(name), m_altname(altname) { |
41 | m_alpha(*this, name+".alpha", altname+".Alpha") { | ||
42 | 41 | ||
43 | FbTk::ThemeManager::instance().loadTheme(*this); | 42 | FbTk::ThemeManager::instance().loadTheme(*this); |
44 | 43 | ||
@@ -58,27 +57,36 @@ bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) { | |||
58 | using namespace FbTk; | 57 | using namespace FbTk; |
59 | ThemeManager &tm = ThemeManager::instance(); | 58 | ThemeManager &tm = ThemeManager::instance(); |
60 | 59 | ||
60 | // TODO: fix fallbacks for "focused" vs. "focus" | ||
61 | if (&m_focused_texture == &item) { | 61 | if (&m_focused_texture == &item) { |
62 | return (tm.loadItem(item, "window.label.focus", "Window.Label.Focus") || | 62 | return (tm.loadItem(item, "window.label.focus", "Window.Label.Focus") || |
63 | tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel")); | 63 | tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel")); |
64 | 64 | ||
65 | } else if (&m_unfocused_texture == &item) { | 65 | } else if (&m_unfocused_texture == &item) { |
66 | return (tm.loadItem(item, "window.label.unfocus", "Window.Label.Unfocus") || | 66 | return (tm.loadItem(item, "window.label.unfocus", |
67 | tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel")); | 67 | "Window.Label.Unfocus") || |
68 | tm.loadItem(item, "toolbar.windowLabel", | ||
69 | "toolbar.windowLabel")); | ||
68 | } else if (&m_empty_texture == &item) { | 70 | } else if (&m_empty_texture == &item) { |
69 | return (tm.loadItem(item, m_focused_texture.name(), m_focused_texture.altName()) || | 71 | return (tm.loadItem(item, m_focused_texture.name(), |
70 | tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel") || | 72 | m_focused_texture.altName()) || |
71 | tm.loadItem(item, "toolbar", "toolbar") | 73 | tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel") |
72 | ); | 74 | || tm.loadItem(item, "toolbar", "toolbar")); |
73 | } else if (item.name() == m_name + ".focused.borderWidth" || | 75 | } else if (item.name() == m_name + ".focused.borderWidth" || |
74 | item.name() == m_name + ".unfocused.borderWidth") | 76 | item.name() == m_name + ".unfocused.borderWidth") |
75 | // don't fallback for base border, for theme backwards compatibility | 77 | // don't fallback for base border, for theme backwards compatibility |
76 | return tm.loadItem(item, "borderWidth", "BorderWidth"); | 78 | return (tm.loadItem(item, m_name + ".borderWidth", |
79 | m_altname + ".BorderWidth") || | ||
80 | tm.loadItem(item, "window.borderWidth", "Window.BorderWidth") || | ||
81 | tm.loadItem(item, "borderWidth", "BorderWidth")); | ||
77 | 82 | ||
78 | else if (item.name() == m_name + ".focused.borderColor" || | 83 | else if (item.name() == m_name + ".focused.borderColor" || |
79 | item.name() == m_name + ".unfocused.borderColor") | 84 | item.name() == m_name + ".unfocused.borderColor") |
80 | 85 | ||
81 | return tm.loadItem(item, "borderColor", "BorderColor"); | 86 | return (tm.loadItem(item, m_name + ".borderColor", |
87 | m_altname + ".BorderColor") || | ||
88 | tm.loadItem(item, "window.borderColor", "Window.BorderColor") || | ||
89 | tm.loadItem(item, "borderColor", "BorderColor")); | ||
82 | 90 | ||
83 | else if (item.name() == m_name + ".focused.font" || | 91 | else if (item.name() == m_name + ".focused.font" || |
84 | item.name() == m_name + ".unfocused.font") | 92 | item.name() == m_name + ".unfocused.font") |
@@ -91,11 +99,10 @@ bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) { | |||
91 | 99 | ||
92 | } else if (item.name() == m_name + ".unfocused.textColor") { | 100 | } else if (item.name() == m_name + ".unfocused.textColor") { |
93 | return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); | 101 | return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); |
94 | } else if (item.name() == m_name + ".alpha") { | 102 | } else if (item.name() == m_name + ".focused.justify" || |
95 | if (!tm.loadItem(item, "toolbar.alpha", "Toolbar.Alpha")) { | 103 | item.name() == m_name + ".unfocused.justify") { |
96 | *m_alpha = 255; | 104 | return (tm.loadItem(item, m_name + ".justify", m_altname + ".Justify") |
97 | } | 105 | || tm.loadItem(item, "window.justify", "Window.Justify")); |
98 | return true; | ||
99 | } | 106 | } |
100 | 107 | ||
101 | return false; | 108 | return false; |