summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ToolbarTheme.cc21
-rw-r--r--src/ToolbarTheme.hh11
2 files changed, 27 insertions, 5 deletions
diff --git a/src/ToolbarTheme.cc b/src/ToolbarTheme.cc
index 61df3d4..2797c1e 100644
--- a/src/ToolbarTheme.cc
+++ b/src/ToolbarTheme.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: ToolbarTheme.cc,v 1.3 2003/06/24 16:26:56 fluxgen Exp $ 22// $Id: ToolbarTheme.cc,v 1.4 2003/07/10 12:00:09 fluxgen Exp $
23 23
24#include "ToolbarTheme.hh" 24#include "ToolbarTheme.hh"
25 25
@@ -27,6 +27,22 @@
27#include <iostream> 27#include <iostream>
28using namespace std; 28using namespace std;
29 29
30template<>
31void FbTk::ThemeItem<bool>::load() { }
32
33template<>
34void FbTk::ThemeItem<bool>::setDefaultValue() {
35 *(*this) = false;
36}
37
38template<>
39void FbTk::ThemeItem<bool>::setFromString(char const *strval) {
40 if (strcasecmp(strval, "true")==0)
41 *(*this) = true;
42 else
43 *(*this) = false;
44}
45
30ToolbarTheme::ToolbarTheme(int screen_num): 46ToolbarTheme::ToolbarTheme(int screen_num):
31 FbTk::Theme(screen_num), 47 FbTk::Theme(screen_num),
32 m_label_textcolor(*this, 48 m_label_textcolor(*this,
@@ -51,7 +67,8 @@ ToolbarTheme::ToolbarTheme(int screen_num):
51 m_justify(*this, "toolbar.justify", "Toolbar.Justify"), 67 m_justify(*this, "toolbar.justify", "Toolbar.Justify"),
52 m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"), 68 m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"),
53 m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"), 69 m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"),
54 m_display(FbTk::App::instance()->display()){ 70 m_shape(*this, "toolbar.shape", "Toolbar.Shape"),
71 m_display(FbTk::App::instance()->display()) {
55 72
56 Window rootwindow = RootWindow(m_display, screen_num); 73 Window rootwindow = RootWindow(m_display, screen_num);
57 74
diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh
index dda3346..770967f 100644
--- a/src/ToolbarTheme.hh
+++ b/src/ToolbarTheme.hh
@@ -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: ToolbarTheme.hh,v 1.3 2003/06/24 16:26:56 fluxgen Exp $ 22// $Id: ToolbarTheme.hh,v 1.4 2003/07/10 12:00:09 fluxgen Exp $
23 23
24#ifndef TOOLBARTHEME_HH 24#ifndef TOOLBARTHEME_HH
25#define TOOLBARTHEME_HH 25#define TOOLBARTHEME_HH
@@ -73,10 +73,13 @@ public:
73 ///@} 73 ///@}
74 FbTk::Justify justify() const { return *m_justify; } 74 FbTk::Justify justify() const { return *m_justify; }
75 75
76 int borderWidth() const { return *m_border_width; } 76 inline int borderWidth() const { return *m_border_width; }
77 int bevelWidth() const { return *m_bevel_width; } 77 inline int bevelWidth() const { return *m_bevel_width; }
78 inline bool shape() const { return *m_shape; }
79
78 void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); } 80 void addListener(FbTk::Observer &obs) { m_theme_change_sig.attach(&obs); }
79 void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); } 81 void removeListener(FbTk::Observer &obs) { m_theme_change_sig.detach(&obs); }
82
80private: 83private:
81 // text colors 84 // text colors
82 FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor; 85 FbTk::ThemeItem<FbTk::Color> m_label_textcolor, m_window_textcolor, m_clock_textcolor;
@@ -87,6 +90,8 @@ private:
87 FbTk::ThemeItem<FbTk::Justify> m_justify; 90 FbTk::ThemeItem<FbTk::Justify> m_justify;
88 91
89 FbTk::ThemeItem<int> m_border_width, m_bevel_width; 92 FbTk::ThemeItem<int> m_border_width, m_bevel_width;
93 FbTk::ThemeItem<bool> m_shape;
94
90 // graphic context 95 // graphic context
91 GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc; 96 GC m_label_text_gc, m_window_text_gc, m_clock_text_gc, m_button_pic_gc;
92 Display *m_display; 97 Display *m_display;