mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-13 06:42:42 +02:00
Merge branch 'feat/avatarTools/avatarPackager' of github.com:thoys/hifi into feat/avatarTools/avatarPackager
This commit is contained in:
commit
37d00d9519
1 changed files with 68 additions and 0 deletions
|
@ -0,0 +1,68 @@
|
|||
import QtQuick 2.6
|
||||
|
||||
import "../../controlsUit" 1.0 as HifiControls
|
||||
import "../../stylesUit" 1.0
|
||||
|
||||
import TabletScriptingInterface 1.0
|
||||
|
||||
RalewaySemiBold {
|
||||
id: root
|
||||
|
||||
text: "no text"
|
||||
|
||||
signal clicked()
|
||||
|
||||
color: "white"
|
||||
|
||||
property var hoverColor: "#AFAFAF"
|
||||
property var pressedColor: "#575757"
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
onClicked: {
|
||||
Tablet.playSound(TabletEnums.ButtonClick);
|
||||
root.clicked()
|
||||
}
|
||||
|
||||
property string lastState: ""
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: ""
|
||||
StateChangeScript {
|
||||
script: {
|
||||
mouseArea.lastState = mouseArea.state
|
||||
}
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "pressed"
|
||||
when: mouseArea.containsMouse && mouseArea.pressed
|
||||
PropertyChanges { target: root; color: pressedColor }
|
||||
StateChangeScript {
|
||||
script: {
|
||||
mouseArea.lastState = mouseArea.state
|
||||
}
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovering"
|
||||
when: mouseArea.containsMouse
|
||||
PropertyChanges { target: root; color: hoverColor }
|
||||
StateChangeScript {
|
||||
script: {
|
||||
if (mouseArea.lastState == "") {
|
||||
Tablet.playSound(TabletEnums.ButtonHover);
|
||||
}
|
||||
mouseArea.lastState = mouseArea.state
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue