diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2007-12-16 08:50:59 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2007-12-16 08:50:59 (GMT) |
commit | 4a7a143713c7febe7d3a7df9c044ed767b8bd3c6 (patch) | |
tree | f4d1f31c5167469f77408d42d6eca83a29d42b4c /src/FbTk | |
parent | 8516f1e2a21a374127ccfa3f7b8de2443e67fe33 (diff) | |
download | fluxbox_paul-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.zip fluxbox_paul-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.tar.bz2 |
load style before loading theme objects, remove duplicate theme load
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/MenuTheme.cc | 1 | ||||
-rw-r--r-- | src/FbTk/Theme.cc | 12 |
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 | ||
103 | MenuTheme::~MenuTheme() { | 104 | MenuTheme::~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 | ||
108 | bool ThemeManager::unregisterTheme(Theme &tm) { | 110 | bool ThemeManager::unregisterTheme(Theme &tm) { |