workspacesList.push_back(wkspc);
workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
}
+ saveWorkspaceNames();
workspacemenu->insert(i18n(IconSet, IconIcons, "Icons"), iconmenu);
workspacemenu->update();
}
+void BScreen::saveHideToolbar(bool h) {
+ resource.hide_toolbar = h;
+ if (resource.hide_toolbar)
+ toolbar->unmapToolbar();
+ else
+ toolbar->mapToolbar();
+ config->setValue(screenstr + "hideToolbar", resource.hide_toolbar);
+}
+
+
void BScreen::saveWorkspaces(unsigned int w) {
resource.workspaces = w;
config->setValue(screenstr + "workspaces", resource.workspaces);
void BScreen::saveWorkspaceNames() {
- string save_string = getWorkspace(0)->getName();
- for (unsigned int i = 1; i < getWorkspaceCount(); ++i)
- save_string += ',' + getWorkspace(i)->getName();
- config->setValue(screenstr + "workspaceNames", save_string);
+ string names;
+ WorkspaceList::iterator it;
+ WorkspaceList::iterator last = workspacesList.end() - 1;
+ for (it = workspacesList.begin(); it != workspacesList.end(); ++it) {
+ names += (*it)->getName();
+ if (it != last)
+ names += ',';
+ }
+ config->setValue(screenstr + "workspaceNames", names);
}
saveFullMax(resource.full_max);
saveFocusNew(resource.focus_new);
saveFocusLast(resource.focus_last);
+ saveHideToolbar(resource.hide_toolbar);
saveWorkspaces(resource.workspaces);
savePlacementPolicy(resource.placement_policy);
saveEdgeSnapThreshold(resource.edge_snap_threshold);
if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move))
resource.opaque_move = false;
+ if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
+ resource.hide_toolbar = false;
+
if (! config->getValue(screenstr + "imageDither", b))
b = true;
image_control->setDither(b);
removeNetizen(w->getClientWindow());
+ /*
+ some managed windows can also be window group controllers. when
+ unmanaging such windows, we should also delete the window group.
+ */
+ BWindowGroup *group = blackbox->searchGroup(w->getClientWindow());
+ delete group;
+
delete w;
}
blackbox->checkMenu();
rootmenu->show();
}
+ // mouse wheel up
+ } else if (xbutton->button == 4) {
+ if (getCurrentWorkspaceID() >= getWorkspaceCount() - 1)
+ changeWorkspaceID(0);
+ else
+ changeWorkspaceID(getCurrentWorkspaceID() + 1);
+ // mouse wheel down
+ } else if (xbutton->button == 5) {
+ if (getCurrentWorkspaceID() == 0)
+ changeWorkspaceID(getWorkspaceCount() - 1);
+ else
+ changeWorkspaceID(getCurrentWorkspaceID() - 1);
}
}