Skip to content

Commit

Permalink
investigating new layouts for the autogain window
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmm committed Sep 22, 2024
1 parent b038c61 commit 9291226
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 125 deletions.
86 changes: 76 additions & 10 deletions src/contents/ui/Autogain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,85 @@ Kirigami.ScrollablePage {

}

Kirigami.Card {
}

contentItem: EeInputOutputGain {
Layout.fillWidth: true
}
header: Kirigami.ActionToolBar {
Layout.margins: Kirigami.Units.smallSpacing
alignment: Qt.AlignHCenter
position: Controls.ToolBar.Header
flat: true
actions: [
Kirigami.Action {

displayComponent: EeSpinBox {
id: inputGain

label: i18n("Input")
from: -36
to: 36
// value: pluginDB.inputGain
decimals: 0
stepSize: 1
unit: "dB"
boxWidth: 5 * Kirigami.Units.gridUnit
onValueModified: (v) => {
pluginDB.inputGain = v;
}
}

}
},
Kirigami.Action {

displayComponent: EeCircularProgress {
value: 0.6
}

},
Kirigami.Action {

displayComponent: EeCircularProgress {
value: 0.4
}

},
Kirigami.Action {
enabled: false
separator: true
},
Kirigami.Action {

displayComponent: EeSpinBox {
id: outputGain

label: i18n("Output")
from: -36
to: 36
// value: pluginDB.outputGain
decimals: 0
stepSize: 1
unit: "dB"
boxWidth: 5 * Kirigami.Units.gridUnit
onValueModified: (v) => {
pluginDB.outputGain = v;
}
}

},
Kirigami.Action {

displayComponent: EeCircularProgress {
value: 0.3
}

},
Kirigami.Action {

displayComponent: EeCircularProgress {
value: 0.8
}

}
]
}

footer: RowLayout {
Expand All @@ -175,11 +246,6 @@ Kirigami.ScrollablePage {
color: Kirigami.Theme.disabledTextColor
}

EeCircularProgress {
implicitWidth: implicitHeight
value: 0.65
}

Kirigami.ActionToolBar {
Layout.margins: Kirigami.Units.smallSpacing
alignment: Qt.AlignRight
Expand Down
8 changes: 5 additions & 3 deletions src/contents/ui/EeCircularProgress.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Rectangle {
property real to: 1
readonly property real clampedValue: Common.clamp(value, from, to)

implicitWidth: parent.width
implicitHeight: parent.height
implicitWidth: valueLabel.implicitWidth + Kirigami.Units.largeSpacing
implicitHeight: valueLabel.implicitWidth + Kirigami.Units.largeSpacing
radius: width / 2
color: Kirigami.Theme.neutralBackgroundColor
border.color: Kirigami.Theme.activeBackgroundColor
Expand Down Expand Up @@ -47,8 +47,10 @@ Rectangle {
}

Text {
id: valueLabel

anchors.centerIn: parent
text: root.value.toString()
text: Number(root.value).toLocaleString(Qt.locale())
color: Kirigami.Theme.textColor
}

Expand Down
147 changes: 36 additions & 111 deletions src/contents/ui/EeInputOutputGain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,130 +11,55 @@ Item {
id: grid

anchors.fill: parent
columns: 2
columns: 3
rows: 2
columnSpacing: Kirigami.Units.smallSpacing
rowSpacing: Kirigami.Units.smallSpacing

RowLayout {
Controls.Label {
Layout.alignment: Qt.AlignLeft
text: i18n("Input")
EeSpinBox {
id: inputGain

label: i18n("Input")
from: -36
to: 36
// value: pluginDB.inputGain
decimals: 0
stepSize: 1
unit: "dB"
onValueModified: (v) => {
pluginDB.inputGain = v;
}

Controls.Slider {
id: inputGain

Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
orientation: Qt.Horizontal
value: 0
from: -36
to: 36
stepSize: 1
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: inputGain.value + " dB"
}

}

GridLayout {
columns: 2
rows: 2

Controls.ProgressBar {
id: inputLevelLeft

Layout.fillWidth: true
from: 0
to: 1
value: 0.25
indeterminate: false
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: "-1"
}

Controls.ProgressBar {
id: inputLevelRight

Layout.fillWidth: true
from: 0
to: 1
value: 0.25
indeterminate: false
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: "-1"
}

EeCircularProgress {
value: 0.2
}

RowLayout {
Controls.Label {
Layout.alignment: Qt.AlignLeft
text: i18n("Output")
}

Controls.Slider {
id: outputGain

Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
orientation: Qt.Horizontal
value: 0
from: -36
to: 36
stepSize: 1
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: outputGain.value + " dB"
}

EeCircularProgress {
value: 0.75
}

GridLayout {
columns: 2
rows: 2

Controls.ProgressBar {
id: outputLevelLeft

Layout.fillWidth: true
from: 0
to: 1
value: 0.25
indeterminate: false
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: "-1"
}

Controls.ProgressBar {
id: outputLevelRight

Layout.fillWidth: true
from: 0
to: 1
value: 0.25
indeterminate: false
EeSpinBox {
id: outputGain

label: i18n("Output")
from: -36
to: 36
// value: pluginDB.outputGain
decimals: 0
stepSize: 1
unit: "dB"
onValueModified: (v) => {
pluginDB.outputGain = v;
}
}

Controls.Label {
Layout.alignment: Qt.AlignRight
text: "-1"
}
EeCircularProgress {
value: 0.35
}

EeCircularProgress {
value: 0.3
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/EeProgressBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ FormCard.AbstractFormDelegate {
Label {
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
text: clampedValue + " " + control.unit
text: Number(clampedValue).toLocaleString(Qt.locale()) + " " + control.unit
elide: control.elide
color: control.enabled ? Kirigami.Theme.textColor : Kirigami.Theme.disabledTextColor
wrapMode: control.wrapMode
Expand Down

0 comments on commit 9291226

Please sign in to comment.