added shape
fluxgen fluxgen
2 files changed,
27 insertions(+),
5 deletions(-)
M
src/ToolbarTheme.cc
→
src/ToolbarTheme.cc
@@ -19,13 +19,29 @@ // 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: ToolbarTheme.cc,v 1.3 2003/06/24 16:26:56 fluxgen Exp $ +// $Id: ToolbarTheme.cc,v 1.4 2003/07/10 12:00:09 fluxgen Exp $ #include "ToolbarTheme.hh" #include "App.hh" #include <iostream> using namespace std; + +template<> +void FbTk::ThemeItem<bool>::load() { } + +template<> +void FbTk::ThemeItem<bool>::setDefaultValue() { + *(*this) = false; +} + +template<> +void FbTk::ThemeItem<bool>::setFromString(char const *strval) { + if (strcasecmp(strval, "true")==0) + *(*this) = true; + else + *(*this) = false; +} ToolbarTheme::ToolbarTheme(int screen_num): FbTk::Theme(screen_num),@@ -51,7 +67,8 @@ m_font(*this, "toolbar.font", "Toolbar.Font"),
m_justify(*this, "toolbar.justify", "Toolbar.Justify"), m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"), m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"), - m_display(FbTk::App::instance()->display()){ + m_shape(*this, "toolbar.shape", "Toolbar.Shape"), + m_display(FbTk::App::instance()->display()) { Window rootwindow = RootWindow(m_display, screen_num);
M
src/ToolbarTheme.hh
→
src/ToolbarTheme.hh
@@ -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: ToolbarTheme.hh,v 1.3 2003/06/24 16:26:56 fluxgen Exp $ +// $Id: ToolbarTheme.hh,v 1.4 2003/07/10 12:00:09 fluxgen Exp $ #ifndef TOOLBARTHEME_HH #define TOOLBARTHEME_HH@@ -73,10 +73,13 @@ GC buttonPicGC() const { return m_button_pic_gc; }
///@} FbTk::Justify justify() const { return *m_justify; } - int borderWidth() const { return *m_border_width; } - int bevelWidth() const { return *m_bevel_width; } + inline int borderWidth() const { return *m_border_width; } + inline int bevelWidth() const { return *m_bevel_width; } + inline bool shape() const { return *m_shape; } + void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); } void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); } + private: // text colors FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor;@@ -87,6 +90,8 @@ FbTk::ThemeItem<FbTk::Font> m_font;
FbTk::ThemeItem<FbTk::Justify> m_justify; FbTk::ThemeItem<int> m_border_width, m_bevel_width; + FbTk::ThemeItem<bool> m_shape; + // graphic context GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc; Display *m_display;