added "Hide Toolbar" option.
This commit is contained in:
parent
b0f8eab0e6
commit
5377e3fde1
6 changed files with 66 additions and 14 deletions
|
@ -16,6 +16,8 @@ $ #FocusNew
|
||||||
# Focus New Windows
|
# Focus New Windows
|
||||||
$ #FocusLast
|
$ #FocusLast
|
||||||
# Focus Window on Workspace Change
|
# Focus Window on Workspace Change
|
||||||
|
$ #HideToolbar
|
||||||
|
# Hide Toolbar
|
||||||
$ #ClickToFocus
|
$ #ClickToFocus
|
||||||
# Click to Focus
|
# Click to Focus
|
||||||
$ #SloppyFocus
|
$ #SloppyFocus
|
||||||
|
|
|
@ -53,6 +53,8 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
|
||||||
"Focus New Windows"), 4);
|
"Focus New Windows"), 4);
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuFocusLast,
|
insert(i18n(ConfigmenuSet, ConfigmenuFocusLast,
|
||||||
"Focus Last Window on Workspace"), 5);
|
"Focus Last Window on Workspace"), 5);
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuHideToolbar,
|
||||||
|
"Hide Toolbar"), 6);
|
||||||
update();
|
update();
|
||||||
setValues();
|
setValues();
|
||||||
}
|
}
|
||||||
|
@ -64,6 +66,7 @@ void Configmenu::setValues(void) {
|
||||||
setItemSelected(4, getScreen()->doFullMax());
|
setItemSelected(4, getScreen()->doFullMax());
|
||||||
setItemSelected(5, getScreen()->doFocusNew());
|
setItemSelected(5, getScreen()->doFocusNew());
|
||||||
setItemSelected(6, getScreen()->doFocusLast());
|
setItemSelected(6, getScreen()->doFocusLast());
|
||||||
|
setItemSelected(7, getScreen()->doHideToolbar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,6 +113,12 @@ void Configmenu::itemSelected(int button, unsigned int index) {
|
||||||
setItemSelected(index, getScreen()->doFocusLast());
|
setItemSelected(index, getScreen()->doFocusLast());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 6: { // hide toolbar
|
||||||
|
getScreen()->saveHideToolbar((! getScreen()->doHideToolbar()));
|
||||||
|
setItemSelected(index, getScreen()->doHideToolbar());
|
||||||
|
break;
|
||||||
|
}
|
||||||
} // switch
|
} // switch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -408,6 +408,16 @@ void BScreen::saveFocusLast(bool f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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) {
|
void BScreen::saveWorkspaces(unsigned int w) {
|
||||||
resource.workspaces = w;
|
resource.workspaces = w;
|
||||||
config->setValue(screenstr + "workspaces", resource.workspaces);
|
config->setValue(screenstr + "workspaces", resource.workspaces);
|
||||||
|
@ -493,6 +503,7 @@ void BScreen::save_rc(void) {
|
||||||
saveFullMax(resource.full_max);
|
saveFullMax(resource.full_max);
|
||||||
saveFocusNew(resource.focus_new);
|
saveFocusNew(resource.focus_new);
|
||||||
saveFocusLast(resource.focus_last);
|
saveFocusLast(resource.focus_last);
|
||||||
|
saveHideToolbar(resource.hide_toolbar);
|
||||||
saveWorkspaces(resource.workspaces);
|
saveWorkspaces(resource.workspaces);
|
||||||
savePlacementPolicy(resource.placement_policy);
|
savePlacementPolicy(resource.placement_policy);
|
||||||
saveEdgeSnapThreshold(resource.edge_snap_threshold);
|
saveEdgeSnapThreshold(resource.edge_snap_threshold);
|
||||||
|
@ -529,6 +540,9 @@ void BScreen::load_rc(void) {
|
||||||
if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move))
|
if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move))
|
||||||
resource.opaque_move = false;
|
resource.opaque_move = false;
|
||||||
|
|
||||||
|
if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
|
||||||
|
resource.hide_toolbar = false;
|
||||||
|
|
||||||
if (! config->getValue(screenstr + "imageDither", b))
|
if (! config->getValue(screenstr + "imageDither", b))
|
||||||
b = true;
|
b = true;
|
||||||
image_control->setDither(b);
|
image_control->setDither(b);
|
||||||
|
|
|
@ -150,7 +150,8 @@ private:
|
||||||
MenuStyle mstyle;
|
MenuStyle mstyle;
|
||||||
|
|
||||||
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
|
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;
|
BColor border_color;
|
||||||
|
|
||||||
unsigned int workspaces;
|
unsigned int workspaces;
|
||||||
|
@ -212,6 +213,7 @@ public:
|
||||||
inline bool doFullMax(void) const { return resource.full_max; }
|
inline bool doFullMax(void) const { return resource.full_max; }
|
||||||
inline bool doFocusNew(void) const { return resource.focus_new; }
|
inline bool doFocusNew(void) const { return resource.focus_new; }
|
||||||
inline bool doFocusLast(void) const { return resource.focus_last; }
|
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; }
|
inline const GC &getOpGC(void) const { return opGC; }
|
||||||
|
|
||||||
|
@ -268,6 +270,7 @@ public:
|
||||||
void saveFullMax(bool f);
|
void saveFullMax(bool f);
|
||||||
void saveFocusNew(bool f);
|
void saveFocusNew(bool f);
|
||||||
void saveFocusLast(bool f);
|
void saveFocusLast(bool f);
|
||||||
|
void saveHideToolbar(bool h);
|
||||||
inline void iconUpdate(void) { iconmenu->update(); }
|
inline void iconUpdate(void) { iconmenu->update(); }
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
|
|
|
@ -161,14 +161,12 @@ Toolbar::Toolbar(BScreen *scrn) {
|
||||||
screen->addStrut(&strut);
|
screen->addStrut(&strut);
|
||||||
|
|
||||||
reconfigure();
|
reconfigure();
|
||||||
|
mapToolbar();
|
||||||
XMapSubwindows(display, frame.window);
|
|
||||||
XMapWindow(display, frame.window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Toolbar::~Toolbar(void) {
|
Toolbar::~Toolbar(void) {
|
||||||
XUnmapWindow(display, frame.window);
|
unmapToolbar();
|
||||||
|
|
||||||
if (frame.base) screen->getImageControl()->removeImage(frame.base);
|
if (frame.base) screen->getImageControl()->removeImage(frame.base);
|
||||||
if (frame.label) screen->getImageControl()->removeImage(frame.label);
|
if (frame.label) screen->getImageControl()->removeImage(frame.label);
|
||||||
|
@ -198,6 +196,25 @@ Toolbar::~Toolbar(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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) {
|
void Toolbar::saveOnTop(bool b) {
|
||||||
on_top = b;
|
on_top = b;
|
||||||
config->setValue(toolbarstr + "onTop", on_top);
|
config->setValue(toolbarstr + "onTop", on_top);
|
||||||
|
@ -511,6 +528,7 @@ void Toolbar::updateStrut(void) {
|
||||||
// left and right are always 0
|
// left and right are always 0
|
||||||
strut.top = strut.bottom = 0;
|
strut.top = strut.bottom = 0;
|
||||||
|
|
||||||
|
if (! screen->doHideToolbar()) {
|
||||||
switch(placement) {
|
switch(placement) {
|
||||||
case TopLeft:
|
case TopLeft:
|
||||||
case TopCenter:
|
case TopCenter:
|
||||||
|
@ -520,6 +538,7 @@ void Toolbar::updateStrut(void) {
|
||||||
default:
|
default:
|
||||||
strut.bottom = getExposedHeight() + (screen->getBorderWidth() * 2);
|
strut.bottom = getExposedHeight() + (screen->getBorderWidth() * 2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
screen->updateAvailableArea();
|
screen->updateAvailableArea();
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,13 +155,18 @@ public:
|
||||||
void save_rc(void);
|
void save_rc(void);
|
||||||
void load_rc(void);
|
void load_rc(void);
|
||||||
|
|
||||||
|
void mapToolbar(void);
|
||||||
|
void unmapToolbar(void);
|
||||||
|
|
||||||
inline Window getWindowID(void) const { return frame.window; }
|
inline Window getWindowID(void) const { return frame.window; }
|
||||||
|
|
||||||
inline const Rect& getRect(void) const { return frame.rect; }
|
inline const Rect& getRect(void) const { return frame.rect; }
|
||||||
inline unsigned int getWidth(void) const { return frame.rect.width(); }
|
inline unsigned int getWidth(void) const { return frame.rect.width(); }
|
||||||
inline unsigned int getHeight(void) const { return frame.rect.height(); }
|
inline unsigned int getHeight(void) const { return frame.rect.height(); }
|
||||||
inline unsigned int getExposedHeight(void) const
|
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
|
inline int getX(void) const
|
||||||
{ return ((hidden) ? frame.x_hidden : frame.rect.x()); }
|
{ return ((hidden) ? frame.x_hidden : frame.rect.x()); }
|
||||||
inline int getY(void) const
|
inline int getY(void) const
|
||||||
|
|
Loading…
Reference in a new issue