aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsimonb <simonb>2005-09-07 16:46:17 (GMT)
committersimonb <simonb>2005-09-07 16:46:17 (GMT)
commit070a216aa88ed56d391db8b73e7e9356e90742bb (patch)
tree0fdc7090dd22dda004ef6a44f774999f6c3bed29 /src
parentcfb26be26928c53a0be267f4707041bb82371519 (diff)
downloadfluxbox-070a216aa88ed56d391db8b73e7e9356e90742bb.zip
fluxbox-070a216aa88ed56d391db8b73e7e9356e90742bb.tar.bz2
Add titlebar scrolling options (thanks Krzysiek Pawlik <krzysiek.pawlik__AT__people.pl>)
New init options added: session.screenN.windowScrollAction: Shade|NextTab - set the action that happens when scrolling on the titlebar session.screenN.windowScrollReverse: true|false - reverse the action direction
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc5
-rw-r--r--src/Screen.hh5
-rw-r--r--src/Window.cc30
-rw-r--r--src/Window.hh4
4 files changed, 43 insertions, 1 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 6d30cef..4433000 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -202,7 +202,10 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
202 gc_cap_style(rm, 202 gc_cap_style(rm,
203 FbTk::GContext::CAPNOTLAST, 203 FbTk::GContext::CAPNOTLAST,
204 scrname+".overlay.capStyle", 204 scrname+".overlay.capStyle",
205 altscrname+".overlay.CapStyle") { 205 altscrname+".overlay.CapStyle"),
206 scroll_action(rm, "", scrname+".windowScrollAction", altscrname+".WindowScrollAction"),
207 scroll_reverse(rm, false, scrname+".windowScrollReverse", altscrname+".WindowScrollReverse") {
208
206 209
207} 210}
208 211
diff --git a/src/Screen.hh b/src/Screen.hh
index 3316fab..bac0f29 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -141,6 +141,9 @@ public:
141 141
142 inline FollowModel getFollowModel() const { return *resource.follow_model; } 142 inline FollowModel getFollowModel() const { return *resource.follow_model; }
143 143
144 inline const std::string &getScrollAction() const { return *resource.scroll_action; }
145 inline const bool getScrollReverse() const { return *resource.scroll_reverse; }
146
144 inline Slit *slit() { return m_slit.get(); } 147 inline Slit *slit() { return m_slit.get(); }
145 inline const Slit *slit() const { return m_slit.get(); } 148 inline const Slit *slit() const { return m_slit.get(); }
146 149
@@ -465,6 +468,8 @@ private:
465 FbTk::Resource<FbTk::GContext::LineStyle> gc_line_style; 468 FbTk::Resource<FbTk::GContext::LineStyle> gc_line_style;
466 FbTk::Resource<FbTk::GContext::JoinStyle> gc_join_style; 469 FbTk::Resource<FbTk::GContext::JoinStyle> gc_join_style;
467 FbTk::Resource<FbTk::GContext::CapStyle> gc_cap_style; 470 FbTk::Resource<FbTk::GContext::CapStyle> gc_cap_style;
471 FbTk::Resource<std::string> scroll_action;
472 FbTk::Resource<bool> scroll_reverse;
468 473
469 } resource; 474 } resource;
470 475
diff --git a/src/Window.cc b/src/Window.cc
index 93fbea7..12f40fb 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1788,6 +1788,19 @@ void FluxboxWindow::shade() {
1788 1788
1789} 1789}
1790 1790
1791void FluxboxWindow::shadeOn() {
1792
1793 if (!shaded)
1794 shade();
1795
1796}
1797
1798void FluxboxWindow::shadeOff() {
1799
1800 if (shaded)
1801 shade();
1802
1803}
1791 1804
1792void FluxboxWindow::stick() { 1805void FluxboxWindow::stick() {
1793 1806
@@ -3752,6 +3765,10 @@ void FluxboxWindow::setupWindow() {
3752 CommandRef maximize_horiz_cmd(new WindowCmd(*this, &FluxboxWindow::maximizeHorizontal)); 3765 CommandRef maximize_horiz_cmd(new WindowCmd(*this, &FluxboxWindow::maximizeHorizontal));
3753 CommandRef close_cmd(new WindowCmd(*this, &FluxboxWindow::close)); 3766 CommandRef close_cmd(new WindowCmd(*this, &FluxboxWindow::close));
3754 CommandRef shade_cmd(new WindowCmd(*this, &FluxboxWindow::shade)); 3767 CommandRef shade_cmd(new WindowCmd(*this, &FluxboxWindow::shade));
3768 CommandRef shade_on_cmd(new WindowCmd(*this, &FluxboxWindow::shadeOn));
3769 CommandRef shade_off_cmd(new WindowCmd(*this, &FluxboxWindow::shadeOff));
3770 CommandRef next_tab_cmd(new WindowCmd(*this, &FluxboxWindow::nextClient));
3771 CommandRef prev_tab_cmd(new WindowCmd(*this, &FluxboxWindow::prevClient));
3755 CommandRef raise_cmd(new WindowCmd(*this, &FluxboxWindow::raise)); 3772 CommandRef raise_cmd(new WindowCmd(*this, &FluxboxWindow::raise));
3756 CommandRef lower_cmd(new WindowCmd(*this, &FluxboxWindow::lower)); 3773 CommandRef lower_cmd(new WindowCmd(*this, &FluxboxWindow::lower));
3757 CommandRef raise_and_focus_cmd(new WindowCmd(*this, &FluxboxWindow::raiseAndFocus)); 3774 CommandRef raise_and_focus_cmd(new WindowCmd(*this, &FluxboxWindow::raiseAndFocus));
@@ -3837,6 +3854,19 @@ void FluxboxWindow::setupWindow() {
3837 frame().setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1 3854 frame().setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1
3838 frame().setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3 3855 frame().setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3
3839 frame().setOnClickTitlebar(lower_cmd, 2); // on release with button 2 3856 frame().setOnClickTitlebar(lower_cmd, 2); // on release with button 2
3857
3858 int reverse = 0;
3859 if (screen().getScrollReverse())
3860 reverse = 1;
3861
3862 if (StringUtil::strcasestr(screen().getScrollAction(), std::string("shade")) == 0) {
3863 frame().setOnClickTitlebar(shade_on_cmd, 5 - reverse); // shade on mouse roll
3864 frame().setOnClickTitlebar(shade_off_cmd, 4 + reverse); // unshade if rolled oposite direction
3865 } else if (StringUtil::strcasestr(screen().getScrollAction(), std::string("nexttab")) == 0) {
3866 frame().setOnClickTitlebar(next_tab_cmd, 5 - reverse); // next tab
3867 frame().setOnClickTitlebar(prev_tab_cmd, 4 + reverse); // previous tab
3868 }
3869
3840 frame().setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval()); 3870 frame().setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval());
3841 3871
3842 // end setup frame 3872 // end setup frame
diff --git a/src/Window.hh b/src/Window.hh
index b4fcdfb..176f623 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -208,6 +208,10 @@ public:
208 void maximizeFull(); 208 void maximizeFull();
209 /// toggles shade 209 /// toggles shade
210 void shade(); 210 void shade();
211 /// shades window
212 void shadeOn();
213 /// unshades window
214 void shadeOff();
211 /// toggles sticky 215 /// toggles sticky
212 void stick(); 216 void stick();
213 void raise(); 217 void raise();