aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceNameTool.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-12 14:56:20 (GMT)
committerrathnor <rathnor>2004-09-12 14:56:20 (GMT)
commit42c1fd3ae3dd058e146b7350c65b74386123c25c (patch)
treecc549c2c7b12c87f8c33198f5b30f00d9dd30bc6 /src/WorkspaceNameTool.cc
parentc39234195a46cece2bdb18dfdde6c91c7a190dc4 (diff)
downloadfluxbox-42c1fd3ae3dd058e146b7350c65b74386123c25c.zip
fluxbox-42c1fd3ae3dd058e146b7350c65b74386123c25c.tar.bz2
preliminary support for composite/compositing manager. Also general work
for consistency with transparency resources
Diffstat (limited to 'src/WorkspaceNameTool.cc')
-rw-r--r--src/WorkspaceNameTool.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc
index 245fce5..1dc339f 100644
--- a/src/WorkspaceNameTool.cc
+++ b/src/WorkspaceNameTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: WorkspaceNameTool.cc,v 1.10 2004/08/29 08:33:13 rathnor Exp $ 23// $Id: WorkspaceNameTool.cc,v 1.11 2004/09/12 14:56:19 rathnor Exp $
24 24
25#include "WorkspaceNameTool.hh" 25#include "WorkspaceNameTool.hh"
26 26
@@ -46,7 +46,6 @@ WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent,
46 screen.currentWorkspaceSig().attach(this); 46 screen.currentWorkspaceSig().attach(this);
47 theme.reconfigSig().attach(this); 47 theme.reconfigSig().attach(this);
48 48
49 renderTheme();
50} 49}
51 50
52WorkspaceNameTool::~WorkspaceNameTool() { 51WorkspaceNameTool::~WorkspaceNameTool() {
@@ -74,7 +73,8 @@ void WorkspaceNameTool::update(FbTk::Subject *subj) {
74 resize(width(), height()); 73 resize(width(), height());
75 resizeSig().notify(); 74 resizeSig().notify();
76 } 75 }
77 renderTheme(); 76 reRender();
77 m_button.clear();
78} 78}
79 79
80unsigned int WorkspaceNameTool::width() const { 80unsigned int WorkspaceNameTool::width() const {
@@ -113,22 +113,29 @@ void WorkspaceNameTool::updateSizing() {
113 m_button.setBorderWidth(m_theme.border().width()); 113 m_button.setBorderWidth(m_theme.border().width());
114} 114}
115 115
116void WorkspaceNameTool::renderTheme() { 116void WorkspaceNameTool::reRender() {
117 Pixmap tmp = m_pixmap; 117 if (m_theme.texture().usePixmap()) {
118 if (m_pixmap)
119 m_screen.imageControl().removeImage(m_pixmap);
120 m_pixmap = m_screen.imageControl().renderImage(width(), height(),
121 m_theme.texture());
122 m_button.setBackgroundPixmap(m_pixmap);
123 }
124}
125
126void WorkspaceNameTool::renderTheme(unsigned char alpha) {
118 if (!m_theme.texture().usePixmap()) { 127 if (!m_theme.texture().usePixmap()) {
128 if (m_pixmap)
129 m_screen.imageControl().removeImage(m_pixmap);
119 m_pixmap = 0; 130 m_pixmap = 0;
120 m_button.setBackgroundColor(m_theme.texture().color()); 131 m_button.setBackgroundColor(m_theme.texture().color());
121 } else { 132 } else {
122 m_pixmap = m_screen.imageControl().renderImage(width(), height(), 133 reRender();
123 m_theme.texture());
124 m_button.setBackgroundPixmap(m_pixmap);
125 } 134 }
126 if (tmp)
127 m_screen.imageControl().removeImage(tmp);
128 135
129 m_button.setJustify(m_theme.justify()); 136 m_button.setJustify(m_theme.justify());
130 m_button.setBorderWidth(m_theme.border().width()); 137 m_button.setBorderWidth(m_theme.border().width());
131 m_button.setBorderColor(m_theme.border().color()); 138 m_button.setBorderColor(m_theme.border().color());
132 m_button.setAlpha(m_theme.alpha()); 139 m_button.setAlpha(alpha);
133 m_button.clear(); 140 m_button.clear();
134} 141}