From 4c0fb1ff752f1cfafcac11637ce9cfec92201d13 Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Sun, 23 Feb 2003 00:47:34 +0000
Subject: fixed better default value for Color themeitem

---
 src/FbTk/Theme.cc | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index 1e2ea3a..1efc8a1 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Theme.cc,v 1.1 2002/12/02 19:34:54 fluxgen Exp $
+// $Id: Theme.cc,v 1.2 2003/02/23 00:47:34 fluxgen Exp $
 
 #include "Theme.hh"
 
@@ -77,14 +77,16 @@ void ThemeItem<FbTk::Texture>::load() {
     m_value.colorTo().setFromString(colorto_name.c_str(), m_tm.screenNum());
 }
 
+
 template <>
-void ThemeItem<FbTk::Color>::setFromString(const char *str) {
-    m_value.setFromString(str, m_tm.screenNum());
+void ThemeItem<FbTk::Color>::setDefaultValue() {
+    m_value.setFromString("white", m_tm.screenNum());
 }
 
 template <>
-void ThemeItem<FbTk::Color>::setDefaultValue() {
-    m_value.setPixel(0xFFFFFFFF);
+void ThemeItem<FbTk::Color>::setFromString(const char *str) {
+    if (!m_value.setFromString(str, m_tm.screenNum()))
+        setDefaultValue();
 }
 
 // does nothing
-- 
cgit v0.11.2