00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "ToolbarTheme.hh"
00025
00026 #include "FbTk/App.hh"
00027
00028 #include <iostream>
00029 using namespace std;
00030
00031 template<>
00032 void FbTk::ThemeItem<bool>::load() { }
00033
00034 template<>
00035 void FbTk::ThemeItem<bool>::setDefaultValue() {
00036 *(*this) = false;
00037 }
00038
00039 template<>
00040 void FbTk::ThemeItem<bool>::setFromString(char const *strval) {
00041 if (strcasecmp(strval, "true")==0)
00042 *(*this) = true;
00043 else
00044 *(*this) = false;
00045 }
00046
00047 ToolbarTheme::ToolbarTheme(int screen_num):
00048 FbTk::Theme(screen_num),
00049 m_toolbar(*this, "toolbar", "Toolbar"),
00050 m_border(*this, "toolbar", "Toolbar"),
00051 m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"),
00052 m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"),
00053 m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"),
00054 m_height(*this, "toolbar.height", "Toolbar.Height"),
00055 m_button_size(*this, "toolbar.button.size", "Toolbar.Button.Size") {
00056
00057 *m_bevel_width = 0;
00058 *m_alpha = 255;
00059 *m_shape = false;
00060 *m_height = 0;
00061 *m_button_size = -1;
00062 }
00063
00064 ToolbarTheme::~ToolbarTheme() {
00065
00066 }
00067
00068 void ToolbarTheme::reconfigTheme() {
00069 if (*m_alpha > 255)
00070 *m_alpha = 255;
00071 else if (*m_alpha < 0)
00072 *m_alpha = 0;
00073
00074 if (*m_bevel_width > 20)
00075 *m_bevel_width = 20;
00076
00077 if (*m_height > 100)
00078 *m_height = 100;
00079 else if (*m_height < 0)
00080 *m_height = 0;
00081
00082 if (*m_button_size > 100)
00083 *m_button_size = 100;
00084 }