# Focus New Windows
$ #FocusLast
# Focus Window on Workspace Change
+$ #HideToolbar
+# Hide Toolbar
$ #ClickToFocus
# Click to Focus
$ #SloppyFocus
"Focus New Windows"), 4);
insert(i18n(ConfigmenuSet, ConfigmenuFocusLast,
"Focus Last Window on Workspace"), 5);
+ insert(i18n(ConfigmenuSet, ConfigmenuHideToolbar,
+ "Hide Toolbar"), 6);
update();
setValues();
}
setItemSelected(4, getScreen()->doFullMax());
setItemSelected(5, getScreen()->doFocusNew());
setItemSelected(6, getScreen()->doFocusLast());
+ setItemSelected(7, getScreen()->doHideToolbar());
}
setItemSelected(index, getScreen()->doFocusLast());
break;
}
+
+ case 6: { // hide toolbar
+ getScreen()->saveHideToolbar((! getScreen()->doHideToolbar()));
+ setItemSelected(index, getScreen()->doHideToolbar());
+ break;
+ }
} // switch
}
}
+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);
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);
MenuStyle mstyle;
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
- opaque_move, full_max, focus_new, focus_last, click_raise;
+ opaque_move, full_max, focus_new, focus_last, click_raise,
+ hide_toolbar;
BColor border_color;
unsigned int workspaces;
inline bool doFullMax(void) const { return resource.full_max; }
inline bool doFocusNew(void) const { return resource.focus_new; }
inline bool doFocusLast(void) const { return resource.focus_last; }
+ inline bool doHideToolbar(void) const { return resource.hide_toolbar; }
inline const GC &getOpGC(void) const { return opGC; }
void saveFullMax(bool f);
void saveFocusNew(bool f);
void saveFocusLast(bool f);
+ void saveHideToolbar(bool h);
inline void iconUpdate(void) { iconmenu->update(); }
#ifdef HAVE_STRFTIME
screen->addStrut(&strut);
reconfigure();
-
- XMapSubwindows(display, frame.window);
- XMapWindow(display, frame.window);
+ mapToolbar();
}
Toolbar::~Toolbar(void) {
- XUnmapWindow(display, frame.window);
+ unmapToolbar();
if (frame.base) screen->getImageControl()->removeImage(frame.base);
if (frame.label) screen->getImageControl()->removeImage(frame.label);
}
+void Toolbar::mapToolbar() {
+ if (!screen->doHideToolbar()) {
+ //not hidden, so windows should not maximize over the toolbar
+ XMapSubwindows(display, frame.window);
+ XMapWindow(display, frame.window);
+ }
+ updateStrut();
+}
+
+
+void Toolbar::unmapToolbar() {
+ if (toolbarmenu->isVisible())
+ toolbarmenu->hide();
+ //hidden so we can maximize over the toolbar
+ XUnmapWindow(display, frame.window);
+ updateStrut();
+}
+
+
void Toolbar::saveOnTop(bool b) {
on_top = b;
config->setValue(toolbarstr + "onTop", on_top);
// left and right are always 0
strut.top = strut.bottom = 0;
- switch(placement) {
- case TopLeft:
- case TopCenter:
- case TopRight:
- strut.top = getExposedHeight() + (screen->getBorderWidth() * 2);
- break;
- default:
- strut.bottom = getExposedHeight() + (screen->getBorderWidth() * 2);
+ if (! screen->doHideToolbar()) {
+ switch(placement) {
+ case TopLeft:
+ case TopCenter:
+ case TopRight:
+ strut.top = getExposedHeight() + (screen->getBorderWidth() * 2);
+ break;
+ default:
+ strut.bottom = getExposedHeight() + (screen->getBorderWidth() * 2);
+ }
}
screen->updateAvailableArea();
void save_rc(void);
void load_rc(void);
+ void mapToolbar(void);
+ void unmapToolbar(void);
+
inline Window getWindowID(void) const { return frame.window; }
inline const Rect& getRect(void) const { return frame.rect; }
inline unsigned int getWidth(void) const { return frame.rect.width(); }
inline unsigned int getHeight(void) const { return frame.rect.height(); }
inline unsigned int getExposedHeight(void) const
- { return ((do_auto_hide) ? frame.bevel_w : frame.rect.height()); }
+ { return (screen->doHideToolbar() ? 0 :
+ ((do_auto_hide) ? frame.bevel_w :
+ frame.rect.height())); }
inline int getX(void) const
{ return ((hidden) ? frame.x_hidden : frame.rect.x()); }
inline int getY(void) const