From f6382f08ba0695f46e72d4dc1ad0f12133d468c2 Mon Sep 17 00:00:00 2001 From: mathias Date: Sat, 20 Nov 2004 04:20:46 +0000 Subject: =?UTF-8?q?fix=20for=20adding/removing=20desktops=20(thanx=20?= =?UTF-8?q?=C3=98yvind=20Albrigtsen)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WorkspaceMenu.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index f505cea..6403319 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc @@ -49,6 +49,9 @@ WorkspaceMenu::WorkspaceMenu(BScreen &screen): } void WorkspaceMenu::update(FbTk::Subject *subj) { + + _FB_USES_NLS; + if (subj != 0 && typeid(*subj) == typeid(BScreen::ScreenSubject)) { BScreen::ScreenSubject &screen_subj = *static_cast(subj); BScreen &screen = screen_subj.screen(); @@ -66,8 +69,8 @@ void WorkspaceMenu::update(FbTk::Subject *subj) { FbTk::Menu::update(screen.currentWorkspace()->workspaceID() + 2); } else if (subj == &screen.workspaceCountSig() || subj == &screen.workspaceNamesSig()) { - while (numberOfItems() != 3) { - remove(2); + while (numberOfItems() > 2) { + remove(numberOfItems()-1); } // for each workspace add workspace name and it's menu // to our workspace menu @@ -82,6 +85,8 @@ void WorkspaceMenu::update(FbTk::Subject *subj) { mb_menu->setCommand(2, jump_cmd); insert(mb_menu); } + insert(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title"), + MenuCreator::createMenuType("iconmenu", screen.screenNumber())); FbTk::Menu::update(-1); } -- cgit v0.11.2