Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[button] Replace dirty hack with a better, more reliable one
  • Loading branch information
faenil committed Oct 11, 2013
1 parent fb621fa commit 8a8af5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/controls/Button.qml
Expand Up @@ -19,11 +19,10 @@

import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0

Button {
// XXX HACK: We are assuming we'll find Button's private mouseArea with childAt(0,0)!!!
property variant __buttonMouseArea: childAt(0,0)
id: butt

property int pressX: 0
property int pressY: 0

Expand All @@ -33,17 +32,16 @@ Button {
// XXX HACK: Workaround for QQC Button not exposing x/y of pressed state
// We need those for Glacier's Button pressed effect
Connections {
target: __buttonMouseArea
target: butt.__behavior
onPressed: {
pressX = mouse.x
pressY = mouse.y
}
onPositionChanged: {
onPositionChanged: {
pressX = mouse.x
pressY = mouse.y
}
}

}


3 changes: 2 additions & 1 deletion src/controls/controls.pro
Expand Up @@ -9,7 +9,8 @@ THEME_IMPORT_PATH = QtQuick/Controls/Styles/Nemo/themes
QML_FILES += \
Button.qml

OTHER_FILES += qmldir
OTHER_FILES += qmldir \
$$QML_FILES

HEADERS += \
qquicknemocontrolsextensionplugin.h \
Expand Down

0 comments on commit 8a8af5d

Please sign in to comment.