From e90cbd35e0fa3deb864e7fcd8777de0ab56c6013 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 29 Aug 2003 10:30:46 +0000 Subject: slit as an observer --- src/Slit.cc | 12 +++++++++--- src/Slit.hh | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index fa03f53..a9a3f35 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.78 2003/08/15 13:50:42 fluxgen Exp $ +// $Id: Slit.cc,v 1.79 2003/08/29 10:30:46 fluxgen Exp $ #include "Slit.hh" @@ -260,9 +260,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x m_layeritem(0), - m_slit_theme(new SlitTheme(*this)), + m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())), m_strut(0), - // resources // lock in first resource m_rc_auto_hide(scr.resourceManager().lock(), false, @@ -281,6 +280,9 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) m_rc_layernum(scr.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDockLayer()), scr.name() + ".slit.layer", scr.altName() + ".Slit.Layer") { + // attach to theme and root window change signal + m_slit_theme->reconfigSig().attach(this); + scr.resizeSig().attach(this); frame.pixmap = None; // setup timer @@ -1082,6 +1084,10 @@ void Slit::exposeEvent(XExposeEvent &ev) { } } +void Slit::update(FbTk::Subject *subj) { + reconfigure(); +} + void Slit::clearWindow() { frame.window.clear(); if (m_transp.get()) { diff --git a/src/Slit.hh b/src/Slit.hh index 9b844e2..4209501 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -/// $Id: Slit.hh,v 1.37 2003/08/11 16:02:38 fluxgen Exp $ +/// $Id: Slit.hh,v 1.38 2003/08/29 10:30:46 fluxgen Exp $ #ifndef SLIT_HH #define SLIT_HH @@ -47,7 +47,7 @@ class FbMenu; class Strut; /// Handles dock apps -class Slit: public FbTk::EventHandler { +class Slit: public FbTk::EventHandler, public FbTk::Observer { public: /** @@ -88,6 +88,8 @@ public: void configureRequestEvent(XConfigureRequestEvent &event); void exposeEvent(XExposeEvent &event); //@} + + void update(FbTk::Subject *subj); void moveToLayer(int layernum); void toggleHidden(); -- cgit v0.11.2