aboutsummaryrefslogtreecommitdiff
path: root/src/ClockTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClockTool.cc')
-rw-r--r--src/ClockTool.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index 257058f..6642985 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -28,6 +28,7 @@
28#include "CommandDialog.hh" 28#include "CommandDialog.hh"
29#include "fluxbox.hh" 29#include "fluxbox.hh"
30 30
31#include "FbTk/MemFun.hh"
31#include "FbTk/SimpleCommand.hh" 32#include "FbTk/SimpleCommand.hh"
32#include "FbTk/ImageControl.hh" 33#include "FbTk/ImageControl.hh"
33#include "FbTk/TextUtils.hh" 34#include "FbTk/TextUtils.hh"
@@ -168,7 +169,7 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent,
168 screen.name() + ".strftimeFormat", screen.altName() + ".StrftimeFormat"), 169 screen.name() + ".strftimeFormat", screen.altName() + ".StrftimeFormat"),
169 m_stringconvertor(FbTk::StringConvertor::ToFbString) { 170 m_stringconvertor(FbTk::StringConvertor::ToFbString) {
170 // attach signals 171 // attach signals
171 theme.reconfigSig().attach(this); 172 m_tracker.join(theme.reconfigSig(), FbTk::MemFun(*this, &ClockTool::themeReconfigured));
172 173
173 std::string time_locale = setlocale(LC_TIME, NULL); 174 std::string time_locale = setlocale(LC_TIME, NULL);
174 size_t pos = time_locale.find('.'); 175 size_t pos = time_locale.find('.');
@@ -197,7 +198,7 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent,
197 menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd); 198 menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd);
198 199
199 200
200 update(0); 201 themeReconfigured();
201} 202}
202 203
203ClockTool::~ClockTool() { 204ClockTool::~ClockTool() {
@@ -233,10 +234,10 @@ void ClockTool::hide() {
233 234
234void ClockTool::setTimeFormat(const std::string &format) { 235void ClockTool::setTimeFormat(const std::string &format) {
235 *m_timeformat = format; 236 *m_timeformat = format;
236 update(0); 237 themeReconfigured();
237} 238}
238 239
239void ClockTool::update(FbTk::Subject *subj) { 240void ClockTool::themeReconfigured() {
240 updateTime(); 241 updateTime();
241 242
242 // + 2 to make the entire text fit inside 243 // + 2 to make the entire text fit inside
@@ -316,7 +317,7 @@ void ClockTool::updateTime() {
316void ClockTool::updateSizing() { 317void ClockTool::updateSizing() {
317 m_button.setBorderWidth(m_theme->border().width()); 318 m_button.setBorderWidth(m_theme->border().width());
318 // resizes if new timeformat 319 // resizes if new timeformat
319 update(0); 320 themeReconfigured();
320} 321}
321 322
322void ClockTool::reRender() { 323void ClockTool::reRender() {