diff --git a/soloanalyser/NiceLabel.qml b/soloanalyser/NiceLabel.qml new file mode 100644 index 0000000..1523088 --- /dev/null +++ b/soloanalyser/NiceLabel.qml @@ -0,0 +1,16 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 + +/** + * 1.0: Only setting the right color in the darkmode + */ +Label { + id: control + color: sysActivePalette.text + + SystemPalette { + id: sysActivePalette; + colorGroup: SystemPalette.Active + } + +} diff --git a/soloanalyser/NiceRadioButton.qml b/soloanalyser/NiceRadioButton.qml index 2b35759..5dd8cd1 100644 --- a/soloanalyser/NiceRadioButton.qml +++ b/soloanalyser/NiceRadioButton.qml @@ -1,8 +1,15 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 +/** + * 1.0: initial + * 1.1: tweak colours in dark mode + */ RadioButton { - id: control + id: control + + width: 200 + indicator: Rectangle { implicitWidth: 20 implicitHeight: 20 @@ -21,4 +28,18 @@ RadioButton { visible: control.checked } } + + contentItem: Text { + text: control.text + font: control.font + opacity: enabled ? 1.0 : 0.3 + color: sysActivePalette.text + verticalAlignment: Text.AlignVCenter + leftPadding: control.indicator.width + control.spacing + } + + SystemPalette { + id: sysActivePalette; + colorGroup: SystemPalette.Active + } } \ No newline at end of file diff --git a/soloanalyser/SmallCheckBox.qml b/soloanalyser/SmallCheckBox.qml index 6203f7b..9ece9f7 100644 --- a/soloanalyser/SmallCheckBox.qml +++ b/soloanalyser/SmallCheckBox.qml @@ -2,20 +2,25 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 /** -* 1.1: set default leftPadding to 0 and stop adding 2 at the left of the indicator -*/ + * 1.1: set default leftPadding to 0 and stop adding 2 at the left of the indicator + * 1.2: tweak colours in dark mode + */ CheckBox { - id: schk + id: control property alias boxWidth: box.implicitWidth leftPadding : 0 + + indicator: Rectangle { id: box - implicitWidth: 20 + implicitWidth: 18 implicitHeight: implicitWidth - x: schk.leftPadding + x: control.leftPadding y: parent.height / 2 - height / 2 border.color: "grey" + + Item { id: mainContainer property var _mw: Math.max(3,box.implicitWidth * 0.2) @@ -28,13 +33,12 @@ CheckBox { Canvas { id: drawingCanvas anchors.fill: parent - visible: schk.checked + visible: control.checked onPaint: { var ctx = getContext("2d"); - ctx.lineWidth = Math.max(1.5,box.implicitWidth * 0.05); - ctx.strokeStyle = "black"; + ctx.strokeStyle = control.color; //"black"; ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(drawingCanvas.width, drawingCanvas.height); @@ -48,4 +52,19 @@ CheckBox { } } } + + contentItem: Text { + text: control.text + font: control.font + opacity: enabled ? 1.0 : 0.3 + color: sysActivePalette.text + verticalAlignment: Text.AlignVCenter + leftPadding: control.indicator.width + control.spacing + } + + SystemPalette { + id: sysActivePalette; + colorGroup: SystemPalette.Active + } + } \ No newline at end of file diff --git a/soloanalyser/soloanalyser-interactive.qml b/soloanalyser/soloanalyser-interactive.qml index d7b6aaa..9b89781 100644 --- a/soloanalyser/soloanalyser-interactive.qml +++ b/soloanalyser/soloanalyser-interactive.qml @@ -28,21 +28,18 @@ import "core.js" as Core /* - 1.4.3: IgnoreBrackettedChords option /* - 1.4.4: Don't analyse drum staves /* - 1.4.5: Port to MuseScore 4.0 -/* - 1.4.5: New plugin folder strucutre +/* - 1.4.5: New plugin folder structure +/* - 1.4.6: Darkmode /**********************************************/ MuseScore { menuPath: "Plugins.Solo Analyser." + pluginName description: "Colors and names the notes based on their role if chords/harmonies." - version: "1.4.5" + version: "1.4.6" readonly property var pluginName: "Interactive" pluginType: "dialog" -/* //implicitWidth: controls.implictWidth * 1.5 - //implicitHeight: controls.implicitHeight - implicitWidth: 900 - implicitHeight: 500*/ width: mainRow.childrenRect.width + mainRow.anchors.leftMargin + mainRow.anchors.rightMargin height: mainRow.childrenRect.height + mainRow.anchors.topMargin + mainRow.anchors.bottomMargin @@ -140,8 +137,8 @@ MuseScore { Layout.fillHeight: true Layout.fillWidth: true - Label { - text: "Note coloring" + NiceLabel { + text: "Note coloring : " //Tooltip.text : "Color all notes or only the ones defined by the chord"; Layout.alignment: Qt.AlignLeft Layout.fillHeight: false @@ -164,8 +161,8 @@ MuseScore { } - Label { - text: "Note name" + NiceLabel { + text: "Note name : " //Tooltip.text : "Name all notes or only the ones defined by the chord"; Layout.alignment: Qt.AlignLeft Layout.fillHeight: false @@ -188,8 +185,8 @@ MuseScore { } - Label { - text: "Root:" + NiceLabel { + text: "Root : " } Rectangle { id: rootColorChosser @@ -206,8 +203,8 @@ MuseScore { } } - Label { - text: "Bass:" + NiceLabel { + text: "Bass : " } Rectangle { id: bassColorChosser @@ -224,8 +221,8 @@ MuseScore { } } - Label { - text: "Chord:" + NiceLabel { + text: "Chord : " } Rectangle { id: chordColorChosser @@ -242,8 +239,8 @@ MuseScore { } } - Label { - text: "Altered:" + NiceLabel { + text: "Altered : " } Rectangle { id: alteredColorChosser @@ -260,8 +257,8 @@ MuseScore { } } - Label { - text: "Scale:" + NiceLabel { + text: "Scale : " } Rectangle { id: scaleColorChosser @@ -278,8 +275,8 @@ MuseScore { } } - /*Label { - text: "Invalid:" + /*NiceLabel { + text: "Invalid : " } Rectangle { id: errorColorChosser @@ -296,8 +293,8 @@ MuseScore { } }*/ - Label { - text: "Text form" + NiceLabel { + text: "Text form : " } NiceComboBox {