aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-12 11:09:46 (GMT)
committerfluxgen <fluxgen>2003-08-12 11:09:46 (GMT)
commit680407c294b9de22f357b6667ccbc580105b7ce1 (patch)
tree47f1fcf3916f425e54940cf8c75662d82c44e0b0
parent6e776536f4a7b5fafc81dfde262ce427d5793688 (diff)
downloadfluxbox-680407c294b9de22f357b6667ccbc580105b7ce1.zip
fluxbox-680407c294b9de22f357b6667ccbc580105b7ce1.tar.bz2
optimized focus change rendering
-rw-r--r--src/IconbarTool.cc43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index c699f84..526817a 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.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: IconbarTool.cc,v 1.3 2003/08/12 01:01:16 fluxgen Exp $ 23// $Id: IconbarTool.cc,v 1.4 2003/08/12 11:09:46 fluxgen Exp $
24 24
25#include "IconbarTool.hh" 25#include "IconbarTool.hh"
26 26
@@ -48,8 +48,8 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr
48 m_unfocused_pm(0), 48 m_unfocused_pm(0),
49 m_empty_pm(0) { 49 m_empty_pm(0) {
50 50
51 // setup signals
51 theme.reconfigSig().attach(this); 52 theme.reconfigSig().attach(this);
52
53 screen.clientListSig().attach(this); 53 screen.clientListSig().attach(this);
54 screen.currentWorkspaceSig().attach(this); 54 screen.currentWorkspaceSig().attach(this);
55 55
@@ -112,7 +112,7 @@ void IconbarTool::update(FbTk::Subject *subj) {
112 // we handle everything except die signal here 112 // we handle everything except die signal here
113 FluxboxWindow::WinSubject *winsubj = static_cast<FluxboxWindow::WinSubject *>(subj); 113 FluxboxWindow::WinSubject *winsubj = static_cast<FluxboxWindow::WinSubject *>(subj);
114 if (subj != &(winsubj->win().dieSig())) { 114 if (subj != &(winsubj->win().dieSig())) {
115 renderTheme(); 115 renderButton(winsubj->win());
116 return; 116 return;
117 } 117 }
118 } 118 }
@@ -152,6 +152,43 @@ void IconbarTool::update(FbTk::Subject *subj) {
152 renderTheme(); 152 renderTheme();
153} 153}
154 154
155void IconbarTool::renderButton(FluxboxWindow &win) {
156
157 IconList::iterator icon_it = m_icon_list.begin();
158 IconList::iterator icon_it_end = m_icon_list.end();
159 for (; icon_it != icon_it_end; ++icon_it) {
160 if (&(*icon_it)->win() == &win)
161 break;
162 }
163 if (icon_it == m_icon_list.end())
164 return;
165
166 IconButton &button = *(*icon_it);
167
168 if (button.win().isFocused()) { // focused texture
169 button.setGC(m_theme.focusedText().textGC());
170 button.setFont(m_theme.focusedText().font());
171 button.setJustify(m_theme.focusedText().justify());
172
173 if (m_focused_pm != 0)
174 button.setBackgroundPixmap(m_focused_pm);
175 else
176 button.setBackgroundColor(m_theme.focusedTexture().color());
177
178
179 } else { // unfocused
180 button.setGC(m_theme.unfocusedText().textGC());
181 button.setFont(m_theme.unfocusedText().font());
182 button.setJustify(m_theme.unfocusedText().justify());
183
184 if (m_unfocused_pm != 0)
185 button.setBackgroundPixmap(m_unfocused_pm);
186 else
187 button.setBackgroundColor(m_theme.unfocusedTexture().color());
188 }
189
190}
191
155void IconbarTool::renderTheme() { 192void IconbarTool::renderTheme() {
156 Pixmap tmp = m_focused_pm; 193 Pixmap tmp = m_focused_pm;
157 if (m_theme.focusedTexture().type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 194 if (m_theme.focusedTexture().type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {