diff options
author | rathnor <rathnor> | 2004-04-26 15:04:37 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-04-26 15:04:37 (GMT) |
commit | d4a871785130ab0d6533bef4f1ec55c4cfd3b8df (patch) | |
tree | f07025c5527733c88043ca61316c0af62daf598d /src/FbTk/ThemeItems.hh | |
parent | ef6bf03ca19c0c96943894f9d0f0db9bc0bd58fc (diff) | |
download | fluxbox_pavel-d4a871785130ab0d6533bef4f1ec55c4cfd3b8df.zip fluxbox_pavel-d4a871785130ab0d6533bef4f1ec55c4cfd3b8df.tar.bz2 |
toolbar themeing fixes
Diffstat (limited to 'src/FbTk/ThemeItems.hh')
-rw-r--r-- | src/FbTk/ThemeItems.hh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/FbTk/ThemeItems.hh b/src/FbTk/ThemeItems.hh index 63c17df..57a5f11 100644 --- a/src/FbTk/ThemeItems.hh +++ b/src/FbTk/ThemeItems.hh | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ThemeItems.hh,v 1.5 2004/02/10 19:03:04 fluxgen Exp $ | 22 | // $Id: ThemeItems.hh,v 1.6 2004/04/26 15:04:37 rathnor Exp $ |
23 | 23 | ||
24 | /// @file implements common theme items | 24 | /// @file implements common theme items |
25 | 25 | ||
@@ -42,7 +42,7 @@ using namespace std; | |||
42 | 42 | ||
43 | // create default handlers for Color, Font, Texture, int and string | 43 | // create default handlers for Color, Font, Texture, int and string |
44 | template <> | 44 | template <> |
45 | void FbTk::ThemeItem<std::string>::load() { } | 45 | void FbTk::ThemeItem<std::string>::load(const std::string *name, const std::string *altname) { } |
46 | 46 | ||
47 | template <> | 47 | template <> |
48 | void FbTk::ThemeItem<std::string>::setDefaultValue() { | 48 | void FbTk::ThemeItem<std::string>::setDefaultValue() { |
@@ -55,7 +55,7 @@ void FbTk::ThemeItem<std::string>::setFromString(const char *str) { | |||
55 | } | 55 | } |
56 | 56 | ||
57 | template <> | 57 | template <> |
58 | void FbTk::ThemeItem<int>::load() { } | 58 | void FbTk::ThemeItem<int>::load(const std::string *name, const std::string *altname) { } |
59 | 59 | ||
60 | template <> | 60 | template <> |
61 | void FbTk::ThemeItem<int>::setDefaultValue() { | 61 | void FbTk::ThemeItem<int>::setDefaultValue() { |
@@ -103,18 +103,21 @@ void ThemeItem<FbTk::Font>::setFromString(const char *str) { | |||
103 | 103 | ||
104 | // do nothing | 104 | // do nothing |
105 | template <> | 105 | template <> |
106 | void ThemeItem<FbTk::Font>::load() { | 106 | void ThemeItem<FbTk::Font>::load(const std::string *name, const std::string *altname) { |
107 | } | 107 | } |
108 | 108 | ||
109 | 109 | ||
110 | template <> | 110 | template <> |
111 | void ThemeItem<FbTk::Texture>::load() { | 111 | void ThemeItem<FbTk::Texture>::load(const std::string *o_name, const std::string *o_altname) { |
112 | const std::string &m_name = (o_name==0)?name():*o_name; | ||
113 | const std::string &m_altname = (o_altname==0)?altName():*o_altname; | ||
114 | |||
112 | string color_name(ThemeManager::instance(). | 115 | string color_name(ThemeManager::instance(). |
113 | resourceValue(name()+".color", altName()+".Color")); | 116 | resourceValue(m_name+".color", m_altname+".Color")); |
114 | string colorto_name(ThemeManager::instance(). | 117 | string colorto_name(ThemeManager::instance(). |
115 | resourceValue(name()+".colorTo", altName()+".ColorTo")); | 118 | resourceValue(m_name+".colorTo", m_altname+".ColorTo")); |
116 | string pixmap_name(ThemeManager::instance(). | 119 | string pixmap_name(ThemeManager::instance(). |
117 | resourceValue(name()+".pixmap", altName()+".Pixmap")); | 120 | resourceValue(m_name+".pixmap", m_altname+".Pixmap")); |
118 | 121 | ||
119 | 122 | ||
120 | // set default value if we failed to load color | 123 | // set default value if we failed to load color |
@@ -137,7 +140,7 @@ void ThemeItem<FbTk::Texture>::load() { | |||
137 | m_tm.screenNum())); | 140 | m_tm.screenNum())); |
138 | if (pm.get() == 0) { | 141 | if (pm.get() == 0) { |
139 | if (FbTk::ThemeManager::instance().verbose()) { | 142 | if (FbTk::ThemeManager::instance().verbose()) { |
140 | cerr<<"Resource("<<name()+".pixmap" | 143 | cerr<<"Resource("<<m_name+".pixmap" |
141 | <<"): Failed to load image: "<<pixmap_name<<endl; | 144 | <<"): Failed to load image: "<<pixmap_name<<endl; |
142 | } | 145 | } |
143 | m_value.pixmap() = 0; | 146 | m_value.pixmap() = 0; |
@@ -163,8 +166,7 @@ void ThemeItem<FbTk::Texture>::setFromString(const char *str) { | |||
163 | 166 | ||
164 | // not used | 167 | // not used |
165 | template <> | 168 | template <> |
166 | void FbTk::ThemeItem<PixmapWithMask>:: | 169 | void FbTk::ThemeItem<PixmapWithMask>::load(const std::string *name, const std::string *altname) { } |
167 | load() { } | ||
168 | 170 | ||
169 | template <> | 171 | template <> |
170 | void FbTk::ThemeItem<PixmapWithMask>:: | 172 | void FbTk::ThemeItem<PixmapWithMask>:: |
@@ -211,7 +213,7 @@ void ThemeItem<FbTk::Color>::setFromString(const char *str) { | |||
211 | 213 | ||
212 | // does nothing | 214 | // does nothing |
213 | template <> | 215 | template <> |
214 | void ThemeItem<FbTk::Color>::load() { } | 216 | void ThemeItem<FbTk::Color>::load(const std::string *name, const std::string *altname) { } |
215 | 217 | ||
216 | } // end namespace FbTk | 218 | } // end namespace FbTk |
217 | 219 | ||