aboutsummaryrefslogtreecommitdiff
path: root/src/MenuCreator.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
committerfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
commit369b4e1b92491aa57b0bf430b89bf732b80fa6a4 (patch)
tree2bf00a93ad1c195ef7d446e8989069f218a2cd47 /src/MenuCreator.cc
parent2566d84561ce9f5ecaf1adcce97eb578747034e3 (diff)
downloadfluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.zip
fluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.tar.bz2
moved class Layer from class Fluxbox and thus reduces some dependecies
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r--src/MenuCreator.cc42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index 4ea83a8..9d2b4fa 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -36,6 +36,7 @@
36#include "WorkspaceMenu.hh" 36#include "WorkspaceMenu.hh"
37#include "LayerMenu.hh" 37#include "LayerMenu.hh"
38#include "SendToMenu.hh" 38#include "SendToMenu.hh"
39#include "Layer.hh"
39 40
40#include "FbMenuParser.hh" 41#include "FbMenuParser.hh"
41#include "StyleMenuItem.hh" 42#include "StyleMenuItem.hh"
@@ -364,8 +365,7 @@ FbTk::Menu *MenuCreator::createMenu(const std::string &label, int screen_number)
364 365
365 FbTk::Menu *menu = new FbMenu(screen->menuTheme(), 366 FbTk::Menu *menu = new FbMenu(screen->menuTheme(),
366 screen->imageControl(), 367 screen->imageControl(),
367 *screen->layerManager(). 368 *screen->layerManager().getLayer(Layer::MENU));
368 getLayer(Fluxbox::instance()->getMenuLayer()));
369 if (!label.empty()) 369 if (!label.empty())
370 menu->setLabel(label.c_str()); 370 menu->setLabel(label.c_str());
371 371
@@ -511,24 +511,41 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
511 menu.insert(maximize_item); 511 menu.insert(maximize_item);
512 } else if (type == "iconify") { 512 } else if (type == "iconify") {
513 RefCmd iconify_cmd(new WindowCmd<void>(&FluxboxWindow::iconify)); 513 RefCmd iconify_cmd(new WindowCmd<void>(&FluxboxWindow::iconify));
514 menu.insert(label.empty()?_FBTEXT(Windowmenu, Iconify, "Iconify", "Iconify the window"):label.c_str(), iconify_cmd); 514 menu.insert(label.empty() ?
515 _FBTEXT(Windowmenu, Iconify,
516 "Iconify", "Iconify the window") :
517 label.c_str(), iconify_cmd);
515 } else if (type == "close") { 518 } else if (type == "close") {
516 RefCmd close_cmd(new WindowCmd<void>(&FluxboxWindow::close)); 519 RefCmd close_cmd(new WindowCmd<void>(&FluxboxWindow::close));
517 menu.insert(label.empty()?_FBTEXT(Windowmenu, Close, "Close", "Close the window"):label.c_str(), close_cmd); 520 menu.insert(label.empty() ?
521 _FBTEXT(Windowmenu, Close,
522 "Close", "Close the window") :
523 label.c_str(), close_cmd);
518 } else if (type == "kill" || type == "killwindow") { 524 } else if (type == "kill" || type == "killwindow") {
519 RefCmd kill_cmd(new WindowCmd<void>(&FluxboxWindow::kill)); 525 RefCmd kill_cmd(new WindowCmd<void>(&FluxboxWindow::kill));
520 menu.insert(label.empty()?_FBTEXT(Windowmenu, Kill, "Kill", "Kill the window"):label.c_str(), kill_cmd); 526 menu.insert(label.empty() ?
527 _FBTEXT(Windowmenu, Kill,
528 "Kill", "Kill the window"):
529 label.c_str(), kill_cmd);
521 } else if (type == "lower") { 530 } else if (type == "lower") {
522 RefCmd lower_cmd(new WindowCmd<void>(&FluxboxWindow::lower)); 531 RefCmd lower_cmd(new WindowCmd<void>(&FluxboxWindow::lower));
523 menu.insert(label.empty()?_FBTEXT(Windowmenu, Lower, "Lower", "Lower the window"):label.c_str(), lower_cmd); 532 menu.insert( label.empty() ?
533 _FBTEXT(Windowmenu, Lower,
534 "Lower", "Lower the window"):
535 label.c_str(), lower_cmd);
524 } else if (type == "raise") { 536 } else if (type == "raise") {
525 RefCmd raise_cmd(new WindowCmd<void>(&FluxboxWindow::raise)); 537 RefCmd raise_cmd(new WindowCmd<void>(&FluxboxWindow::raise));
526 menu.insert(label.empty()?_FBTEXT(Windowmenu, Raise, "Raise", "Raise the window"):label.c_str(), raise_cmd); 538 menu.insert(label.empty() ?
539 _FBTEXT(Windowmenu, Raise,
540 "Raise", "Raise the window"):
541 label.c_str(), raise_cmd);
527 } else if (type == "stick") { 542 } else if (type == "stick") {
528 RefCmd stick_cmd(new WindowCmd<void>(&FluxboxWindow::stick)); 543 RefCmd stick_cmd(new WindowCmd<void>(&FluxboxWindow::stick));
529 menu.insert(label.empty()?_FBTEXT(Windowmenu, Stick, "Stick", "Stick the window"):label.c_str(), stick_cmd); 544 menu.insert(label.empty() ?
530 } 545 _FBTEXT(Windowmenu, Stick,
531 else if (type == "extramenus") { 546 "Stick", "Stick the window"):
547 label.c_str(), stick_cmd);
548 } else if (type == "extramenus") {
532 BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber()); 549 BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber());
533 BScreen::ExtraMenus::iterator it = screen->extraWindowMenus().begin(); 550 BScreen::ExtraMenus::iterator it = screen->extraWindowMenus().begin();
534 BScreen::ExtraMenus::iterator it_end = screen->extraWindowMenus().end(); 551 BScreen::ExtraMenus::iterator it_end = screen->extraWindowMenus().end();
@@ -540,7 +557,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
540 } else if (type == "sendto") { 557 } else if (type == "sendto") {
541 menu.insert(label.empty() ? _FBTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"): 558 menu.insert(label.empty() ? _FBTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"):
542 label.c_str(), new SendToMenu(*Fluxbox::instance()->findScreen(menu.screenNumber()))); 559 label.c_str(), new SendToMenu(*Fluxbox::instance()->findScreen(menu.screenNumber())));
543 }else if (type == "layer") { 560 } else if (type == "layer") {
544 BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber()); 561 BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber());
545 if (screen == 0) 562 if (screen == 0)
546 return false; 563 return false;
@@ -549,8 +566,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
549 566
550 FbTk::Menu *submenu = new LayerMenu(screen->menuTheme(), 567 FbTk::Menu *submenu = new LayerMenu(screen->menuTheme(),
551 screen->imageControl(), 568 screen->imageControl(),
552 *screen->layerManager(). 569 *screen->layerManager().getLayer(Layer::MENU),
553 getLayer(Fluxbox::instance()->getMenuLayer()),
554 &context, 570 &context,
555 false); 571 false);
556 submenu->disableTitle(); 572 submenu->disableTitle();