fix initialization of WorkspaceNameTheme

This commit is contained in:
Mark Tiefenbruck 2008-01-12 17:42:52 -08:00
parent b302dab2f1
commit 5b7bde2ffb
2 changed files with 11 additions and 13 deletions

View file

@ -30,7 +30,10 @@ class WorkspaceNameTheme: public ToolTheme,
public:
WorkspaceNameTheme(int screen_num,
const std::string &name,
const std::string &alt_name):ToolTheme(screen_num, name, alt_name) { }
const std::string &alt_name):
ToolTheme(screen_num, name, alt_name) {
FbTk::ThemeManager::instance().loadTheme(*this);
}
bool fallback(FbTk::ThemeItem_base &item) {
if (item.name() == "toolbar.workspace.textColor") {

View file

@ -45,7 +45,6 @@ WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent,
screen.workspaceNamesSig().attach(this);
screen.currentWorkspaceSig().attach(this);
theme.reconfigSig().attach(this);
}
WorkspaceNameTool::~WorkspaceNameTool() {
@ -132,12 +131,16 @@ void WorkspaceNameTool::updateSizing() {
}
void WorkspaceNameTool::reRender() {
if (m_pixmap)
m_screen.imageControl().removeImage(m_pixmap);
if (m_theme->texture().usePixmap()) {
if (m_pixmap)
m_screen.imageControl().removeImage(m_pixmap);
m_pixmap = m_screen.imageControl().renderImage(width(), height(),
m_theme->texture(), orientation());
m_button.setBackgroundPixmap(m_pixmap);
} else {
m_pixmap = 0;
m_button.setBackgroundColor(m_theme->texture().color());
}
}
@ -148,15 +151,7 @@ void WorkspaceNameTool::renderTheme(unsigned char alpha) {
m_button.setBorderColor(m_theme->border().color());
m_button.setAlpha(alpha);
if (!m_theme->texture().usePixmap()) {
if (m_pixmap)
m_screen.imageControl().removeImage(m_pixmap);
m_pixmap = 0;
m_button.setBackgroundColor(m_theme->texture().color());
} else {
reRender();
}
reRender();
m_button.clear();
}