diff --git a/harbour-sailtuner.pro b/harbour-sailtuner.pro index 066ffe2..f85a287 100644 --- a/harbour-sailtuner.pro +++ b/harbour-sailtuner.pro @@ -1,7 +1,7 @@ QT += qml quick gui multimedia dbus TARGET = harbour-sailtuner -CONFIG += c++11 sailfishapp sailfishapp_i18n +CONFIG += c++11 sailfishapp sailfishapp_i18n sailfishapp_no_deploy_qml DEFINES += TARGET=\""$(TARGET")\" diff --git a/qml/CircleMeter.qml b/qml/CircleMeter.qml index bc23b1a..44606c3 100644 --- a/qml/CircleMeter.qml +++ b/qml/CircleMeter.qml @@ -94,6 +94,9 @@ Item { function find_region() { var l1 = min var l2 + + if (!marks) return [0,0,0] + for (var i = 0; i < marks.length; i++) { if (i == marks.length - 1) l2 = max else l2 = (marks[i] + marks[i+1]) / 2 @@ -138,6 +141,7 @@ Item { line_mark(ctx, j, r_circle_min - l_submarker, r_circle_min + l_submarker) } + ctx.fillStyle = theme.primaryColor for (var i = 0; i < marks.length; i++) { ctx.strokeStyle = theme.secondaryColor ctx.lineWidth = h_marker @@ -287,11 +291,11 @@ Item { arrow.requestPaint() regions.update_level() } - +/* MouseArea { anchors.fill: parent onClicked: { level = Math.random() * (max - min) + min } - } + }*/ } diff --git a/qml/Desktop.qml b/qml/Desktop.qml index efb3cc9..707929a 100644 --- a/qml/Desktop.qml +++ b/qml/Desktop.qml @@ -2,8 +2,8 @@ import QtQuick 2.0 import LJTuner 1.0 Item { - width: 400 - height: 300 + width: 600 + height: 500 Tuner { id: tuner @@ -14,7 +14,8 @@ Item { id: theme } - SimpleDisplay { + TunerScreen { + anchors.fill: parent theme: theme tuner: tuner } diff --git a/qml/Sailfish.qml b/qml/Sailfish.qml index 93680bd..99018a7 100644 --- a/qml/Sailfish.qml +++ b/qml/Sailfish.qml @@ -23,7 +23,8 @@ ApplicationWindow { SilicaFlickable { anchors.fill: parent - SimpleDisplay { + TunerScreen { + anchors.fill: parent theme: Theme tuner: app.tuner } diff --git a/qml/ScaleToise.qml b/qml/ScaleToise.qml index d41215e..1c3d40d 100644 --- a/qml/ScaleToise.qml +++ b/qml/ScaleToise.qml @@ -8,6 +8,8 @@ import QtQuick 2.0 Item { id: scale + + property QtObject theme // note or note + 12 * octave property int note: 1 @@ -20,6 +22,7 @@ Item { property int notes_style: 0 property color colorAltered: "#40888888" + property color colorNatural: "transparent" property int h_margin: Math.max(height / 8, main_note.border_d) @@ -63,21 +66,25 @@ Item { height: parent.height border.width: 1 property int note: (index + nb_notes + first_note) % nb_notes - color: isAltered(note) ? colorAltered : "transparent" + color: isAltered(note) ? colorAltered : colorNatural Text { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter text: note_name(note) + color: theme.primaryColor + font.pixelSize: parent.height / 2 } } } } + /* MouseArea { anchors.fill: parent onClicked: note = Math.random() * 100 } + */ // Screen for actual note Rectangle { diff --git a/qml/TunerScreen.qml b/qml/TunerScreen.qml index 02666ee..31c42dd 100644 --- a/qml/TunerScreen.qml +++ b/qml/TunerScreen.qml @@ -20,17 +20,25 @@ Item { anchors.top: parent.top anchors.topMargin: h_margin + anchors.horizontalCenter: parent.horizontalCenter - width: parent.width + width: Math.min(parent.width, parent.height * 1.5) height: width / 2 + + level: tuner.deviation * 100 } ScaleToise { id: toise + theme: parent.theme + anchors.top: meter.bottom anchors.topMargin: h_margin - anchors.left: parent.left - width: parent.width + anchors.horizontalCenter: parent.horizontalCenter + + width: meter.width height: width / 10 + + note: tuner.note * tuner.octave } } diff --git a/qml/desktop.qrc b/qml/desktop.qrc index 711246e..0dd5d9e 100644 --- a/qml/desktop.qrc +++ b/qml/desktop.qrc @@ -3,5 +3,8 @@ Desktop.qml SimpleDisplay.qml DesktopTheme.qml +TunerScreen.qml +CircleMeter.qml +ScaleToise.qml diff --git a/qml/sailfish.qrc b/qml/sailfish.qrc index 759e477..199445d 100644 --- a/qml/sailfish.qrc +++ b/qml/sailfish.qrc @@ -2,5 +2,8 @@ Sailfish.qml SimpleDisplay.qml +TunerScreen.qml +CircleMeter.qml +ScaleToise.qml diff --git a/src/desktop.cpp b/src/desktop.cpp index c36a7fe..e680616 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -41,6 +41,7 @@ Q_DECL_EXPORT int main(int argc, char* argv[]) QGuiApplication app(argc, argv); QQuickView view; view.setSource(QUrl("qrc:///qml/Desktop.qml")); + view.setResizeMode(view.SizeRootObjectToView); view.show(); return app.exec(); }