You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

127 lines
2.9 KiB

import QtQuick 2.0
import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0
import com.example.consoleemulator 1.0
import "qrc:/emulator/components"
Trackball {
property bool leftPressed: leftDown
property bool rightPressed: rightDown
property bool topPressed: topDown
property bool bottomPressed: bottomDown
property bool topLeftPressed: topLeftDown
property bool topRightPressed: topRightDown
property bool bottomLeftPressed: bottomLeftDown
property bool bottomRightPressed: bottomRightDown
onLeftDownChanged: leftPressed = leftDown
onRightDownChanged: rightPressed = rightDown
onTopDownChanged: topPressed = topDown
onBottomDownChanged: bottomPressed = bottomDown
onTopLeftDownChanged: topLeftPressed = topLeftDown
onTopRightDownChanged: topRightPressed = topRightDown
onBottomLeftDownChanged: bottomLeftPressed = bottomLeftDown
onBottomRightDownChanged: bottomRightPressed = bottomRightDown
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "leftPressed"
viewModelProperty: "trackballLeft"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "rightPressed"
viewModelProperty: "trackballRight"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topPressed"
viewModelProperty: "trackballTop"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomPressed"
viewModelProperty: "trackballBottom"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topLeftPressed"
viewModelProperty: "trackballTopLeft"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topRightPressed"
viewModelProperty: "trackballTopRight"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomLeftPressed"
viewModelProperty: "trackballBottomLeft"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomRightPressed"
viewModelProperty: "trackballBottomRight"
}
// Leds
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "leftColor"
viewModelProperty: "trackballLeft" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "rightColor"
viewModelProperty: "trackballRight" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topColor"
viewModelProperty: "trackballTop" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomColor"
viewModelProperty: "trackballBottom" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topLeftColor"
viewModelProperty: "trackballTopLeft" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "topRightColor"
viewModelProperty: "trackballTopRight" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomLeftColor"
viewModelProperty: "trackballBottomLeft" + "Led"
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "bottomRightColor"
viewModelProperty: "trackballBottomRight" + "Led"
}
}