diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-20 14:20:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-20 14:20:20 +0300 |
commit | 7221f5dd436a8534c6797718f2c83b0fb5f8b136 (patch) | |
tree | 762559ebe4fb16a3fcd9dd53b1f141414f07f551 /src | |
parent | ca790028cb845f56e021fad84bc58d9e251785a4 (diff) | |
download | manaplus-7221f5dd436a8534c6797718f2c83b0fb5f8b136.tar.gz manaplus-7221f5dd436a8534c6797718f2c83b0fb5f8b136.tar.bz2 manaplus-7221f5dd436a8534c6797718f2c83b0fb5f8b136.tar.xz manaplus-7221f5dd436a8534c6797718f2c83b0fb5f8b136.zip |
Add support for onscreen buttons in format 3x2.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/tabs/setup_touch.cpp | 5 | ||||
-rw-r--r-- | src/input/touch/touchmanager.cpp | 24 |
2 files changed, 27 insertions, 2 deletions
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); } |