From 7221f5dd436a8534c6797718f2c83b0fb5f8b136 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Feb 2016 14:20:20 +0300 Subject: Add support for onscreen buttons in format 3x2. --- src/gui/widgets/tabs/setup_touch.cpp | 5 +++-- src/input/touch/touchmanager.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp index 18f0e1554..f1bda8372 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -47,7 +47,7 @@ static const char *const sizeList[] = N_("Large") }; -static const int formatListSize = 5; +static const int formatListSize = 6; static const char *const formatList[] = { @@ -55,7 +55,8 @@ static const char *const formatList[] = "2x2", "3x3", "4x2", - "4x3" + "4x3", + "3x2" }; Setup_Touch::Setup_Touch(const Widget2 *const widget) : diff --git a/src/input/touch/touchmanager.cpp b/src/input/touch/touchmanager.cpp index 85dce0f9a..f9e4ebb8f 100644 --- a/src/input/touch/touchmanager.cpp +++ b/src/input/touch/touchmanager.cpp @@ -566,6 +566,30 @@ void TouchManager::loadButtons() restrict2 "screenActionButton0", ""); break; } + // 3x2 + case 5: + { + const int pad4 = pad2 * 2; + const int skipWidth2 = pad4 + x; + loadTouchItem(&mButtons[5], "dbutton.xml", "dbutton_image.xml", + "6", x, y, sz, sz, RIGHT, "screenActionButton5", ""); + loadTouchItem(&mButtons[4], "dbutton.xml", "dbutton_image.xml", + "5", skipWidth, y, sz, sz, RIGHT, + "screenActionButton4", ""); + loadTouchItem(&mButtons[3], "dbutton.xml", "dbutton_image.xml", + "4", skipWidth2, y, sz, sz, RIGHT, + "screenActionButton3", ""); + loadTouchItem(&mButtons[2], "dbutton.xml", "dbutton_image.xml", + "3", x, skipHeight, sz, sz, RIGHT, + "screenActionButton2", ""); + loadTouchItem(&mButtons[1], "dbutton.xml", "dbutton_image.xml", + "2", skipWidth, skipHeight, sz, sz, RIGHT, + "screenActionButton1", ""); + loadTouchItem(&mButtons[0], "dbutton.xml", "dbutton_image.xml", + "1", skipWidth2, skipHeight, sz, sz, RIGHT, + "screenActionButton0", ""); + break; + } }; theme->unload(skin); } -- cgit v1.2.3-60-g2f50