aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-13 01:42:52 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-13 01:42:52 (GMT)
commit5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae (patch)
tree06cf36126a38168a767ceaf0f7b877abfc6298e1 /src
parentb302dab2f187e364df36237c44b8e48f1e892f04 (diff)
downloadfluxbox_pavel-5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae.zip
fluxbox_pavel-5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae.tar.bz2
fix initialization of WorkspaceNameTheme
Diffstat (limited to 'src')
-rw-r--r--src/WorkspaceNameTheme.hh5
-rw-r--r--src/WorkspaceNameTool.cc19
2 files changed, 11 insertions, 13 deletions
diff --git a/src/WorkspaceNameTheme.hh b/src/WorkspaceNameTheme.hh
index e4f426f..e90ef01 100644
--- a/src/WorkspaceNameTheme.hh
+++ b/src/WorkspaceNameTheme.hh
@@ -30,7 +30,10 @@ class WorkspaceNameTheme: public ToolTheme,
30public: 30public:
31 WorkspaceNameTheme(int screen_num, 31 WorkspaceNameTheme(int screen_num,
32 const std::string &name, 32 const std::string &name,
33 const std::string &alt_name):ToolTheme(screen_num, name, alt_name) { } 33 const std::string &alt_name):
34 ToolTheme(screen_num, name, alt_name) {
35 FbTk::ThemeManager::instance().loadTheme(*this);
36 }
34 37
35 bool fallback(FbTk::ThemeItem_base &item) { 38 bool fallback(FbTk::ThemeItem_base &item) {
36 if (item.name() == "toolbar.workspace.textColor") { 39 if (item.name() == "toolbar.workspace.textColor") {
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc
index 79ac724..6c73df5 100644
--- a/src/WorkspaceNameTool.cc
+++ b/src/WorkspaceNameTool.cc
@@ -45,7 +45,6 @@ WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent,
45 screen.workspaceNamesSig().attach(this); 45 screen.workspaceNamesSig().attach(this);
46 screen.currentWorkspaceSig().attach(this); 46 screen.currentWorkspaceSig().attach(this);
47 theme.reconfigSig().attach(this); 47 theme.reconfigSig().attach(this);
48
49} 48}
50 49
51WorkspaceNameTool::~WorkspaceNameTool() { 50WorkspaceNameTool::~WorkspaceNameTool() {
@@ -132,12 +131,16 @@ void WorkspaceNameTool::updateSizing() {
132} 131}
133 132
134void WorkspaceNameTool::reRender() { 133void WorkspaceNameTool::reRender() {
134 if (m_pixmap)
135 m_screen.imageControl().removeImage(m_pixmap);
136
135 if (m_theme->texture().usePixmap()) { 137 if (m_theme->texture().usePixmap()) {
136 if (m_pixmap)
137 m_screen.imageControl().removeImage(m_pixmap);
138 m_pixmap = m_screen.imageControl().renderImage(width(), height(), 138 m_pixmap = m_screen.imageControl().renderImage(width(), height(),
139 m_theme->texture(), orientation()); 139 m_theme->texture(), orientation());
140 m_button.setBackgroundPixmap(m_pixmap); 140 m_button.setBackgroundPixmap(m_pixmap);
141 } else {
142 m_pixmap = 0;
143 m_button.setBackgroundColor(m_theme->texture().color());
141 } 144 }
142} 145}
143 146
@@ -148,15 +151,7 @@ void WorkspaceNameTool::renderTheme(unsigned char alpha) {
148 m_button.setBorderColor(m_theme->border().color()); 151 m_button.setBorderColor(m_theme->border().color());
149 m_button.setAlpha(alpha); 152 m_button.setAlpha(alpha);
150 153
151 if (!m_theme->texture().usePixmap()) { 154 reRender();
152 if (m_pixmap)
153 m_screen.imageControl().removeImage(m_pixmap);
154 m_pixmap = 0;
155 m_button.setBackgroundColor(m_theme->texture().color());
156 } else {
157 reRender();
158 }
159
160 m_button.clear(); 155 m_button.clear();
161} 156}
162 157