aboutsummaryrefslogtreecommitdiff
path: root/src/FocusableTheme.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusableTheme.hh')
-rw-r--r--src/FocusableTheme.hh18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/FocusableTheme.hh b/src/FocusableTheme.hh
index cc14e62..6643b43 100644
--- a/src/FocusableTheme.hh
+++ b/src/FocusableTheme.hh
@@ -34,12 +34,15 @@ public:
34 FocusableTheme(Focusable &win, FbTk::ThemeProxy<BaseTheme> &focused, 34 FocusableTheme(Focusable &win, FbTk::ThemeProxy<BaseTheme> &focused,
35 FbTk::ThemeProxy<BaseTheme> &unfocused): 35 FbTk::ThemeProxy<BaseTheme> &unfocused):
36 m_win(win), m_focused_theme(focused), m_unfocused_theme(unfocused) { 36 m_win(win), m_focused_theme(focused), m_unfocused_theme(unfocused) {
37 // relay focus signal to reconfig signal 37
38 FbTk::relaySignal(m_signals, m_win.focusSig(), m_reconfig_sig); 38 m_signals.join(m_win.focusSig(),
39 FbTk::MemFunIgnoreArgs(m_reconfig_sig, &FbTk::Signal<void>::emit));
39 40
40 m_win.attentionSig().attach(this); 41 m_win.attentionSig().attach(this);
41 m_focused_theme.reconfigSig().attach(this); 42 m_signals.join(m_focused_theme.reconfigSig(),
42 m_unfocused_theme.reconfigSig().attach(this); 43 FbTk::MemFun(m_reconfig_sig, &FbTk::Signal<void>::emit));
44 m_signals.join(m_unfocused_theme.reconfigSig(),
45 FbTk::MemFun(m_reconfig_sig, &FbTk::Signal<void>::emit));
43 } 46 }
44 47
45 Focusable &win() { return m_win; } 48 Focusable &win() { return m_win; }
@@ -51,8 +54,7 @@ public:
51 FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() { return m_unfocused_theme; } 54 FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() { return m_unfocused_theme; }
52 const FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() const { return m_unfocused_theme; } 55 const FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() const { return m_unfocused_theme; }
53 56
54 FbTk::Subject &reconfigSig() { return m_reconfig_sig; } 57 FbTk::Signal<void> &reconfigSig() { return m_reconfig_sig; }
55 const FbTk::Subject &reconfigSig() const { return m_reconfig_sig; }
56 58
57 virtual BaseTheme &operator *() { 59 virtual BaseTheme &operator *() {
58 return (m_win.isFocused() || m_win.getAttentionState()) ? 60 return (m_win.isFocused() || m_win.getAttentionState()) ?
@@ -64,11 +66,11 @@ public:
64 } 66 }
65 67
66private: 68private:
67 void update(FbTk::Subject *subj) { m_reconfig_sig.notify(); } 69 void update(FbTk::Subject *subj) { m_reconfig_sig.emit(); }
68 70
69 Focusable &m_win; 71 Focusable &m_win;
70 FbTk::ThemeProxy<BaseTheme> &m_focused_theme, &m_unfocused_theme; 72 FbTk::ThemeProxy<BaseTheme> &m_focused_theme, &m_unfocused_theme;
71 FbTk::Subject m_reconfig_sig; 73 FbTk::Signal<void> m_reconfig_sig;
72 FbTk::SignalTracker m_signals; 74 FbTk::SignalTracker m_signals;
73}; 75};
74 76