fixed fallback items
fluxgen fluxgen
2 files changed,
39 insertions(+),
3 deletions(-)
M
src/IconbarTheme.cc
→
src/IconbarTheme.cc
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTheme.cc,v 1.4 2003/08/13 10:03:06 fluxgen Exp $ +// $Id: IconbarTheme.cc,v 1.5 2003/08/19 21:26:45 fluxgen Exp $ #include "IconbarTheme.hh" #include "FbTk/App.hh"@@ -36,7 +36,8 @@ m_focused_border(*this, name + ".focused", altname + ".Focused"),
m_unfocused_border(*this, name + ".unfocused", altname + ".Unfocused"), m_border(*this, name, altname), m_focused_text(*this, name + ".focused", altname + ".Focused"), - m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused") { + m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused"), + m_name(name) { FbTk::ThemeManager::instance().loadTheme(*this);@@ -56,3 +57,36 @@ m_focused_text.setAntialias(value);
m_unfocused_text.setAntialias(value); } +// fallback resources +bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) { + using namespace FbTk; + ThemeManager &tm = ThemeManager::instance(); + + if (&m_focused_texture == &item) + return tm.loadItem(item, "window.title.focus", "Window.Title.Focus"); + else if (&m_unfocused_texture == &item) { + return (tm.loadItem(item, m_focused_texture.name(), m_focused_texture.altName()) ? + true : + tm.loadItem(item, "window.title.unfocus", "Window.Title.Unfocus")); + } else if (&m_empty_texture == &item) { + return (tm.loadItem(item, m_focused_texture.name(), m_focused_texture.altName()) ? + true : + tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel")); + } else if (item.name() == m_name + ".borderWidth" || + item.name() == m_name + ".focused.borderWidth" || + item.name() == m_name + ".unfocused.borderWidth") + return tm.loadItem(item, "borderWidth", "BorderWidth"); + else if (item.name() == m_name + ".borderColor" || + item.name() == m_name + ".focused.borderColor" || + item.name() == m_name + ".unfocused.borderColor") + return tm.loadItem(item, "borderColor", "BorderColor"); + else if (item.name() == m_name + ".focused.font" || + item.name() == m_name + ".unfocused.font") + return tm.loadItem(item, "window.font", "Window.Font"); + else if (item.name() == m_name + ".focused.textColor") + return tm.loadItem(item, "window.label.focus.textColor", "Window.Label.Focus.TextColor"); + else if (item.name() == m_name + ".unfocused.textColor") + return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); + + return false; +}
M
src/IconbarTheme.hh
→
src/IconbarTheme.hh
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTheme.hh,v 1.4 2003/08/13 10:03:06 fluxgen Exp $ +// $Id: IconbarTheme.hh,v 1.5 2003/08/19 21:26:45 fluxgen Exp $ #ifndef ICONBARTHEME_HH #define ICONBARTHEME_HH@@ -37,6 +37,7 @@ IconbarTheme(int screen_num, const std::string &name, const std::string &altname);
virtual ~IconbarTheme(); void reconfigTheme(); + bool fallback(FbTk::ThemeItem_base &item); void setAntialias(bool antialias);@@ -55,6 +56,7 @@ private:
FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture; BorderTheme m_focused_border, m_unfocused_border, m_border; TextTheme m_focused_text, m_unfocused_text; + std::string m_name; }; #endif // ICONBARTHEME_HH