diff options
Diffstat (limited to 'src/WorkspaceNameTool.cc')
-rw-r--r-- | src/WorkspaceNameTool.cc | 19 |
1 files changed, 7 insertions, 12 deletions
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 | ||
51 | WorkspaceNameTool::~WorkspaceNameTool() { | 50 | WorkspaceNameTool::~WorkspaceNameTool() { |
@@ -132,12 +131,16 @@ void WorkspaceNameTool::updateSizing() { | |||
132 | } | 131 | } |
133 | 132 | ||
134 | void WorkspaceNameTool::reRender() { | 133 | void 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 | ||