aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-08-25 13:15:53 (GMT)
committerrathnor <rathnor>2003-08-25 13:15:53 (GMT)
commit06a66cc30446945e9d2a440de2b9a9e9f6561ead (patch)
tree42042068d7b6f1a3a94cd9977ebdc76b103811b5
parentb08d4232bb7e8ad2bfcb370ba61f7a4d001775d6 (diff)
downloadfluxbox-06a66cc30446945e9d2a440de2b9a9e9f6561ead.zip
fluxbox-06a66cc30446945e9d2a440de2b9a9e9f6561ead.tar.bz2
fix some style initialisation issues
-rw-r--r--ChangeLog2
-rw-r--r--src/FbWinFrame.cc11
-rw-r--r--src/Screen.cc62
-rw-r--r--src/Screen.hh10
4 files changed, 53 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index b73f129..17adaa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.5: 2Changes for 0.9.5:
3*03/08/25: 3*03/08/25:
4 * Fix some style initialisation issues (Simon)
5 Screen.hh/cc FbWinFrame.cc
4 * Added window icon for FbRun (Henrik) 6 * Added window icon for FbRun (Henrik)
5 fbrun.xpm, FbRun.hh/cc 7 fbrun.xpm, FbRun.hh/cc
6*03/08/24: 8*03/08/24:
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index ac1db09..de87299 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.41 2003/08/24 15:39:52 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.42 2003/08/25 13:15:53 rathnor Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -1039,10 +1039,19 @@ void FbWinFrame::setBorderWidth(unsigned int borderW) {
1039 bw_changes += (signed) borderW - handle().borderWidth(); 1039 bw_changes += (signed) borderW - handle().borderWidth();
1040 1040
1041 window().setBorderWidth(borderW); 1041 window().setBorderWidth(borderW);
1042 //window().setBorderColor(theme().borderColor());
1043
1042 titlebar().setBorderWidth(borderW); 1044 titlebar().setBorderWidth(borderW);
1045 //titlebar().setBorderColor(theme().borderColor());
1046
1043 handle().setBorderWidth(borderW); 1047 handle().setBorderWidth(borderW);
1048 //handle().setBorderColor(theme().borderColor());
1049
1044 gripLeft().setBorderWidth(borderW); 1050 gripLeft().setBorderWidth(borderW);
1051 //gripLeft().setBorderColor(theme().borderColor());
1052
1045 gripRight().setBorderWidth(borderW); 1053 gripRight().setBorderWidth(borderW);
1054 //gripRight().setBorderColor(theme().borderColor());
1046 1055
1047 if (bw_changes != 0) 1056 if (bw_changes != 0)
1048 resize(width(), height() + bw_changes); 1057 resize(width(), height() + bw_changes);
diff --git a/src/Screen.cc b/src/Screen.cc
index 285d30a..eeba710 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.225 2003/08/24 13:07:01 fluxgen Exp $ 25// $Id: Screen.cc,v 1.226 2003/08/25 13:15:53 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -331,6 +331,14 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
331 // load this screens resources 331 // load this screens resources
332 fluxbox->load_rc(*this); 332 fluxbox->load_rc(*this);
333 333
334 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename());
335
336#ifdef SLIT
337 if (slit()) // this will load theme and reconfigure slit
338 FbTk::ThemeManager::instance().loadTheme(slit()->theme());
339#endif // SLIT
340
341
334 m_menutheme->setAlpha(*resource.menu_alpha); 342 m_menutheme->setAlpha(*resource.menu_alpha);
335 343
336 imageControl().setDither(*resource.image_dither); 344 imageControl().setDither(*resource.image_dither);
@@ -345,11 +353,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
345 353
346 // create geometry window 354 // create geometry window
347 355
348 const char *s = i18n->getMessage(FBNLS::ScreenSet, FBNLS::ScreenPositionLength, 356 int geom_h = 10;
349 "W: 0000 x H: 0000"); 357 int geom_w = 100; // just initial, will be fixed in render
350
351 int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2;
352 int geom_w = winFrameTheme().font().textWidth(s, strlen(s)) + m_root_theme->bevelWidth()*2;
353 358
354 XSetWindowAttributes attrib; 359 XSetWindowAttributes attrib;
355 unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; 360 unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder;
@@ -357,6 +362,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
357 attrib.colormap = rootWindow().colormap(); 362 attrib.colormap = rootWindow().colormap();
358 attrib.save_under = true; 363 attrib.save_under = true;
359 364
365 winFrameTheme().reconfigSig().attach(this);// for geom window
366
360 m_geom_window = 367 m_geom_window =
361 XCreateWindow(disp, rootWindow().window(), 368 XCreateWindow(disp, rootWindow().window(),
362 0, 0, geom_w, geom_h, rootTheme().borderWidth(), rootWindow().depth(), 369 0, 0, geom_w, geom_h, rootTheme().borderWidth(), rootWindow().depth(),
@@ -417,13 +424,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
417 424
418 m_configmenu->update(); 425 m_configmenu->update();
419 426
420#ifdef SLIT
421 if (slit()) // this will load theme and reconfigure slit
422 FbTk::ThemeManager::instance().loadTheme(slit()->theme());
423#endif // SLIT
424
425 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename());
426
427 // start with workspace 0 427 // start with workspace 0
428 changeWorkspaceID(0); 428 changeWorkspaceID(0);
429 updateNetizenWorkspaceCount(); 429 updateNetizenWorkspaceCount();
@@ -584,6 +584,13 @@ unsigned int BScreen::maxBottom(int head) const {
584 return doFullMax() ? height() : height() - m_available_workspace_area->bottom(); 584 return doFullMax() ? height() : height() - m_available_workspace_area->bottom();
585} 585}
586 586
587void BScreen::update(FbTk::Subject *subj) {
588 // for now we're only listening to the theme sig, so no object check
589 // if another signal is added later, will need to differentiate here
590
591 renderGeomWindow();
592}
593
587void BScreen::reconfigure() { 594void BScreen::reconfigure() {
588 m_menutheme->setAlpha(*resource.menu_alpha); 595 m_menutheme->setAlpha(*resource.menu_alpha);
589 Fluxbox::instance()->loadRootCommand(*this); 596 Fluxbox::instance()->loadRootCommand(*this);
@@ -597,23 +604,8 @@ void BScreen::reconfigure() {
597 // std::string theme_filename(Fluxbox::instance()->getStyleFilename()); 604 // std::string theme_filename(Fluxbox::instance()->getStyleFilename());
598 // FbTk::ThemeManager::instance().load(theme_filename.c_str()); 605 // FbTk::ThemeManager::instance().load(theme_filename.c_str());
599 606
600 I18n *i18n = I18n::instance();
601
602 const char *s = i18n->getMessage(FBNLS::ScreenSet,
603 FBNLS::ScreenPositionLength,
604 "W: 0000 x H: 0000");
605 int l = strlen(s);
606
607 //TODO: repeated from somewhere else?
608 int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2;
609 int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2;
610 m_geom_window.resize(geom_w, geom_h);
611
612 renderGeomWindow(); 607 renderGeomWindow();
613 608
614 m_geom_window.setBorderWidth(m_root_theme->borderWidth());
615 m_geom_window.setBorderColor(m_root_theme->borderColor());
616
617 //reconfigure menus 609 //reconfigure menus
618 workspacemenu->reconfigure(); 610 workspacemenu->reconfigure();
619 m_configmenu->reconfigure(); 611 m_configmenu->reconfigure();
@@ -2163,6 +2155,20 @@ bool BScreen::doSkipWindow(const WinClient &winclient, int opts) {
2163} 2155}
2164 2156
2165void BScreen::renderGeomWindow() { 2157void BScreen::renderGeomWindow() {
2158
2159 const char *s = I18n::instance()->getMessage(FBNLS::ScreenSet,
2160 FBNLS::ScreenPositionLength,
2161 "W: 0000 x H: 0000");
2162 int l = strlen(s);
2163
2164 int geom_h = winFrameTheme().font().height() + m_root_theme->bevelWidth()*2;
2165 int geom_w = winFrameTheme().font().textWidth(s, l) + m_root_theme->bevelWidth()*2;
2166 m_geom_window.resize(geom_w, geom_h);
2167
2168 m_geom_window.setBorderWidth(m_root_theme->borderWidth());
2169 m_geom_window.setBorderColor(m_root_theme->borderColor());
2170
2171
2166 Pixmap tmp = geom_pixmap; 2172 Pixmap tmp = geom_pixmap;
2167 2173
2168 if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) { 2174 if (winFrameTheme().labelFocusTexture().type() & FbTk::Texture::PARENTRELATIVE) {
diff --git a/src/Screen.hh b/src/Screen.hh
index 6efe15d..f19c7b4 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.hh,v 1.122 2003/08/24 13:06:38 fluxgen Exp $ 25// $Id: Screen.hh,v 1.123 2003/08/25 13:15:53 rathnor Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -32,6 +32,7 @@
32#include "MultLayers.hh" 32#include "MultLayers.hh"
33#include "FbRootWindow.hh" 33#include "FbRootWindow.hh"
34#include "NotCopyable.hh" 34#include "NotCopyable.hh"
35#include "Observer.hh"
35#include "fluxbox.hh" 36#include "fluxbox.hh"
36#include "MenuTheme.hh" 37#include "MenuTheme.hh"
37 38
@@ -59,13 +60,14 @@ class Menu;
59class ImageControl; 60class ImageControl;
60class XLayerItem; 61class XLayerItem;
61class FbWindow; 62class FbWindow;
63class Subject;
62}; 64};
63 65
64/// Handles screen connection, screen clients and workspaces 66/// Handles screen connection, screen clients and workspaces
65/** 67/**
66 Create workspaces, handles switching between workspaces and windows 68 Create workspaces, handles switching between workspaces and windows
67 */ 69 */
68class BScreen : private FbTk::NotCopyable { 70class BScreen : public FbTk::Observer, private FbTk::NotCopyable {
69public: 71public:
70 typedef std::vector<Workspace *> Workspaces; 72 typedef std::vector<Workspace *> Workspaces;
71 typedef std::vector<std::string> WorkspaceNames; 73 typedef std::vector<std::string> WorkspaceNames;
@@ -153,7 +155,9 @@ public:
153 FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } 155 FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; }
154 FbTk::Subject &resizeSig() { return m_resize_sig; } 156 FbTk::Subject &resizeSig() { return m_resize_sig; }
155 //@} 157 //@}
156 158
159 void update(FbTk::Subject *subj);
160
157 /// @return the resource value of number of workspace 161 /// @return the resource value of number of workspace
158 inline int getNumberOfWorkspaces() const { return *resource.workspaces; } 162 inline int getNumberOfWorkspaces() const { return *resource.workspaces; }
159 163