summaryrefslogtreecommitdiff
path: root/gui/components/VPNMouseArea.qml
blob: 44d6465e2b14092c43a5ad94b59e529c2b4c92d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import QtQuick 2.5
import "../themes/themes.js" as Theme

MouseArea {
    id: mouseArea

    property var targetEl: parent
    property var uiState: Theme.uiState
    property var onMouseAreaClicked: function () {
        parent.clicked()
    }

    //function changeState(stateName) {
    //    if (mouseArea.hoverEnabled)
    //       targetEl.state = stateName;
    //}
    anchors.fill: parent
    hoverEnabled: true
    cursorShape: !hoverEnabled ? Qt.ForbiddenCursor : Qt.PointingHandCursor
    //onPressed: {
    //    console.debug("button pressed")
    //changeState(uiState.statePressed)
    //}
    //onEntered: changeState(uiState.stateHovered)
    //onExited: changeState(uiState.stateDefault)
    //onCanceled: changeState(uiState.stateDefault)


    /*
    onReleased: {
        if (hoverEnabled) {
            changeState(uiState.stateDefault);
            onMouseAreaClicked();
        }
    }
*/
}