From d0cfc6412b1d931b09d457cac2959b4881136ca4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Dec 2012 13:43:46 +0300 Subject: Replace sliders to dropdowns in touch setup page. --- src/gui/setup_touch.cpp | 26 +++++++++++++++++--------- src/gui/setup_touch.h | 3 ++- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src/gui') 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 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 -- cgit v1.2.3-60-g2f50