summaryrefslogtreecommitdiff
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
parent4972739b76c2cbe9fe587e591431632b9e3cb547 (diff)
downloadplus-69a160b711732ece6c1038230ece6401597e6c7c.tar.gz
plus-69a160b711732ece6c1038230ece6401597e6c7c.tar.bz2
plus-69a160b711732ece6c1038230ece6401597e6c7c.tar.xz
plus-69a160b711732ece6c1038230ece6401597e6c7c.zip
Fix onscreen buttons position.
New theme option: clickborder - clickable border near onscreen button.
-rw-r--r--data/graphics/gui/dbutton.xml3
-rw-r--r--data/themes/jewelry/dbutton.xml3
-rw-r--r--src/touchmanager.cpp7
3 files changed, 9 insertions, 4 deletions
diff --git a/data/graphics/gui/dbutton.xml b/data/graphics/gui/dbutton.xml
index f6640dda3..ff625fcbb 100644
--- a/data/graphics/gui/dbutton.xml
+++ b/data/graphics/gui/dbutton.xml
@@ -2,8 +2,9 @@
<skinset name="Default" image="window.png">
<widget type="Window" xpos="486" ypos="232">
<option name="padding" value="20" />
+ <option name="clickborder" value="0" />
<option name="x" value="0" />
- <option name="y" value="0" />
+ <option name="y" value="10" />
<!-- Top Row -->
<part type="top-left-corner" xpos="0" ypos="0" width="10" height="5" />
diff --git a/data/themes/jewelry/dbutton.xml b/data/themes/jewelry/dbutton.xml
index e2c59b161..cf80579da 100644
--- a/data/themes/jewelry/dbutton.xml
+++ b/data/themes/jewelry/dbutton.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<skinset name="Default" image="window.png">
<widget type="Window" xpos="371" ypos="33">
+ <option name="clickborder" value="0" />
<option name="padding" value="20" />
<option name="x" value="0" />
- <option name="y" value="0" />
+ <option name="y" value="10" />
<!-- Top Row -->
<part type="top-left-corner" xpos="0" ypos="0" width="19" height="19" />
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);