diff options
author | fluxgen <fluxgen> | 2003-04-28 22:43:26 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-28 22:43:26 (GMT) |
commit | 456792bbeb7a3acfec05c538375a0d001c700cbf (patch) | |
tree | 77dd1626781870f2ce3ed740a9d28ef4194e8676 | |
parent | 3f62d0e80817935d071ff4074e282cdb9fb438fb (diff) | |
download | fluxbox_pavel-456792bbeb7a3acfec05c538375a0d001c700cbf.zip fluxbox_pavel-456792bbeb7a3acfec05c538375a0d001c700cbf.tar.bz2 |
rearranged themes and added WinButtonTheme
-rw-r--r-- | src/Screen.cc | 30 | ||||
-rw-r--r-- | src/Screen.hh | 6 |
2 files changed, 19 insertions, 17 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 4c9c93e..89ef2a7 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.141 2003/04/28 12:58:08 rathnor Exp $ | 25 | // $Id: Screen.cc,v 1.142 2003/04/28 22:43:26 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -41,7 +41,7 @@ | |||
41 | #include "FbWinFrameTheme.hh" | 41 | #include "FbWinFrameTheme.hh" |
42 | #include "MenuTheme.hh" | 42 | #include "MenuTheme.hh" |
43 | #include "RootTheme.hh" | 43 | #include "RootTheme.hh" |
44 | //#include "WinButtonTheme.hh" | 44 | #include "WinButtonTheme.hh" |
45 | #include "FbCommands.hh" | 45 | #include "FbCommands.hh" |
46 | #include "BoolMenuItem.hh" | 46 | #include "BoolMenuItem.hh" |
47 | #include "IntResMenuItem.hh" | 47 | #include "IntResMenuItem.hh" |
@@ -504,12 +504,15 @@ BScreen::BScreen(ResourceManager &rm, | |||
504 | cycling_focus(false), | 504 | cycling_focus(false), |
505 | cycling_last(0), | 505 | cycling_last(0), |
506 | m_windowtheme(new FbWinFrameTheme(scrn)), | 506 | m_windowtheme(new FbWinFrameTheme(scrn)), |
507 | // the order of windowtheme and winbutton theme is important | ||
508 | // because winbutton need to rescale the pixmaps in winbutton theme | ||
509 | // after fbwinframe have resized them | ||
510 | m_winbutton_theme(new WinButtonTheme(scrn)), | ||
507 | m_menutheme(new FbTk::MenuTheme(scrn)), | 511 | m_menutheme(new FbTk::MenuTheme(scrn)), |
508 | resource(rm, screenname, altscreenname), | ||
509 | m_root_theme(new | 512 | m_root_theme(new |
510 | RootTheme(scrn, | 513 | RootTheme(scrn, |
511 | *resource.rootcommand)), | 514 | *resource.rootcommand)), |
512 | // m_winbutton_theme(new WinButtonTheme(scrn)), | 515 | resource(rm, screenname, altscreenname), |
513 | m_toolbarhandler(0) { | 516 | m_toolbarhandler(0) { |
514 | 517 | ||
515 | 518 | ||
@@ -827,14 +830,14 @@ void BScreen::reconfigure() { | |||
827 | winFrameTheme().font().setAntialias(*resource.antialias); | 830 | winFrameTheme().font().setAntialias(*resource.antialias); |
828 | m_menutheme->titleFont().setAntialias(*resource.antialias); | 831 | m_menutheme->titleFont().setAntialias(*resource.antialias); |
829 | m_menutheme->frameFont().setAntialias(*resource.antialias); | 832 | m_menutheme->frameFont().setAntialias(*resource.antialias); |
833 | |||
830 | // load theme | 834 | // load theme |
831 | std::string theme_filename(Fluxbox::instance()->getStyleFilename()); | 835 | std::string theme_filename(Fluxbox::instance()->getStyleFilename()); |
832 | FbTk::ThemeManager::instance().load(theme_filename.c_str()); | 836 | FbTk::ThemeManager::instance().load(theme_filename.c_str()); |
833 | 837 | ||
834 | I18n *i18n = I18n::instance(); | 838 | I18n *i18n = I18n::instance(); |
835 | 839 | ||
836 | const char *s = i18n->getMessage( | 840 | const char *s = i18n->getMessage(FBNLS::ScreenSet, |
837 | FBNLS::ScreenSet, | ||
838 | FBNLS::ScreenPositionLength, | 841 | FBNLS::ScreenPositionLength, |
839 | "W: 0000 x H: 0000"); | 842 | "W: 0000 x H: 0000"); |
840 | int l = strlen(s); | 843 | int l = strlen(s); |
@@ -907,6 +910,7 @@ void BScreen::reconfigure() { | |||
907 | mem_fun(&FluxboxWindow::reconfigure)); | 910 | mem_fun(&FluxboxWindow::reconfigure)); |
908 | 911 | ||
909 | image_control->timeout(); | 912 | image_control->timeout(); |
913 | |||
910 | } | 914 | } |
911 | 915 | ||
912 | 916 | ||
@@ -1332,14 +1336,14 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { | |||
1332 | //create new buttons | 1336 | //create new buttons |
1333 | FbTk::Button *newbutton = 0; | 1337 | FbTk::Button *newbutton = 0; |
1334 | if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) { | 1338 | if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) { |
1335 | newbutton = new WinButton(win, //*m_winbutton_theme.get(), | 1339 | newbutton = new WinButton(win, *m_winbutton_theme.get(), |
1336 | WinButton::MINIMIZE, | 1340 | WinButton::MINIMIZE, |
1337 | frame.titlebar(), | 1341 | frame.titlebar(), |
1338 | 0, 0, 10, 10); | 1342 | 0, 0, 10, 10); |
1339 | newbutton->setOnClick(iconify_cmd); | 1343 | newbutton->setOnClick(iconify_cmd); |
1340 | 1344 | ||
1341 | } else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) { | 1345 | } else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) { |
1342 | newbutton = new WinButton(win, //*m_winbutton_theme.get(), | 1346 | newbutton = new WinButton(win, *m_winbutton_theme.get(), |
1343 | WinButton::MAXIMIZE, | 1347 | WinButton::MAXIMIZE, |
1344 | frame.titlebar(), | 1348 | frame.titlebar(), |
1345 | 0, 0, 10, 10); | 1349 | 0, 0, 10, 10); |
@@ -1349,7 +1353,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { | |||
1349 | newbutton->setOnClick(maximize_vert_cmd, 2); | 1353 | newbutton->setOnClick(maximize_vert_cmd, 2); |
1350 | 1354 | ||
1351 | } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) { | 1355 | } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) { |
1352 | newbutton = new WinButton(win, //*m_winbutton_theme.get(), | 1356 | newbutton = new WinButton(win, *m_winbutton_theme.get(), |
1353 | WinButton::CLOSE, | 1357 | WinButton::CLOSE, |
1354 | frame.titlebar(), | 1358 | frame.titlebar(), |
1355 | 0, 0, 10, 10); | 1359 | 0, 0, 10, 10); |
@@ -1359,7 +1363,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { | |||
1359 | cerr<<__FILE__<<": Creating close button"<<endl; | 1363 | cerr<<__FILE__<<": Creating close button"<<endl; |
1360 | #endif // DEBUG | 1364 | #endif // DEBUG |
1361 | } else if ((*dir)[i] == Fluxbox::STICK) { | 1365 | } else if ((*dir)[i] == Fluxbox::STICK) { |
1362 | WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(), | 1366 | WinButton *winbtn = new WinButton(win, *m_winbutton_theme.get(), |
1363 | WinButton::STICK, | 1367 | WinButton::STICK, |
1364 | frame.titlebar(), | 1368 | frame.titlebar(), |
1365 | 0, 0, 10, 10); | 1369 | 0, 0, 10, 10); |
@@ -1367,7 +1371,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { | |||
1367 | winbtn->setOnClick(stick_cmd); | 1371 | winbtn->setOnClick(stick_cmd); |
1368 | newbutton = winbtn; | 1372 | newbutton = winbtn; |
1369 | } else if ((*dir)[i] == Fluxbox::SHADE) { | 1373 | } else if ((*dir)[i] == Fluxbox::SHADE) { |
1370 | WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(), | 1374 | WinButton *winbtn = new WinButton(win, *m_winbutton_theme.get(), |
1371 | WinButton::SHADE, | 1375 | WinButton::SHADE, |
1372 | frame.titlebar(), | 1376 | frame.titlebar(), |
1373 | 0, 0, 10, 10); | 1377 | 0, 0, 10, 10); |
@@ -2031,10 +2035,6 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
2031 | "no menu label defined\n")); | 2035 | "no menu label defined\n")); |
2032 | cerr<<"Row: "<<row<<endl; | 2036 | cerr<<"Row: "<<row<<endl; |
2033 | } else { | 2037 | } else { |
2034 | /* if (str_cmd.size()) | ||
2035 | menu.insert(str_label.c_str(), BScreen::RESTARTOTHER, str_cmd.c_str()); | ||
2036 | else | ||
2037 | */ | ||
2038 | FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); | 2038 | FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); |
2039 | menu.insert(str_label.c_str(), restart_fb); | 2039 | menu.insert(str_label.c_str(), restart_fb); |
2040 | } | 2040 | } |
diff --git a/src/Screen.hh b/src/Screen.hh index 39c32fb..59e2df4 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.88 2003/04/27 14:36:04 rathnor Exp $ | 25 | // $Id: Screen.hh,v 1.89 2003/04/28 22:42:29 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -48,6 +48,7 @@ class Netizen; | |||
48 | class Toolbar; | 48 | class Toolbar; |
49 | class FbWinFrameTheme; | 49 | class FbWinFrameTheme; |
50 | class RootTheme; | 50 | class RootTheme; |
51 | class WinButtonTheme; | ||
51 | class WinClient; | 52 | class WinClient; |
52 | class Workspace; | 53 | class Workspace; |
53 | 54 | ||
@@ -373,7 +374,9 @@ private: | |||
373 | Window auto_group_window; | 374 | Window auto_group_window; |
374 | 375 | ||
375 | std::auto_ptr<FbWinFrameTheme> m_windowtheme; | 376 | std::auto_ptr<FbWinFrameTheme> m_windowtheme; |
377 | std::auto_ptr<WinButtonTheme> m_winbutton_theme; | ||
376 | std::auto_ptr<FbTk::MenuTheme> m_menutheme; | 378 | std::auto_ptr<FbTk::MenuTheme> m_menutheme; |
379 | std::auto_ptr<RootTheme> m_root_theme; | ||
377 | 380 | ||
378 | struct ScreenResource { | 381 | struct ScreenResource { |
379 | ScreenResource(ResourceManager &rm, const std::string &scrname, | 382 | ScreenResource(ResourceManager &rm, const std::string &scrname, |
@@ -411,7 +414,6 @@ private: | |||
411 | 414 | ||
412 | } resource; | 415 | } resource; |
413 | 416 | ||
414 | std::auto_ptr<RootTheme> m_root_theme; | ||
415 | ToolbarHandler *m_toolbarhandler; | 417 | ToolbarHandler *m_toolbarhandler; |
416 | }; | 418 | }; |
417 | 419 | ||