aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc4
-rw-r--r--src/FbTk/Menu.hh3
-rw-r--r--src/FbTk/MenuTheme.hh3
-rw-r--r--src/FbTk/Theme.cc2
-rw-r--r--src/FbTk/Theme.hh11
5 files changed, 11 insertions, 12 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 48636ce..da5760d 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -36,6 +36,7 @@
36#include "MenuItem.hh" 36#include "MenuItem.hh"
37#include "MenuSeparator.hh" 37#include "MenuSeparator.hh"
38#include "ImageControl.hh" 38#include "ImageControl.hh"
39#include "MemFun.hh"
39#include "MenuTheme.hh" 40#include "MenuTheme.hh"
40#include "App.hh" 41#include "App.hh"
41#include "EventManager.hh" 42#include "EventManager.hh"
@@ -121,7 +122,7 @@ Menu::Menu(FbTk::ThemeProxy<MenuTheme> &tm, ImageControl &imgctrl):
121 m_hide_timer.fireOnce(true); 122 m_hide_timer.fireOnce(true);
122 123
123 // make sure we get updated when the theme is reloaded 124 // make sure we get updated when the theme is reloaded
124 tm.reconfigSig().attach(this); 125 m_tracker.join(tm.reconfigSig(), MemFun(*this, &Menu::themeReconfigured));
125 126
126 m_title_vis = true; 127 m_title_vis = true;
127 128
@@ -1244,7 +1245,6 @@ void Menu::update(FbTk::Subject *subj) {
1244 reconfigure(); 1245 reconfigure();
1245} 1246}
1246 1247
1247
1248void Menu::setScreen(int x, int y, int w, int h) { 1248void Menu::setScreen(int x, int y, int w, int h) {
1249 m_screen_x = x; 1249 m_screen_x = x;
1250 m_screen_y = y; 1250 m_screen_y = y;
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index f3ec820..7b59cf7 100644
--- a/src/FbTk/Menu.hh
+++ b/src/FbTk/Menu.hh
@@ -195,6 +195,7 @@ private:
195 void closeMenu(); 195 void closeMenu();
196 void startHide(); 196 void startHide();
197 void stopHide(); 197 void stopHide();
198 void themeReconfigured() { update(NULL); }
198 199
199 FbTk::ThemeProxy<MenuTheme> &m_theme; 200 FbTk::ThemeProxy<MenuTheme> &m_theme;
200 Menu *m_parent; 201 Menu *m_parent;
@@ -261,6 +262,8 @@ private:
261 bool m_need_update; 262 bool m_need_update;
262 Timer m_submenu_timer; 263 Timer m_submenu_timer;
263 Timer m_hide_timer; 264 Timer m_hide_timer;
265
266 SignalTracker m_tracker;
264}; 267};
265 268
266} // end namespace FbTk 269} // end namespace FbTk
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh
index eb19798..b575860 100644
--- a/src/FbTk/MenuTheme.hh
+++ b/src/FbTk/MenuTheme.hh
@@ -130,8 +130,7 @@ public:
130 m_hl_selected_pixmap->pixmap().dontFree(); 130 m_hl_selected_pixmap->pixmap().dontFree();
131 } 131 }
132 132
133 virtual Subject &reconfigSig() { return Theme::reconfigSig(); } 133 virtual Signal<void> &reconfigSig() { return Theme::reconfigSig(); }
134 virtual const Subject &reconfigSig() const { return Theme::reconfigSig(); }
135 134
136 virtual MenuTheme &operator *() { return *this; } 135 virtual MenuTheme &operator *() { return *this; }
137 virtual const MenuTheme &operator *() const { return *this; } 136 virtual const MenuTheme &operator *() const { return *this; }
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index c92e563..c252275 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -56,7 +56,7 @@ struct LoadThemeHelper {
56 ThemeManager::ThemeList::iterator it = tmlist.begin(); 56 ThemeManager::ThemeList::iterator it = tmlist.begin();
57 ThemeManager::ThemeList::iterator it_end = tmlist.end(); 57 ThemeManager::ThemeList::iterator it_end = tmlist.end();
58 for (; it != it_end; ++it) { 58 for (; it != it_end; ++it) {
59 (*it)->reconfigSig().notify(); 59 (*it)->reconfigSig().emit();
60 } 60 }
61 } 61 }
62 62
diff --git a/src/FbTk/Theme.hh b/src/FbTk/Theme.hh
index c331ba5..c700f9b 100644
--- a/src/FbTk/Theme.hh
+++ b/src/FbTk/Theme.hh
@@ -26,8 +26,8 @@
26#ifndef FBTK_THEME_HH 26#ifndef FBTK_THEME_HH
27#define FBTK_THEME_HH 27#define FBTK_THEME_HH
28 28
29#include "Signal.hh"
29#include "XrmDatabaseHelper.hh" 30#include "XrmDatabaseHelper.hh"
30#include "Subject.hh"
31 31
32#include <string> 32#include <string>
33#include <list> 33#include <list>
@@ -107,15 +107,13 @@ public:
107 template <typename T> 107 template <typename T>
108 void remove(ThemeItem<T> &item); 108 void remove(ThemeItem<T> &item);
109 virtual bool fallback(ThemeItem_base &) { return false; } 109 virtual bool fallback(ThemeItem_base &) { return false; }
110 FbTk::Subject &reconfigSig() { return m_reconfig_sig; } 110 Signal<void> &reconfigSig() { return m_reconfig_sig; }
111 const FbTk::Subject &reconfigSig() const { return m_reconfig_sig; }
112
113 111
114private: 112private:
115 const int m_screen_num; 113 const int m_screen_num;
116 114
117 ItemList m_themeitems; 115 ItemList m_themeitems;
118 FbTk::Subject m_reconfig_sig; 116 Signal<void> m_reconfig_sig;
119}; 117};
120 118
121/// Proxy interface for themes, so they can be substituted dynamically 119/// Proxy interface for themes, so they can be substituted dynamically
@@ -124,8 +122,7 @@ class ThemeProxy {
124public: 122public:
125 virtual ~ThemeProxy() { } 123 virtual ~ThemeProxy() { }
126 124
127 virtual Subject &reconfigSig() = 0; 125 virtual Signal<void> &reconfigSig() = 0;
128 virtual const Subject &reconfigSig() const = 0;
129 126
130 virtual BaseTheme &operator *() = 0; 127 virtual BaseTheme &operator *() = 0;
131 virtual const BaseTheme &operator *() const = 0; 128 virtual const BaseTheme &operator *() const = 0;