all repos — fluxbox @ 06a66cc30446945e9d2a440de2b9a9e9f6561ead

custom fork of the fluxbox windowmanager

fix some style initialisation issues
rathnor rathnor
commit

06a66cc30446945e9d2a440de2b9a9e9f6561ead

parent

b08d4232bb7e8ad2bfcb370ba61f7a4d001775d6

4 files changed, 53 insertions(+), 32 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.5: *03/08/25: + * Fix some style initialisation issues (Simon) + Screen.hh/cc FbWinFrame.cc * Added window icon for FbRun (Henrik) fbrun.xpm, FbRun.hh/cc *03/08/24:
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.41 2003/08/24 15:39:52 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.42 2003/08/25 13:15:53 rathnor Exp $ #include "FbWinFrame.hh"

@@ -1039,10 +1039,19 @@ if (m_use_handle)

bw_changes += (signed) borderW - handle().borderWidth(); window().setBorderWidth(borderW); + //window().setBorderColor(theme().borderColor()); + titlebar().setBorderWidth(borderW); + //titlebar().setBorderColor(theme().borderColor()); + handle().setBorderWidth(borderW); + //handle().setBorderColor(theme().borderColor()); + gripLeft().setBorderWidth(borderW); + //gripLeft().setBorderColor(theme().borderColor()); + gripRight().setBorderWidth(borderW); + //gripRight().setBorderColor(theme().borderColor()); if (bw_changes != 0) resize(width(), height() + bw_changes);
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,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: Screen.cc,v 1.225 2003/08/24 13:07:01 fluxgen Exp $ +// $Id: Screen.cc,v 1.226 2003/08/25 13:15:53 rathnor Exp $ #include "Screen.hh"

@@ -331,6 +331,14 @@

// load this screens resources fluxbox->load_rc(*this); + FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); + +#ifdef SLIT + if (slit()) // this will load theme and reconfigure slit + FbTk::ThemeManager::instance().loadTheme(slit()->theme()); +#endif // SLIT + + m_menutheme->setAlpha(*resource.menu_alpha); imageControl().setDither(*resource.image_dither);

@@ -345,17 +353,16 @@

// create geometry window - const char *s = i18n->getMessage(FBNLS::ScreenSet, FBNLS::ScreenPositionLength, - "W: 0000 x H: 0000"); - - int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2; - int geom_w = winFrameTheme().font().textWidth(s, strlen(s)) + m_root_theme->bevelWidth()*2; + int geom_h = 10; + int geom_w = 100; // just initial, will be fixed in render XSetWindowAttributes attrib; unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; attrib.border_pixel = m_root_theme->borderColor().pixel(); attrib.colormap = rootWindow().colormap(); attrib.save_under = true; + + winFrameTheme().reconfigSig().attach(this);// for geom window m_geom_window = XCreateWindow(disp, rootWindow().window(),

@@ -416,13 +423,6 @@ // create and initiate rootmenu

rereadMenu(); m_configmenu->update(); - -#ifdef SLIT - if (slit()) // this will load theme and reconfigure slit - FbTk::ThemeManager::instance().loadTheme(slit()->theme()); -#endif // SLIT - - FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); // start with workspace 0 changeWorkspaceID(0);

@@ -584,6 +584,13 @@ else

return doFullMax() ? height() : height() - m_available_workspace_area->bottom(); } +void BScreen::update(FbTk::Subject *subj) { + // for now we're only listening to the theme sig, so no object check + // if another signal is added later, will need to differentiate here + + renderGeomWindow(); +} + void BScreen::reconfigure() { m_menutheme->setAlpha(*resource.menu_alpha); Fluxbox::instance()->loadRootCommand(*this);

@@ -597,22 +604,7 @@ // load theme

// std::string theme_filename(Fluxbox::instance()->getStyleFilename()); // FbTk::ThemeManager::instance().load(theme_filename.c_str()); - I18n *i18n = I18n::instance(); - - const char *s = i18n->getMessage(FBNLS::ScreenSet, - FBNLS::ScreenPositionLength, - "W: 0000 x H: 0000"); - int l = strlen(s); - - //TODO: repeated from somewhere else? - int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2; - int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2; - m_geom_window.resize(geom_w, geom_h); - renderGeomWindow(); - - m_geom_window.setBorderWidth(m_root_theme->borderWidth()); - m_geom_window.setBorderColor(m_root_theme->borderColor()); //reconfigure menus workspacemenu->reconfigure();

@@ -2163,6 +2155,20 @@ );

} void BScreen::renderGeomWindow() { + + const char *s = I18n::instance()->getMessage(FBNLS::ScreenSet, + FBNLS::ScreenPositionLength, + "W: 0000 x H: 0000"); + int l = strlen(s); + + int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2; + int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2; + m_geom_window.resize(geom_w, geom_h); + + m_geom_window.setBorderWidth(m_root_theme->borderWidth()); + m_geom_window.setBorderColor(m_root_theme->borderColor()); + + Pixmap tmp = geom_pixmap; if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) {
M src/Screen.hhsrc/Screen.hh

@@ -22,7 +22,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: Screen.hh,v 1.122 2003/08/24 13:06:38 fluxgen Exp $ +// $Id: Screen.hh,v 1.123 2003/08/25 13:15:53 rathnor Exp $ #ifndef SCREEN_HH #define SCREEN_HH

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

#include "MultLayers.hh" #include "FbRootWindow.hh" #include "NotCopyable.hh" +#include "Observer.hh" #include "fluxbox.hh" #include "MenuTheme.hh"

@@ -59,13 +60,14 @@ class Menu;

class ImageControl; class XLayerItem; class FbWindow; +class Subject; }; /// Handles screen connection, screen clients and workspaces /** Create workspaces, handles switching between workspaces and windows */ -class BScreen : private FbTk::NotCopyable { +class BScreen : public FbTk::Observer, private FbTk::NotCopyable { public: typedef std::vector<Workspace *> Workspaces; typedef std::vector<std::string> WorkspaceNames;

@@ -153,7 +155,9 @@ /// reconfigure signal

FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } FbTk::Subject &resizeSig() { return m_resize_sig; } //@} - + + void update(FbTk::Subject *subj); + /// @return the resource value of number of workspace inline int getNumberOfWorkspaces() const { return *resource.workspaces; }