diff options
author | fluxgen <fluxgen> | 2003-09-10 21:22:25 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-09-10 21:22:25 (GMT) |
commit | cd85257a4b1f6b634c08202f88e93ae2d087877d (patch) | |
tree | 646cf81bd59d08e0b7d83381ac02e3499032ea1d | |
parent | a3f23b5ec18cb1cb294c43c67a1c43018f1d01eb (diff) | |
download | fluxbox_paul-cd85257a4b1f6b634c08202f88e93ae2d087877d.zip fluxbox_paul-cd85257a4b1f6b634c08202f88e93ae2d087877d.tar.bz2 |
fixed loading of color or pixmaps for texture
-rw-r--r-- | src/FbTk/Theme.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc index ed7ba73..fab91b6 100644 --- a/src/FbTk/Theme.cc +++ b/src/FbTk/Theme.cc | |||
@@ -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: Theme.cc,v 1.17 2003/08/28 23:06:27 fluxgen Exp $ | 22 | // $Id: Theme.cc,v 1.18 2003/09/10 21:22:25 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Theme.hh" | 24 | #include "Theme.hh" |
25 | 25 | ||
@@ -100,18 +100,6 @@ template <> | |||
100 | void ThemeItem<FbTk::Font>::load() { | 100 | void ThemeItem<FbTk::Font>::load() { |
101 | } | 101 | } |
102 | 102 | ||
103 | template <> | ||
104 | void ThemeItem<FbTk::Texture>::setDefaultValue() { | ||
105 | m_value.setType(FbTk::Texture::FLAT | FbTk::Texture::SOLID); | ||
106 | } | ||
107 | |||
108 | template <> | ||
109 | void ThemeItem<FbTk::Texture>::setFromString(const char *str) { | ||
110 | m_value.setFromString(str); | ||
111 | if (m_value.type() == 0) // failed to set value | ||
112 | setDefaultValue(); | ||
113 | } | ||
114 | |||
115 | 103 | ||
116 | template <> | 104 | template <> |
117 | void ThemeItem<FbTk::Texture>::load() { | 105 | void ThemeItem<FbTk::Texture>::load() { |
@@ -140,6 +128,20 @@ void ThemeItem<FbTk::Texture>::load() { | |||
140 | m_value.pixmap() = pm->pixmap().release(); | 128 | m_value.pixmap() = pm->pixmap().release(); |
141 | } | 129 | } |
142 | 130 | ||
131 | template <> | ||
132 | void ThemeItem<FbTk::Texture>::setDefaultValue() { | ||
133 | m_value.setType(FbTk::Texture::FLAT | FbTk::Texture::SOLID); | ||
134 | load(); // one might forget to add line something: so we try to load something.*: too | ||
135 | } | ||
136 | |||
137 | template <> | ||
138 | void ThemeItem<FbTk::Texture>::setFromString(const char *str) { | ||
139 | m_value.setFromString(str); | ||
140 | if (m_value.type() == 0) // failed to set value | ||
141 | setDefaultValue(); | ||
142 | } | ||
143 | |||
144 | |||
143 | 145 | ||
144 | // not used | 146 | // not used |
145 | template <> | 147 | template <> |