added remove/add workspace
This commit is contained in:
parent
0cba1e7dff
commit
188d53a879
2 changed files with 25 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
// Workspacemenu.cc for Fluxbox
|
||||||
|
// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
|
||||||
// Workspacemenu.cc for Blackbox - an X11 Window manager
|
// Workspacemenu.cc for Blackbox - an X11 Window manager
|
||||||
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
||||||
//
|
//
|
||||||
|
@ -35,7 +37,8 @@
|
||||||
#include "Toolbar.hh"
|
#include "Toolbar.hh"
|
||||||
#include "Workspacemenu.hh"
|
#include "Workspacemenu.hh"
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
#include <iostream>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) {
|
Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) {
|
||||||
screen = scrn;
|
screen = scrn;
|
||||||
|
@ -82,3 +85,19 @@ void Workspacemenu::itemSelected(int button, int index) {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspacemenu::removeWorkspace(unsigned int id) {
|
||||||
|
if (id<getCount()) {
|
||||||
|
remove(id+2); // + 2 is where workspaces starts
|
||||||
|
#ifdef DEBUG
|
||||||
|
using namespace std;
|
||||||
|
cerr<<__FILE__<<"("<<__LINE__<<"): Removing "<<id<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Workspacemenu::addWorkspace(Workspace *wkspc) {
|
||||||
|
assert(wkspc);
|
||||||
|
insert(wkspc->getName(), wkspc->getMenu(),
|
||||||
|
wkspc->getWorkspaceID() + 2);
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Workspacemenu.hh for Fluxbox
|
||||||
|
// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
|
||||||
// WorkspaceMenu.hh for Blackbox - an X11 Window manager
|
// WorkspaceMenu.hh for Blackbox - an X11 Window manager
|
||||||
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
||||||
//
|
//
|
||||||
|
@ -22,24 +24,20 @@
|
||||||
#ifndef WORKSPACEMENU_HH
|
#ifndef WORKSPACEMENU_HH
|
||||||
#define WORKSPACEMENU_HH
|
#define WORKSPACEMENU_HH
|
||||||
|
|
||||||
// forward declaration
|
|
||||||
class Workspacemenu;
|
|
||||||
class Toolbar;
|
|
||||||
|
|
||||||
#include "Basemenu.hh"
|
#include "Basemenu.hh"
|
||||||
|
class Workspace;
|
||||||
|
|
||||||
class Workspacemenu : public Basemenu {
|
class Workspacemenu : public Basemenu {
|
||||||
private:
|
private:
|
||||||
BScreen *screen;
|
BScreen *screen;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void itemSelected(int, int);
|
virtual void itemSelected(int, int);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Workspacemenu(BScreen *);
|
Workspacemenu(BScreen *);
|
||||||
|
void removeWorkspace(unsigned int id);
|
||||||
|
void addWorkspace(Workspace *wkspc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue