all repos — fluxbox @ 96c49e2d0d103d9a4d6e5a12e33fc4f7ab83c24e

custom fork of the fluxbox windowmanager

added theme listener
fluxgen fluxgen
commit

96c49e2d0d103d9a4d6e5a12e33fc4f7ab83c24e

parent

fead9f1578b63b4341308f9ea36e237b7bdca1ae

2 files changed, 22 insertions(+), 6 deletions(-)

jump to
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.5 2003/01/12 20:31:54 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.6 2003/02/15 01:54:54 fluxgen Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh"

@@ -63,7 +63,9 @@ m_clientwin(0),

m_bevel(1), m_use_titlebar(true), m_use_handle(true), - m_button_pm(0) { + m_button_pm(0), + m_themelistener(*this) { + theme.addListener(m_themelistener); init(); } /*
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.3 2003/01/09 22:00:34 fluxgen Exp $ +// $Id: FbWinFrame.hh,v 1.4 2003/02/15 01:54:18 fluxgen Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH

@@ -32,6 +32,7 @@ #include "Text.hh"

#include "FbWinFrameTheme.hh" #include "RefCount.hh" #include "Command.hh" +#include "Observer.hh" #include <vector> #include <string>

@@ -46,11 +47,13 @@ class FbWinFrame:public FbTk::EventHandler {

public: /// create a top level window - FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, int screen_num, int x, int y, + FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, + int screen_num, int x, int y, unsigned int width, unsigned int height); /// create a frame window inside another FbWindow, NOT IMPLEMENTED! - FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, const FbTk::FbWindow &parent, + FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, + const FbTk::FbWindow &parent, int x, int y, unsigned int width, unsigned int height);

@@ -236,7 +239,18 @@ FbTk::RefCount<FbTk::Command> click; ///< what to do when we release mouse button

FbTk::RefCount<FbTk::Command> click_pressed; ///< what to do when we press mouse button FbTk::RefCount<FbTk::Command> double_click; ///< what to do when we double click }; - MouseButtonAction m_commands[5]; ///< hardcoded to five ...TODO, change this + MouseButtonAction m_commands[5]; ///< hardcoded to five ... //!! TODO, change this + + class ThemeListener: public FbTk::Observer { + public: + ThemeListener(FbWinFrame &frame):m_frame(frame) { } + void update(FbTk::Subject *subj) { + m_frame.reconfigure(); + } + private: + FbWinFrame &m_frame; + }; + ThemeListener m_themelistener; }; #endif // FBWINFRAME_HH