Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Oct 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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