From 6915c38ca9c35bfb9a5ea05fe957463d644a75de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 1 Oct 2013 01:41:48 +0300 Subject: Add on screen buttons layout 3x3, 4x2, 4x3 --- src/gui/widgets/tabs/setup_touch.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'src/gui/widgets/tabs') diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp index e3081427d..6e3c12a02 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -42,12 +42,15 @@ static const char *const sizeList[] = N_("Large") }; -static const int formatListSize = 2; +static const int formatListSize = 5; static const char *const formatList[] = { "2x1", "2x2", + "3x3", + "4x2", + "4x3" }; Setup_Touch::Setup_Touch(const Widget2 *const widget) : @@ -105,25 +108,14 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : new SetupItemDropDown(_("Buttons size"), "", "screenButtonsSize", this, "screenButtonsSizeEvent", mSizeList, 100); - // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 1U), "", - "screenActionButton0", this, "screenActionButton0Event", - mActionsList, 250); - - // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 2U), "", - "screenActionButton1", this, "screenActionButton1Event", - mActionsList, 250); - - // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 3U), "", - "screenActionButton2", this, "screenActionButton2Event", - mActionsList, 250); - - // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 4U), "", - "screenActionButton3", this, "screenActionButton3Event", - mActionsList, 250); + for (unsigned int f = 0; f < 12; f ++) + { + std::string key = strprintf("screenActionButton%u", f); + std::string event = strprintf("screenActionButton%uEvent", f); + // TRANSLATORS: settings option + new SetupActionDropDown(strprintf(_("Button %u action"), f + 1), "", + key, this, event, mActionsList, 250); + } setDimension(gcn::Rectangle(0, 0, 550, 350)); } -- cgit v1.2.3-60-g2f50