Commit 8a8af5da authored by Andrea Bernabei's avatar Andrea Bernabei

[button] Replace dirty hack with a better, more reliable one

parent fb621fab
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
Button { Button {
// XXX HACK: We are assuming we'll find Button's private mouseArea with childAt(0,0)!!! id: butt
property variant __buttonMouseArea: childAt(0,0)
property int pressX: 0 property int pressX: 0
property int pressY: 0 property int pressY: 0
...@@ -33,17 +32,16 @@ Button { ...@@ -33,17 +32,16 @@ Button {
// XXX HACK: Workaround for QQC Button not exposing x/y of pressed state // XXX HACK: Workaround for QQC Button not exposing x/y of pressed state
// We need those for Glacier's Button pressed effect // We need those for Glacier's Button pressed effect
Connections { Connections {
target: __buttonMouseArea target: butt.__behavior
onPressed: { onPressed: {
pressX = mouse.x pressX = mouse.x
pressY = mouse.y pressY = mouse.y
} }
onPositionChanged: { onPositionChanged: {
pressX = mouse.x pressX = mouse.x
pressY = mouse.y pressY = mouse.y
} }
} }
} }
...@@ -9,7 +9,8 @@ THEME_IMPORT_PATH = QtQuick/Controls/Styles/Nemo/themes ...@@ -9,7 +9,8 @@ THEME_IMPORT_PATH = QtQuick/Controls/Styles/Nemo/themes
QML_FILES += \ QML_FILES += \
Button.qml Button.qml
OTHER_FILES += qmldir OTHER_FILES += qmldir \
$$QML_FILES
HEADERS += \ HEADERS += \
qquicknemocontrolsextensionplugin.h \ qquicknemocontrolsextensionplugin.h \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment