SailTuner/qml/TunerScreen.qml

52 lines
988 B
QML
Raw Normal View History

2015-12-27 14:01:07 +03:00
import QtQuick 2.0
/**
* Main tuner screen
*
*/
Item {
id: main
2015-12-27 14:01:07 +03:00
/// tuner object
property QtObject tuner
/// theme corresponding to Silica Theme object
property QtObject theme
anchors.fill: parent
2016-01-01 20:43:42 +03:00
property int h_margin: (height - meter.height - toise.height) / 3
2015-12-27 14:01:07 +03:00
CircleMeter {
id: meter
2015-12-27 14:01:07 +03:00
theme: parent.theme
2016-01-01 20:43:42 +03:00
anchors.top: parent.top
anchors.topMargin: h_margin
anchors.horizontalCenter: parent.horizontalCenter
2016-01-01 20:43:42 +03:00
width: Math.min(parent.width, parent.height * 1.5)
height: width / 2
2016-01-02 12:19:37 +03:00
level: tuner.found ? tuner.deviation * 100 : -50
}
Item {
2016-01-01 20:43:42 +03:00
anchors.top: meter.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
ScaleToise {
id: toise
theme: main.theme
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: meter.width
height: Math.max(width / 10, theme.fontSizeLarge * 1.8)
note: tuner.note + toise.nb_notes * tuner.octave
}
2015-12-27 14:01:07 +03:00
}
}