From 4d48f7576bb73e3a3f4c1378249389ac0040652d Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 13 May 2006 16:22:30 +0000 Subject: added one more render option for renderButton, force render of focused. Listening to attention signal from Window. --- src/IconbarTool.cc | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 82fdf26..a0e0beb 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc @@ -596,6 +596,14 @@ void IconbarTool::update(FbTk::Subject *subj) { return; + } else if (subj == &(winsubj->win().attentionSig())) { + // render with titlebar focus, on attention + IconButton *button = findButton(winsubj->win()); + if (button) { + renderButton(*button, true, + winsubj->win().frame().focused() ? 1 : 0); + } + return; } else { // signal not handled return; @@ -659,14 +667,14 @@ IconButton *IconbarTool::findButton(FluxboxWindow &win) { return 0; } - +/* void IconbarTool::renderWindow(FluxboxWindow &win) { IconButton *button = findButton(win); if (button == 0) return; renderButton(*button); } - +*/ void IconbarTool::updateSizing() { m_icon_container.setBorderWidth(m_theme.border().width()); @@ -771,7 +779,8 @@ void IconbarTool::renderTheme() { } } -void IconbarTool::renderButton(IconButton &button, bool clear) { +void IconbarTool::renderButton(IconButton &button, bool clear, + int focusOption) { button.setPixmap(*m_rc_use_pixmap); button.setAlpha(m_alpha); @@ -788,8 +797,13 @@ void IconbarTool::renderButton(IconButton &button, bool clear) { // button.height() != m_icon_container.back()->height()); } - if (button.win().isFocused()) { // focused texture - m_icon_container.setSelected(m_icon_container.find(&button)); + if (focusOption == 1 || + (focusOption == -1 && + button.win().isFocused())) { + + // focused texture + if (button.win().isFocused()) + m_icon_container.setSelected(m_icon_container.find(&button)); button.setGC(m_theme.focusedText().textGC()); button.setFont(m_theme.focusedText().font()); @@ -891,7 +905,7 @@ void IconbarTool::addWindow(FluxboxWindow &win) { win.dieSig().attach(this); win.workspaceSig().attach(this); win.stateSig().attach(this); - + win.attentionSig().attach(this); } void IconbarTool::updateIcons() { -- cgit v0.11.2