border theme item
This commit is contained in:
parent
2f9ab86178
commit
eebfc5b889
1 changed files with 22 additions and 3 deletions
|
@ -20,7 +20,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: IconbarTool.cc,v 1.5 2003/08/12 12:16:28 fluxgen Exp $
|
// $Id: IconbarTool.cc,v 1.6 2003/08/13 09:57:40 fluxgen Exp $
|
||||||
|
|
||||||
#include "IconbarTool.hh"
|
#include "IconbarTool.hh"
|
||||||
|
|
||||||
|
@ -31,6 +31,9 @@
|
||||||
#include "IconButton.hh"
|
#include "IconButton.hh"
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScreen &screen):
|
IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScreen &screen):
|
||||||
ToolbarItem(ToolbarItem::RELATIVE),
|
ToolbarItem(ToolbarItem::RELATIVE),
|
||||||
m_screen(screen),
|
m_screen(screen),
|
||||||
|
@ -46,7 +49,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr
|
||||||
screen.currentWorkspaceSig().attach(this);
|
screen.currentWorkspaceSig().attach(this);
|
||||||
|
|
||||||
update(0);
|
update(0);
|
||||||
renderTheme();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IconbarTool::~IconbarTool() {
|
IconbarTool::~IconbarTool() {
|
||||||
|
@ -94,6 +97,10 @@ unsigned int IconbarTool::height() const {
|
||||||
return m_icon_container.height();
|
return m_icon_container.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int IconbarTool::borderWidth() const {
|
||||||
|
return m_icon_container.borderWidth();
|
||||||
|
}
|
||||||
|
|
||||||
void IconbarTool::update(FbTk::Subject *subj) {
|
void IconbarTool::update(FbTk::Subject *subj) {
|
||||||
// ignore updates if we're shutting down
|
// ignore updates if we're shutting down
|
||||||
if (m_screen.isShuttingdown())
|
if (m_screen.isShuttingdown())
|
||||||
|
@ -138,6 +145,7 @@ void IconbarTool::update(FbTk::Subject *subj) {
|
||||||
Workspace::Windows::iterator it = space.windowList().begin();
|
Workspace::Windows::iterator it = space.windowList().begin();
|
||||||
Workspace::Windows::iterator it_end = space.windowList().end();
|
Workspace::Windows::iterator it_end = space.windowList().end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
|
|
||||||
// we just want windows that has clients
|
// we just want windows that has clients
|
||||||
if ((*it)->clientList().size() == 0)
|
if ((*it)->clientList().size() == 0)
|
||||||
continue;
|
continue;
|
||||||
|
@ -209,11 +217,16 @@ void IconbarTool::renderTheme() {
|
||||||
if (tmp)
|
if (tmp)
|
||||||
m_screen.imageControl().removeImage(m_empty_pm);
|
m_screen.imageControl().removeImage(m_empty_pm);
|
||||||
|
|
||||||
|
m_icon_container.setBorderWidth(m_theme.border().width());
|
||||||
|
m_icon_container.setBorderColor(m_theme.border().color());
|
||||||
|
|
||||||
// update buttons
|
// update buttons
|
||||||
IconList::iterator icon_it = m_icon_list.begin();
|
IconList::iterator icon_it = m_icon_list.begin();
|
||||||
IconList::iterator icon_it_end = m_icon_list.end();
|
IconList::iterator icon_it_end = m_icon_list.end();
|
||||||
for (; icon_it != icon_it_end; ++icon_it)
|
for (; icon_it != icon_it_end; ++icon_it)
|
||||||
renderButton(*(*icon_it));
|
renderButton(*(*icon_it));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconbarTool::renderButton(IconButton &button) {
|
void IconbarTool::renderButton(IconButton &button) {
|
||||||
|
@ -228,6 +241,9 @@ void IconbarTool::renderButton(IconButton &button) {
|
||||||
else
|
else
|
||||||
button.setBackgroundColor(m_theme.focusedTexture().color());
|
button.setBackgroundColor(m_theme.focusedTexture().color());
|
||||||
|
|
||||||
|
button.setBorderWidth(m_theme.focusedBorder().width());
|
||||||
|
button.setBorderColor(m_theme.focusedBorder().color());
|
||||||
|
|
||||||
} else { // unfocused
|
} else { // unfocused
|
||||||
button.setGC(m_theme.unfocusedText().textGC());
|
button.setGC(m_theme.unfocusedText().textGC());
|
||||||
button.setFont(m_theme.unfocusedText().font());
|
button.setFont(m_theme.unfocusedText().font());
|
||||||
|
@ -237,6 +253,9 @@ void IconbarTool::renderButton(IconButton &button) {
|
||||||
button.setBackgroundPixmap(m_unfocused_pm);
|
button.setBackgroundPixmap(m_unfocused_pm);
|
||||||
else
|
else
|
||||||
button.setBackgroundColor(m_theme.unfocusedTexture().color());
|
button.setBackgroundColor(m_theme.unfocusedTexture().color());
|
||||||
|
|
||||||
|
button.setBorderWidth(m_theme.unfocusedBorder().width());
|
||||||
|
button.setBorderColor(m_theme.unfocusedBorder().color());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue