fix initialization of WorkspaceNameTheme
Mark Tiefenbruck mark@fluxbox.org
2 files changed,
11 insertions(+),
13 deletions(-)
M
src/WorkspaceNameTheme.hh
→
src/WorkspaceNameTheme.hh
@@ -30,7 +30,10 @@ public FbTk::ThemeProxy<WorkspaceNameTheme> {
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") {
M
src/WorkspaceNameTool.cc
→
src/WorkspaceNameTool.cc
@@ -45,7 +45,6 @@ // setup signals
screen.workspaceNamesSig().attach(this); screen.currentWorkspaceSig().attach(this); theme.reconfigSig().attach(this); - } WorkspaceNameTool::~WorkspaceNameTool() {@@ -132,12 +131,16 @@ m_button.setBorderWidth(m_theme->border().width());
} 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 @@ m_button.setBorderWidth(m_theme->border().width());
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(); }