aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-13 08:48:22 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-08-26 06:06:47 (GMT)
commitfe8ff8729299a4fd4371394d3ca9102ece22fefb (patch)
tree3d639acbd9b153e92c6f97b9f3e9bbb791c7f802
parent6c0565c482b496b7d34e3731415829e7c4872535 (diff)
downloadfluxbox-fe8ff8729299a4fd4371394d3ca9102ece22fefb.zip
fluxbox-fe8ff8729299a4fd4371394d3ca9102ece22fefb.tar.bz2
add autoraising to toolbar and slit
-rw-r--r--doc/asciidoc/fluxbox.txt20
-rw-r--r--nls/fluxbox-nls.hh1
-rw-r--r--src/Slit.cc11
-rw-r--r--src/Slit.hh2
-rw-r--r--src/Toolbar.cc12
-rw-r--r--src/Toolbar.hh2
6 files changed, 46 insertions, 2 deletions
diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
index 87bd554..3556f5a 100644
--- a/doc/asciidoc/fluxbox.txt
+++ b/doc/asciidoc/fluxbox.txt
@@ -604,6 +604,11 @@ All changes take effect immediately. Here are the settings:
604 remaining edge of the toolbar. See the *session.autoRaiseDelay* resource for 604 remaining edge of the toolbar. See the *session.autoRaiseDelay* resource for
605 the delay time. 605 the delay time.
606 606
607*Auto raise*:::
608 If this is enabled the toolbar will elevate after a defined time when the
609 mouse pointer enters the it. It will fall back when the cursor leaves the
610 toolbar. See the *session.autoRaiseDelay* resource for the delay time.
611
607*Toolbar width percentage*::: 612*Toolbar width percentage*:::
608 Sets the width of the toolbar in a percentage of your total screen size. Use 613 Sets the width of the toolbar in a percentage of your total screen size. Use
609 the left mouse button to decrease and the right mouse-button to increase the 614 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:
796 remaining edge of the slit. See the *session.autoRaiseDelay* resource for 801 remaining edge of the slit. See the *session.autoRaiseDelay* resource for
797 the delay time. 802 the delay time.
798 803
804*Auto raise*:::
805 If this is enabled the slit will elevate after a defined time when the
806 mouse pointer enters the it. It will fall back when the cursor leaves the
807 slit. See the *session.autoRaiseDelay* resource for the delay time.
808
799*Maximize Over*::: 809*Maximize Over*:::
800 Enabling this option will allow windows to maximizing over the slit. With 810 Enabling this option will allow windows to maximizing over the slit. With
801 this switched off they will only expand to the edge of the slit. This 811 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.
886+ 896+
887Default: *False* 897Default: *False*
888 898
899*session.screen0.{slit|toolbar}.autoRaise*: 'boolean'::
900If enabled, the respective item will elevate to the AboveDock layer when entered
901and fall back to its regular layer when left.
902Notice that this does *not* implicitly alter the items regular layer or the
903workspace padding, ie. if the item is already set to AboveDock this does nothing
904and if a mximized window completely covers the item you won't be able to enter,
905thus elevate it.
906+
907Default: *False*
908
889*session.screen0.{slit|toolbar}.layer*: 'layer':: 909*session.screen0.{slit|toolbar}.layer*: 'layer'::
890With these two resources, you can set the layer you want the toolbar and 910With these two resources, you can set the layer you want the toolbar and
891the slit to appear on. Please read the LAYER section for more information. 911the slit to appear on. Please read the LAYER section for more information.
diff --git a/nls/fluxbox-nls.hh b/nls/fluxbox-nls.hh
index caba12e..82f10d1 100644
--- a/nls/fluxbox-nls.hh
+++ b/nls/fluxbox-nls.hh
@@ -54,6 +54,7 @@ enum {
54 CommonVisible = 18, 54 CommonVisible = 18,
55 CommonBackgroundWarning = 19, 55 CommonBackgroundWarning = 19,
56 CommonDefaultWindowMenuFile = 20, 56 CommonDefaultWindowMenuFile = 20,
57 CommonAutoRaise = 21,
57 58
58 ConfigmenuSet = 4, 59 ConfigmenuSet = 4,
59 ConfigmenuAntiAlias = 1, 60 ConfigmenuAntiAlias = 1,
diff --git a/src/Slit.cc b/src/Slit.cc
index d03f61b..b628d18 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -235,6 +235,8 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
235 scr.name() + ".slit.acceptKdeDockapps", scr.altName() + ".Slit.AcceptKdeDockapps"), 235 scr.name() + ".slit.acceptKdeDockapps", scr.altName() + ".Slit.AcceptKdeDockapps"),
236 m_rc_auto_hide(scr.resourceManager().lock(), false, 236 m_rc_auto_hide(scr.resourceManager().lock(), false,
237 scr.name() + ".slit.autoHide", scr.altName() + ".Slit.AutoHide"), 237 scr.name() + ".slit.autoHide", scr.altName() + ".Slit.AutoHide"),
238 m_rc_auto_raise(scr.resourceManager().lock(), false,
239 scr.name() + ".slit.autoRaise", scr.altName() + ".Slit.AutoRaise"),
238 // TODO: this resource name must change 240 // TODO: this resource name must change
239 m_rc_maximize_over(scr.resourceManager(), false, 241 m_rc_maximize_over(scr.resourceManager(), false,
240 scr.name() + ".slit.maxOver", scr.altName() + ".Slit.MaxOver"), 242 scr.name() + ".slit.maxOver", scr.altName() + ".Slit.MaxOver"),
@@ -957,6 +959,9 @@ void Slit::buttonPressEvent(XButtonEvent &be) {
957 959
958 960
959void Slit::enterNotifyEvent(XCrossingEvent &) { 961void Slit::enterNotifyEvent(XCrossingEvent &) {
962 if (m_rc_auto_raise)
963 m_layeritem->moveToLayer(ResourceLayer::ABOVE_DOCK);
964
960 if (! doAutoHide()) 965 if (! doAutoHide())
961 return; 966 return;
962 967
@@ -971,6 +976,9 @@ void Slit::enterNotifyEvent(XCrossingEvent &) {
971 976
972 977
973void Slit::leaveNotifyEvent(XCrossingEvent &ev) { 978void Slit::leaveNotifyEvent(XCrossingEvent &ev) {
979 if (m_rc_auto_raise)
980 m_layeritem->moveToLayer(m_rc_layernum->getNum());
981
974 if (! doAutoHide()) 982 if (! doAutoHide())
975 return; 983 return;
976 984
@@ -1207,6 +1215,9 @@ void Slit::setupMenu() {
1207 m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"), 1215 m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"),
1208 m_rc_auto_hide, 1216 m_rc_auto_hide,
1209 save_and_reconfigure_slit)); 1217 save_and_reconfigure_slit));
1218 m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoRaise, "Auto raise", "This thing automatically raises when entered"),
1219 m_rc_auto_raise,
1220 save_and_reconfigure_slit));
1210 1221
1211 m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"), 1222 m_slitmenu.insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),
1212 m_rc_maximize_over, 1223 m_rc_maximize_over,
diff --git a/src/Slit.hh b/src/Slit.hh
index cffc087..0b476b5 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -182,7 +182,7 @@ private:
182 static unsigned int s_eventmask; 182 static unsigned int s_eventmask;
183 Strut *m_strut; 183 Strut *m_strut;
184 184
185 FbTk::Resource<bool> m_rc_kde_dockapp, m_rc_auto_hide, m_rc_maximize_over; 185 FbTk::Resource<bool> m_rc_kde_dockapp, m_rc_auto_hide, m_rc_auto_raise, m_rc_maximize_over;
186 FbTk::Resource<Slit::Placement> m_rc_placement; 186 FbTk::Resource<Slit::Placement> m_rc_placement;
187 FbTk::Resource<int> m_rc_alpha, m_rc_on_head; 187 FbTk::Resource<int> m_rc_alpha, m_rc_on_head;
188 FbTk::Resource<class ResourceLayer> m_rc_layernum; 188 FbTk::Resource<class ResourceLayer> m_rc_layernum;
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index cb52066..23a8244 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -194,6 +194,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
194 // lock rcmanager here 194 // lock rcmanager here
195 m_rc_auto_hide(scrn.resourceManager().lock(), false, 195 m_rc_auto_hide(scrn.resourceManager().lock(), false,
196 scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"), 196 scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"),
197 m_rc_auto_raise(scrn.resourceManager().lock(), false,
198 scrn.name() + ".toolbar.autoRaise", scrn.altName() + ".Toolbar.AutoRaise"),
197 m_rc_maximize_over(scrn.resourceManager(), false, 199 m_rc_maximize_over(scrn.resourceManager(), false,
198 scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"), 200 scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"),
199 m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"), 201 m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"),
@@ -522,6 +524,9 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
522} 524}
523 525
524void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { 526void Toolbar::enterNotifyEvent(XCrossingEvent &ce) {
527 if (m_rc_auto_raise)
528 m_layeritem.moveToLayer(ResourceLayer::ABOVE_DOCK);
529
525 Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0, 530 Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0,
526 Keys::ON_TOOLBAR); 531 Keys::ON_TOOLBAR);
527 532
@@ -552,6 +557,9 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &event) {
552 return; 557 return;
553 } 558 }
554 559
560 if (m_rc_auto_raise)
561 m_layeritem.moveToLayer(m_rc_layernum->getNum());
562
555 Fluxbox::instance()->keys()->doAction(event.type, event.state, 0, 563 Fluxbox::instance()->keys()->doAction(event.type, event.state, 0,
556 Keys::ON_TOOLBAR); 564 Keys::ON_TOOLBAR);
557 565
@@ -762,6 +770,10 @@ void Toolbar::setupMenus(bool skip_new_placement) {
762 "Auto hide", "Toggle auto hide of toolbar"), 770 "Auto hide", "Toggle auto hide of toolbar"),
763 m_rc_auto_hide, 771 m_rc_auto_hide,
764 reconfig_toolbar_and_save_resource)); 772 reconfig_toolbar_and_save_resource));
773 menu().insertItem(new FbTk::BoolMenuItem(_FB_XTEXT(Common, AutoRaise,
774 "Auto raise", "Toggle auto raise of toolbar"),
775 m_rc_auto_raise,
776 reconfig_toolbar_and_save_resource));
765 777
766 MenuItem *toolbar_menuitem = 778 MenuItem *toolbar_menuitem =
767 new FbTk::IntMenuItem(_FB_XTEXT(Toolbar, WidthPercent, 779 new FbTk::IntMenuItem(_FB_XTEXT(Toolbar, WidthPercent,
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index a1631bd..47569f6 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -185,7 +185,7 @@ private:
185 Strut *m_strut; ///< created and destroyed by BScreen 185 Strut *m_strut; ///< created and destroyed by BScreen
186 186
187 // resources 187 // resources
188 FbTk::Resource<bool> m_rc_auto_hide, m_rc_maximize_over, m_rc_visible; 188 FbTk::Resource<bool> m_rc_auto_hide, m_rc_auto_raise, m_rc_maximize_over, m_rc_visible;
189 FbTk::Resource<int> m_rc_width_percent; 189 FbTk::Resource<int> m_rc_width_percent;
190 FbTk::Resource<int> m_rc_alpha; 190 FbTk::Resource<int> m_rc_alpha;
191 FbTk::Resource<class ResourceLayer> m_rc_layernum; 191 FbTk::Resource<class ResourceLayer> m_rc_layernum;