SailTuner/qml/TunerScreen.qml

45 lines
855 B
QML
Raw Normal View History

2015-12-27 14:01:07 +03:00
import QtQuick 2.0
/**
* Main tuner screen
*
*/
Item {
/// 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
}
ScaleToise {
id: toise
theme: parent.theme
2016-01-01 20:43:42 +03:00
anchors.top: meter.bottom
anchors.topMargin: h_margin * 2
anchors.horizontalCenter: parent.horizontalCenter
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
}
}