aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-13 08:33:14 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-07-13 08:33:14 (GMT)
commita13f6ba94c2a52966ea0a37edb5a9fa798568052 (patch)
tree3ac18d91a33966d9207ad66c54685f7b24f27de5 /src
parentc63a2294d884151d5538d6ead319a76dc41abba6 (diff)
downloadfluxbox_pavel-a13f6ba94c2a52966ea0a37edb5a9fa798568052.zip
fluxbox_pavel-a13f6ba94c2a52966ea0a37edb5a9fa798568052.tar.bz2
Emit the "modified" signal when a resource value is changed through C++ code
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Resource.hh8
-rw-r--r--src/IconbarTool.cc3
-rw-r--r--src/IconbarTool.hh2
-rw-r--r--src/Screen.cc5
-rw-r--r--src/Window.cc2
5 files changed, 12 insertions, 8 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh
index 37a7ed3..7a797a1 100644
--- a/src/FbTk/Resource.hh
+++ b/src/FbTk/Resource.hh
@@ -224,7 +224,11 @@ public:
224 setDefaultValue(); 224 setDefaultValue();
225 } 225 }
226 } 226 }
227 Accessor<T> &operator =(const T& newvalue) { m_value = newvalue; return *this;} 227 Accessor<T> &operator =(const T& newvalue) {
228 m_value = newvalue;
229 m_modified_sig.emit(m_value);
230 return *this;
231 }
228 /// specialized, must be implemented 232 /// specialized, must be implemented
229 /// @return string value of resource 233 /// @return string value of resource
230 std::string getString() const { return Traits::toString(m_value); } 234 std::string getString() const { return Traits::toString(m_value); }
@@ -243,7 +247,7 @@ public:
243 247
244 operator T() const { return m_value; } 248 operator T() const { return m_value; }
245 T& get() { return m_value; } 249 T& get() { return m_value; }
246 T& operator*() { return m_value; } 250 Accessor<T>& operator*() { return *this; }
247 const T& operator*() const { return m_value; } 251 const T& operator*() const { return m_value; }
248 T *operator->() { return &m_value; } 252 T *operator->() { return &m_value; }
249 const T *operator->() const { return &m_value; } 253 const T *operator->() const { return &m_value; }
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index 070e45b..73f0003 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -242,7 +242,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
242 screen.name() + ".iconbar.mode"), 242 screen.name() + ".iconbar.mode"),
243 m_rc_alignment(screen.resourceManager(), FbTk::Container::RELATIVE, 243 m_rc_alignment(screen.resourceManager(), FbTk::Container::RELATIVE,
244 screen.name() + ".iconbar.alignment"), 244 screen.name() + ".iconbar.alignment"),
245 m_rc_client_width(screen.resourceManager(), 128, screen.name() + ".iconbar.iconWidth"), 245 m_rc_client_width(screen.resourceManager(), 128, screen.name() + ".iconbar.iconWidth", FbTk::RangedIntTraits(10, 400)),
246 m_rc_client_padding(screen.resourceManager(), 10, 246 m_rc_client_padding(screen.resourceManager(), 10,
247 screen.name() + ".iconbar.iconTextPadding"), 247 screen.name() + ".iconbar.iconTextPadding"),
248 m_rc_use_pixmap(screen.resourceManager(), true, screen.name() + ".iconbar.usePixmap"), 248 m_rc_use_pixmap(screen.resourceManager(), true, screen.name() + ".iconbar.usePixmap"),
@@ -380,7 +380,6 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) {
380 380
381 m_icon_container.setAlignment(*m_rc_alignment); 381 m_icon_container.setAlignment(*m_rc_alignment);
382 382
383 *m_rc_client_width = FbTk::Util::clamp(*m_rc_client_width, 10, 400);
384 m_icon_container.setMaxSizePerClient(*m_rc_client_width); 383 m_icon_container.setMaxSizePerClient(*m_rc_client_width);
385 384
386 // lock graphic update 385 // lock graphic update
diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
index 754cd50..9091a91 100644
--- a/src/IconbarTool.hh
+++ b/src/IconbarTool.hh
@@ -113,7 +113,7 @@ private:
113 FbTk::StringResource m_rc_mode; 113 FbTk::StringResource m_rc_mode;
114 /// alignment of buttons 114 /// alignment of buttons
115 FbTk::Resource<FbTk::Container::Alignment, FbTk::EnumTraits<FbTk::Container::Alignment> > m_rc_alignment; 115 FbTk::Resource<FbTk::Container::Alignment, FbTk::EnumTraits<FbTk::Container::Alignment> > m_rc_alignment;
116 FbTk::IntResource m_rc_client_width; ///< size of client button in LEFT/RIGHT mode 116 FbTk::RangedIntResource m_rc_client_width; ///< size of client button in LEFT/RIGHT mode
117 FbTk::UIntResource m_rc_client_padding; ///< padding of the text 117 FbTk::UIntResource m_rc_client_padding; ///< padding of the text
118 FbTk::BoolResource m_rc_use_pixmap; ///< if iconbar should use win pixmap or not 118 FbTk::BoolResource m_rc_use_pixmap; ///< if iconbar should use win pixmap or not
119 FbTk::RefCount<FbMenu> m_menu; 119 FbTk::RefCount<FbMenu> m_menu;
diff --git a/src/Screen.cc b/src/Screen.cc
index edfd298..73ec8b2 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -830,7 +830,7 @@ void BScreen::reconfigure() {
830 830
831 // and update their names 831 // and update their names
832 for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i) 832 for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i)
833 m_workspaces_list[i]->setName( (*resource.workspace_names)[i] ); 833 m_workspaces_list[i]->setName( resource.workspace_names.get()[i] );
834 834
835 // update menu filenames 835 // update menu filenames
836 m_rootmenu->reloadHelper()->setMainFile(fluxbox->getMenuFilename()); 836 m_rootmenu->reloadHelper()->setMainFile(fluxbox->getMenuFilename());
@@ -870,7 +870,8 @@ void BScreen::reconfigureTabs() {
870void BScreen::updateWorkspaceName(unsigned int w) { 870void BScreen::updateWorkspaceName(unsigned int w) {
871 Workspace *space = getWorkspace(w); 871 Workspace *space = getWorkspace(w);
872 if (space) { 872 if (space) {
873 (*resource.workspace_names)[w] = space->name(); 873 resource.workspace_names.get()[w] = space->name();
874 // XXX use resource.workspace_names.modifiedSig() instead
874 m_workspacenames_sig.emit(*this); 875 m_workspacenames_sig.emit(*this);
875 Fluxbox::instance()->save_rc(); 876 Fluxbox::instance()->save_rc();
876 } 877 }
diff --git a/src/Window.cc b/src/Window.cc
index 95bf9b3..fc15647 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3506,7 +3506,7 @@ void FluxboxWindow::updateButtons() {
3506 need_update = true; 3506 need_update = true;
3507 else { 3507 else {
3508 for (size_t j=0; j < new_size && !need_update; j++) { 3508 for (size_t j=0; j < new_size && !need_update; j++) {
3509 if ((*(*titlebar_side[i]))[j] != m_titlebar_buttons[i][j]) 3509 if ((*titlebar_side[i]).get()[j] != m_titlebar_buttons[i][j])
3510 need_update = true; 3510 need_update = true;
3511 } 3511 }
3512 } 3512 }