~aacid/ubuntu-ui-toolkit/nonsquareicons

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/AbstractButton.qml

  • Committer: Tarmac
  • Author(s): Zsombor Egri, Florian Boucault, CI Train Bot, Tim Peeters
  • Date: 2015-02-11 13:51:42 UTC
  • mfrom: (1405.1.2 rtm-to-staging)
  • Revision ID: tarmac-20150211135142-kr635b7awvx84acd
RTM branch diff merge. Fixes: https://bugs.launchpad.net/bugs/1358610.

Approved by PS Jenkins bot, Zoltan Balogh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 */
16
16
 
17
17
import QtQuick 2.0
18
 
import QtFeedback 5.0
19
18
import Ubuntu.Components 1.1
20
19
 
21
20
/*!
83
82
 
84
83
    activeFocusOnPress: true
85
84
 
86
 
    HapticsEffect {
87
 
        id: pressEffect
88
 
        attackIntensity: 0.0
89
 
        attackTime: 50
90
 
        intensity: 1.0
91
 
        duration: 10
92
 
        fadeTime: 50
93
 
        fadeIntensity: 0.0
94
 
    }
95
 
 
96
85
    MouseArea {
97
86
        id: mouseArea
98
87
        anchors.fill: parent
100
89
        // as it might occlude the newly assigned mouse area.
101
90
        hoverEnabled: true
102
91
 
 
92
        // invoke Haptics singleton earlier than we press the button,
 
93
        // so we give some time for the singleton to sync settings with the service
 
94
        property bool hapticsEnabled: Haptics.enabled
 
95
 
103
96
        onClicked: {
104
97
            if (button.__acceptEvents) {
105
 
                pressEffect.start()
 
98
                // FIXME (Vivid) call this in the style rather than from AbstractButton
 
99
                Haptics.play();
106
100
                button.clicked()
107
101
            }
108
102
        }