summaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/MenuTheme.cc1
-rw-r--r--src/FbTk/Theme.cc12
2 files changed, 8 insertions, 5 deletions
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc
index 3b03697..46da48e 100644
--- a/src/FbTk/MenuTheme.cc
+++ b/src/FbTk/MenuTheme.cc
@@ -98,6 +98,7 @@ MenuTheme::MenuTheme(int screen_num):
98 d_text_gc.setForeground(*d_text); 98 d_text_gc.setForeground(*d_text);
99 hilite_gc.setForeground(hilite->color()); 99 hilite_gc.setForeground(hilite->color());
100 100
101 ThemeManager::instance().loadTheme(*this);
101} 102}
102 103
103MenuTheme::~MenuTheme() { 104MenuTheme::~MenuTheme() {
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index cd03f5e..1c69bb4 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -97,12 +97,14 @@ bool ThemeManager::registerTheme(Theme &tm) {
97 // valid screen num? 97 // valid screen num?
98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0) 98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0)
99 return false; 99 return false;
100 // TODO: use find and return false if it's already there
101 // instead of unique
102 100
103 m_themes[tm.screenNum()].push_back(&tm); 101 ThemeList::const_iterator it = m_themes[tm.screenNum()].begin(),
104 m_themes[tm.screenNum()].unique(); 102 it_end = m_themes[tm.screenNum()].end();
105 return true; 103 if (std::find(it, it_end, &tm) == it_end) {
104 m_themes[tm.screenNum()].push_back(&tm);
105 return true;
106 }
107 return false;
106} 108}
107 109
108bool ThemeManager::unregisterTheme(Theme &tm) { 110bool ThemeManager::unregisterTheme(Theme &tm) {