From 40c44b227bd93a365e214ebfa410eae01a56b5fb Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 15 Jul 2004 14:20:19 +0000 Subject: mouse scroll on icons changes workspace --- src/IconButton.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/IconButton.cc b/src/IconButton.cc index 748d87b..0c383d1 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconButton.cc,v 1.21 2004/06/16 15:38:19 rathnor Exp $ +// $Id: IconButton.cc,v 1.22 2004/07/15 14:20:19 fluxgen Exp $ #include "IconButton.hh" @@ -29,6 +29,7 @@ #include "Screen.hh" #include "Window.hh" #include "WinClient.hh" +#include "CommandParser.hh" #include "FbTk/App.hh" #include "FbTk/SimpleCommand.hh" @@ -93,7 +94,10 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, ExposureMask | ButtonPressMask | ButtonReleaseMask), m_use_pixmap(true) { - FbTk::RefCount hidemenus(new FbTk::SimpleCommand(win.screen(), &BScreen::hideMenus)); + typedef FbTk::RefCount RefCmd; + RefCmd hidemenus(new FbTk::SimpleCommand(win.screen(), &BScreen::hideMenus)); + RefCmd next_workspace(CommandParser::instance().parseLine("nextworkspace")); + RefCmd prev_workspace(CommandParser::instance().parseLine("prevworkspace")); //!! TODO: There're some issues with MacroCommand when // this object dies when the last macrocommand is executed (focused cmd) // In iconbar mode Icons @@ -104,6 +108,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FbTk::RefCount menu_cmd(new ::ShowMenu(m_win)); setOnClick(focus_cmd, 1); setOnClick(menu_cmd, 3); + setOnClick(next_workspace, 4); + setOnClick(prev_workspace, 5); m_win.hintSig().attach(this); FbTk::EventManager::instance()->add(*this, m_icon_window); -- cgit v0.11.2