summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-19 23:48:29 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-19 23:48:29 +0300
commit0b7e752bd177c90a05ca752fa31810f9e34c432c (patch)
treedb1809a48faf051af11c94058e8f126c9e9ef1ab /src/gui/widgets/tabbedarea.cpp
parent23f87c10db7e6b149e9e1f351e1a82516c545df7 (diff)
downloadmv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.gz
mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.bz2
mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.xz
mv-0b7e752bd177c90a05ca752fa31810f9e34c432c.zip
Dehardcode keys in gui widgets.
Add new tab with keys settings in input settings tab.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index bb8ea063b..b24ae32e5 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -22,6 +22,9 @@
#include "gui/widgets/tabbedarea.h"
+#include "keydata.h"
+#include "keyevent.h"
+
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/tab.h"
@@ -482,7 +485,9 @@ void TabbedArea::keyPressed(gcn::KeyEvent& keyEvent)
if (keyEvent.isConsumed() || !isFocused())
return;
- if (keyEvent.getKey().getValue() == gcn::Key::LEFT)
+ int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+
+ if (actionId == Input::KEY_GUI_LEFT)
{
int index = getSelectedTabIndex();
index--;
@@ -494,7 +499,7 @@ void TabbedArea::keyPressed(gcn::KeyEvent& keyEvent)
keyEvent.consume();
}
- else if (keyEvent.getKey().getValue() == gcn::Key::RIGHT)
+ else if (actionId == Input::KEY_GUI_RIGHT)
{
int index = getSelectedTabIndex();
index++;
@@ -507,13 +512,3 @@ void TabbedArea::keyPressed(gcn::KeyEvent& keyEvent)
keyEvent.consume();
}
}
-
-/*
-void TabbedArea::moveLeft(gcn::Tab *tab)
-{
-}
-
-void TabbedArea::moveRight(gcn::Tab *tab)
-{
-}
-*/