add autoraising to toolbar and slit
This commit is contained in:
parent
6c0565c482
commit
fe8ff87292
6 changed files with 46 additions and 2 deletions
|
@ -604,6 +604,11 @@ All changes take effect immediately. Here are the settings:
|
|||
remaining edge of the toolbar. See the *session.autoRaiseDelay* resource for
|
||||
the delay time.
|
||||
|
||||
*Auto raise*:::
|
||||
If this is enabled the toolbar will elevate after a defined time when the
|
||||
mouse pointer enters the it. It will fall back when the cursor leaves the
|
||||
toolbar. See the *session.autoRaiseDelay* resource for the delay time.
|
||||
|
||||
*Toolbar width percentage*:::
|
||||
Sets the width of the toolbar in a percentage of your total screen size. Use
|
||||
the left mouse button to decrease and the right mouse-button to increase the
|
||||
|
@ -796,6 +801,11 @@ All changes take effect immediately. Here are the settings:
|
|||
remaining edge of the slit. See the *session.autoRaiseDelay* resource for
|
||||
the delay time.
|
||||
|
||||
*Auto raise*:::
|
||||
If this is enabled the slit will elevate after a defined time when the
|
||||
mouse pointer enters the it. It will fall back when the cursor leaves the
|
||||
slit. See the *session.autoRaiseDelay* resource for the delay time.
|
||||
|
||||
*Maximize Over*:::
|
||||
Enabling this option will allow windows to maximizing over the slit. With
|
||||
this switched off they will only expand to the edge of the slit. This
|
||||
|
@ -886,6 +896,16 @@ used actively by the user, or they remain visible at all times.
|
|||
+
|
||||
Default: *False*
|
||||
|
||||
*session.screen0.{slit|toolbar}.autoRaise*: 'boolean'::
|
||||
If enabled, the respective item will elevate to the AboveDock layer when entered
|
||||
and fall back to its regular layer when left.
|
||||
Notice that this does *not* implicitly alter the items regular layer or the
|
||||
workspace padding, ie. if the item is already set to AboveDock this does nothing
|
||||
and if a mximized window completely covers the item you won't be able to enter,
|
||||
thus elevate it.
|
||||
+
|
||||
Default: *False*
|
||||
|
||||
*session.screen0.{slit|toolbar}.layer*: 'layer'::
|
||||
With these two resources, you can set the layer you want the toolbar and
|
||||
the slit to appear on. Please read the LAYER section for more information.
|
||||
|
|
|
@ -54,6 +54,7 @@ enum {
|
|||
CommonVisible = 18,
|
||||
CommonBackgroundWarning = 19,
|
||||
CommonDefaultWindowMenuFile = 20,
|
||||
CommonAutoRaise = 21,
|
||||
|
||||
ConfigmenuSet = 4,
|
||||
ConfigmenuAntiAlias = 1,
|
||||
|
|
11
src/Slit.cc
11
src/Slit.cc
|
@ -235,6 +235,8 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
|
|||
scr.name() + ".slit.acceptKdeDockapps", scr.altName() + ".Slit.AcceptKdeDockapps"),
|
||||
m_rc_auto_hide(scr.resourceManager().lock(), false,
|
||||
scr.name() + ".slit.autoHide", scr.altName() + ".Slit.AutoHide"),
|
||||
m_rc_auto_raise(scr.resourceManager().lock(), false,
|
||||
scr.name() + ".slit.autoRaise", scr.altName() + ".Slit.AutoRaise"),
|
||||
// TODO: this resource name must change
|
||||
m_rc_maximize_over(scr.resourceManager(), false,
|
||||
scr.name() + ".slit.maxOver", scr.altName() + ".Slit.MaxOver"),
|
||||
|
@ -957,6 +959,9 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
|
|||
|
||||
|
||||
void Slit::enterNotifyEvent(XCrossingEvent &) {
|
||||
if (m_rc_auto_raise)
|
||||
m_layeritem->moveToLayer(ResourceLayer::ABOVE_DOCK);
|
||||
|
||||
if (! doAutoHide())
|
||||
return;
|
||||
|
||||
|
@ -971,6 +976,9 @@ void Slit::enterNotifyEvent(XCrossingEvent &) {
|
|||
|
||||
|
||||
void Slit::leaveNotifyEvent(XCrossingEvent &ev) {
|
||||
if (m_rc_auto_raise)
|
||||
m_layeritem->moveToLayer(m_rc_layernum->getNum());
|
||||
|
||||
if (! doAutoHide())
|
||||
return;
|
||||
|
||||
|
@ -1207,6 +1215,9 @@ void Slit::setupMenu() {
|
|||
m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"),
|
||||
m_rc_auto_hide,
|
||||
save_and_reconfigure_slit));
|
||||
m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoRaise, "Auto raise", "This thing automatically raises when entered"),
|
||||
m_rc_auto_raise,
|
||||
save_and_reconfigure_slit));
|
||||
|
||||
m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),
|
||||
m_rc_maximize_over,
|
||||
|
|
|
@ -182,7 +182,7 @@ private:
|
|||
static unsigned int s_eventmask;
|
||||
Strut *m_strut;
|
||||
|
||||
FbTk::Resource<bool> m_rc_kde_dockapp, m_rc_auto_hide, m_rc_maximize_over;
|
||||
FbTk::Resource<bool> m_rc_kde_dockapp, m_rc_auto_hide, m_rc_auto_raise, m_rc_maximize_over;
|
||||
FbTk::Resource<Slit::Placement> m_rc_placement;
|
||||
FbTk::Resource<int> m_rc_alpha, m_rc_on_head;
|
||||
FbTk::Resource<class ResourceLayer> m_rc_layernum;
|
||||
|
|
|
@ -194,6 +194,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
|
|||
// lock rcmanager here
|
||||
m_rc_auto_hide(scrn.resourceManager().lock(), false,
|
||||
scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"),
|
||||
m_rc_auto_raise(scrn.resourceManager().lock(), false,
|
||||
scrn.name() + ".toolbar.autoRaise", scrn.altName() + ".Toolbar.AutoRaise"),
|
||||
m_rc_maximize_over(scrn.resourceManager(), false,
|
||||
scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"),
|
||||
m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"),
|
||||
|
@ -522,6 +524,9 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
|
|||
}
|
||||
|
||||
void Toolbar::enterNotifyEvent(XCrossingEvent &ce) {
|
||||
if (m_rc_auto_raise)
|
||||
m_layeritem.moveToLayer(ResourceLayer::ABOVE_DOCK);
|
||||
|
||||
Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0,
|
||||
Keys::ON_TOOLBAR);
|
||||
|
||||
|
@ -552,6 +557,9 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &event) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_rc_auto_raise)
|
||||
m_layeritem.moveToLayer(m_rc_layernum->getNum());
|
||||
|
||||
Fluxbox::instance()->keys()->doAction(event.type, event.state, 0,
|
||||
Keys::ON_TOOLBAR);
|
||||
|
||||
|
@ -762,6 +770,10 @@ void Toolbar::setupMenus(bool skip_new_placement) {
|
|||
"Auto hide", "Toggle auto hide of toolbar"),
|
||||
m_rc_auto_hide,
|
||||
reconfig_toolbar_and_save_resource));
|
||||
menu().insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoRaise,
|
||||
"Auto raise", "Toggle auto raise of toolbar"),
|
||||
m_rc_auto_raise,
|
||||
reconfig_toolbar_and_save_resource));
|
||||
|
||||
MenuItem *toolbar_menuitem =
|
||||
new FbTk::IntMenuItem(_FB_XTEXT(Toolbar, WidthPercent,
|
||||
|
|
|
@ -185,7 +185,7 @@ private:
|
|||
Strut *m_strut; ///< created and destroyed by BScreen
|
||||
|
||||
// resources
|
||||
FbTk::Resource<bool> m_rc_auto_hide, m_rc_maximize_over, m_rc_visible;
|
||||
FbTk::Resource<bool> m_rc_auto_hide, m_rc_auto_raise, m_rc_maximize_over, m_rc_visible;
|
||||
FbTk::Resource<int> m_rc_width_percent;
|
||||
FbTk::Resource<int> m_rc_alpha;
|
||||
FbTk::Resource<class ResourceLayer> m_rc_layernum;
|
||||
|
|
Loading…
Reference in a new issue