From 5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 12 Jan 2008 17:42:52 -0800 Subject: fix initialization of WorkspaceNameTheme --- src/WorkspaceNameTheme.hh | 5 ++++- src/WorkspaceNameTool.cc | 19 +++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/WorkspaceNameTheme.hh b/src/WorkspaceNameTheme.hh index e4f426f..e90ef01 100644 --- a/src/WorkspaceNameTheme.hh +++ b/src/WorkspaceNameTheme.hh @@ -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") { diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc index 79ac724..6c73df5 100644 --- a/src/WorkspaceNameTool.cc +++ b/src/WorkspaceNameTool.cc @@ -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(); } -- cgit v0.11.2