aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceNameTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorkspaceNameTool.cc')
-rw-r--r--src/WorkspaceNameTool.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc
index 6c73df5..b6afad8 100644
--- a/src/WorkspaceNameTool.cc
+++ b/src/WorkspaceNameTool.cc
@@ -27,6 +27,7 @@
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
29#include "FbTk/ImageControl.hh" 29#include "FbTk/ImageControl.hh"
30#include "FbTk/MemFun.hh"
30 31
31#include <algorithm> 32#include <algorithm>
32 33
@@ -43,7 +44,10 @@ WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent,
43 44
44 // setup signals 45 // setup signals
45 screen.workspaceNamesSig().attach(this); 46 screen.workspaceNamesSig().attach(this);
46 screen.currentWorkspaceSig().attach(this); 47
48 join(screen.currentWorkspaceSig(),
49 FbTk::MemFun(*this, &WorkspaceNameTool::updateForScreen));
50
47 theme.reconfigSig().attach(this); 51 theme.reconfigSig().attach(this);
48} 52}
49 53
@@ -67,8 +71,11 @@ void WorkspaceNameTool::moveResize(int x, int y,
67} 71}
68 72
69void WorkspaceNameTool::update(FbTk::Subject *subj) { 73void WorkspaceNameTool::update(FbTk::Subject *subj) {
74 updateForScreen(m_screen);
75}
70 76
71 m_button.setText(m_screen.currentWorkspace()->name()); 77void WorkspaceNameTool::updateForScreen(BScreen &screen) {
78 m_button.setText(screen.currentWorkspace()->name());
72 if (m_button.width() != width()) { 79 if (m_button.width() != width()) {
73 resize(width(), height()); 80 resize(width(), height());
74 resizeSig().notify(); 81 resizeSig().notify();