summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-24 13:43:46 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-24 13:43:46 +0300
commitd0cfc6412b1d931b09d457cac2959b4881136ca4 (patch)
tree0197fe9cbcceee48c15ba2d009a2f86429703863 /src/gui
parent4451d65a33fc5f3de52ea86b27dedc16cd26c5fd (diff)
downloadmv-d0cfc6412b1d931b09d457cac2959b4881136ca4.tar.gz
mv-d0cfc6412b1d931b09d457cac2959b4881136ca4.tar.bz2
mv-d0cfc6412b1d931b09d457cac2959b4881136ca4.tar.xz
mv-d0cfc6412b1d931b09d457cac2959b4881136ca4.zip
Replace sliders to dropdowns in touch setup page.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup_touch.cpp26
-rw-r--r--src/gui/setup_touch.h3
2 files changed, 19 insertions, 10 deletions
diff --git a/src/gui/setup_touch.cpp b/src/gui/setup_touch.cpp
index e311195b8..1f1d53e0e 100644
--- a/src/gui/setup_touch.cpp
+++ b/src/gui/setup_touch.cpp
@@ -21,6 +21,7 @@
#include "gui/setup_touch.h"
#include "gui/widgets/layouthelper.h"
+#include "gui/widgets/namesmodel.h"
#include "gui/widgets/scrollarea.h"
#include "configuration.h"
@@ -29,9 +30,19 @@
#include "debug.h"
+static const int sizeListSize = 4;
+
+static const char *const sizeList[] =
+{
+ N_("Small"),
+ N_("Normal"),
+ N_("Medium"),
+ N_("Large")
+};
+
Setup_Touch::Setup_Touch(const Widget2 *const widget) :
SetupTabScroll(widget),
- mSizeList(new SetupItemNames)
+ mSizeList(new NamesModel)
{
setName(_("Touch"));
@@ -42,18 +53,15 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) :
new SetupItemCheckBox(_("Show on screen buttons"), "",
"showScreenButtons", this, "showScreenButtonsEvent");
- mSizeList->push_back(_("Small"));
- mSizeList->push_back(_("Normal"));
- mSizeList->push_back(_("Medium"));
- mSizeList->push_back(_("Large"));
- new SetupItemSlider2(_("Buttons size"), "", "screenButtonsSize", this,
- "screenButtonsSizeEvent", 0, 3, mSizeList);
+ mSizeList->fillFromArray(&sizeList[0], sizeListSize);
+ new SetupItemDropDown(_("Buttons size"), "", "screenButtonsSize", this,
+ "screenButtonsSizeEvent", mSizeList, 100);
new SetupItemCheckBox(_("Show on screen joystick"), "",
"showScreenJoystick", this, "showScreenJoystickEvent");
- new SetupItemSlider2(_("Joystick size"), "", "screenJoystickSize", this,
- "screenJoystickEvent", 0, 3, mSizeList);
+ new SetupItemDropDown(_("Joystick size"), "", "screenJoystickSize", this,
+ "screenJoystickEvent", mSizeList, 100);
setDimension(gcn::Rectangle(0, 0, 550, 350));
}
diff --git a/src/gui/setup_touch.h b/src/gui/setup_touch.h
index f0d574bdd..150bfd79a 100644
--- a/src/gui/setup_touch.h
+++ b/src/gui/setup_touch.h
@@ -26,6 +26,7 @@
#include <guichan/actionlistener.hpp>
class EditDialog;
+class NamesModel;
class TextField;
class Setup_Touch final : public SetupTabScroll
@@ -38,7 +39,7 @@ class Setup_Touch final : public SetupTabScroll
~Setup_Touch();
protected:
- SetupItemNames *mSizeList;
+ NamesModel *mSizeList;
};
#endif