aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc62
1 files changed, 34 insertions, 28 deletions
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) {