fixed better default value for Color themeitem
fluxgen fluxgen
1 files changed,
7 insertions(+),
5 deletions(-)
jump to
M
src/FbTk/Theme.cc
→
src/FbTk/Theme.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ m_value.color().setFromString(color_name.c_str(), m_tm.screenNum());
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