summaryrefslogtreecommitdiff
path: root/src/touchmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-06 23:41:16 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-06 23:41:16 +0300
commit69a160b711732ece6c1038230ece6401597e6c7c (patch)
treec7a8da2fbe837bea9b8d186ba7841b1046ae2f28 /src/touchmanager.cpp
parent4972739b76c2cbe9fe587e591431632b9e3cb547 (diff)
downloadmv-69a160b711732ece6c1038230ece6401597e6c7c.tar.gz
mv-69a160b711732ece6c1038230ece6401597e6c7c.tar.bz2
mv-69a160b711732ece6c1038230ece6401597e6c7c.tar.xz
mv-69a160b711732ece6c1038230ece6401597e6c7c.zip
Fix onscreen buttons position.
New theme option: clickborder - clickable border near onscreen button.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r--src/touchmanager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index 18bcd4a0d..f18c8e12a 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -128,6 +128,9 @@ void TouchManager::loadTouchItem(TouchItem **item, std::string name,
y = skin->getOption("y", 10);
const int pad = skin->getPadding();
const int pad2 = 2 * pad;
+ const int border = skin->getOption("clickborder");
+ const int border2 = border * 2;
+ const int diff = pad - border;
switch (type)
{
case LEFT:
@@ -141,8 +144,8 @@ void TouchManager::loadTouchItem(TouchItem **item, std::string name,
default:
break;
}
- *item = new TouchItem(gcn::Rectangle(x, y,
- width + pad2, height + pad2), type,
+ *item = new TouchItem(gcn::Rectangle(x + diff, y + diff,
+ width + border2, height + border2), type,
eventPressed, eventReleased, images, icon,
x + pad, y + pad, width, height,
fAll, fPressed, fReleased, fOut);