feat(tabs): update all tab views, dialogs, and session controller
This commit is contained in:
@@ -17,14 +17,15 @@ Dialog {
|
||||
property bool hasOverride: streamController.overriddenSensors.indexOf(sensorIndex) >= 0
|
||||
|
||||
function openFor(index) {
|
||||
sensorIndex = index
|
||||
var dot = streamController.sensorDots[index]
|
||||
if (!dot) return
|
||||
sensorLabel = dot.label !== undefined ? String(dot.label) : String(index + 1)
|
||||
currentValue = dot.value
|
||||
valueField.text = ""
|
||||
offsetField.text = ""
|
||||
open()
|
||||
sensorIndex = index;
|
||||
var dot = streamController.sensorDots[index];
|
||||
if (!dot)
|
||||
return;
|
||||
sensorLabel = dot.label !== undefined ? String(dot.label) : String(index + 1);
|
||||
currentValue = dot.value;
|
||||
valueField.text = "";
|
||||
offsetField.text = "";
|
||||
open();
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
@@ -42,11 +43,10 @@ Dialog {
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
text: "Sensor #" + (root.sensorIndex + 1) +
|
||||
(root.sensorLabel ? " (" + root.sensorLabel + ")" : "")
|
||||
text: "Sensor #" + (root.sensorIndex + 1) + (root.sensorLabel ? " (" + root.sensorLabel + ")" : "")
|
||||
color: Theme.headingColor
|
||||
font.bold: true
|
||||
font.pixelSize: 13
|
||||
font.pixelSize: Theme.fontSm
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Rectangle {
|
||||
@@ -61,7 +61,7 @@ Dialog {
|
||||
anchors.centerIn: parent
|
||||
text: "OVERRIDE"
|
||||
color: "white"
|
||||
font.pixelSize: 10
|
||||
font.pixelSize: Theme.fontXs
|
||||
font.bold: true
|
||||
font.letterSpacing: 1
|
||||
}
|
||||
@@ -71,13 +71,21 @@ Dialog {
|
||||
Label {
|
||||
text: "Live: " + root.currentValue.toFixed(2)
|
||||
color: Theme.bodyColor
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Theme.fontSm
|
||||
}
|
||||
|
||||
Rectangle { Layout.fillWidth: true; height: 1; color: Theme.cardBorder }
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 1
|
||||
color: Theme.cardBorder
|
||||
}
|
||||
|
||||
// ── replace field ─────────────────────────────────────────
|
||||
Label { text: "Replace with value"; color: Theme.bodyColor; font.pixelSize: 11 }
|
||||
Label {
|
||||
text: "Replace with value"
|
||||
color: Theme.bodyColor
|
||||
font.pixelSize: Theme.fontXs
|
||||
}
|
||||
TextField {
|
||||
id: valueField
|
||||
Layout.fillWidth: true
|
||||
@@ -92,11 +100,21 @@ Dialog {
|
||||
color: Theme.fieldBackground
|
||||
border.width: valueField.activeFocus ? Theme.borderStrong : Theme.borderThin
|
||||
border.color: valueField.activeFocus ? Theme.fieldBorderFocus : Theme.fieldBorder
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: Theme.durationFast }
|
||||
}
|
||||
Behavior on border.color {
|
||||
ColorAnimation { duration: Theme.durationFast }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── offset field ──────────────────────────────────────────
|
||||
Label { text: "Or add offset (± delta)"; color: Theme.bodyColor; font.pixelSize: 11 }
|
||||
Label {
|
||||
text: "Or add offset (± delta)"
|
||||
color: Theme.bodyColor
|
||||
font.pixelSize: Theme.fontXs
|
||||
}
|
||||
TextField {
|
||||
id: offsetField
|
||||
Layout.fillWidth: true
|
||||
@@ -111,10 +129,20 @@ Dialog {
|
||||
color: Theme.fieldBackground
|
||||
border.width: offsetField.activeFocus ? Theme.borderStrong : Theme.borderThin
|
||||
border.color: offsetField.activeFocus ? Theme.fieldBorderFocus : Theme.fieldBorder
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: Theme.durationFast }
|
||||
}
|
||||
Behavior on border.color {
|
||||
ColorAnimation { duration: Theme.durationFast }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle { Layout.fillWidth: true; height: 1; color: Theme.cardBorder }
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 1
|
||||
color: Theme.cardBorder
|
||||
}
|
||||
|
||||
// ── buttons ───────────────────────────────────────────────
|
||||
RowLayout {
|
||||
@@ -140,20 +168,20 @@ Dialog {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.bold: true
|
||||
font.pixelSize: 13
|
||||
font.pixelSize: Theme.fontSm
|
||||
}
|
||||
onClicked: {
|
||||
if (valueField.text !== "") {
|
||||
var v = parseFloat(valueField.text)
|
||||
var v = parseFloat(valueField.text);
|
||||
if (!isNaN(v))
|
||||
streamController.replaceSensor(root.sensorIndex, v)
|
||||
streamController.replaceSensor(root.sensorIndex, v);
|
||||
}
|
||||
if (offsetField.text !== "") {
|
||||
var d = parseFloat(offsetField.text)
|
||||
var d = parseFloat(offsetField.text);
|
||||
if (!isNaN(d))
|
||||
streamController.offsetSensor(root.sensorIndex, d)
|
||||
streamController.offsetSensor(root.sensorIndex, d);
|
||||
}
|
||||
root.close()
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
Button {
|
||||
@@ -175,11 +203,11 @@ Dialog {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.bold: true
|
||||
font.pixelSize: 13
|
||||
font.pixelSize: Theme.fontSm
|
||||
}
|
||||
onClicked: {
|
||||
streamController.clearSensorEdit(root.sensorIndex)
|
||||
root.close()
|
||||
streamController.clearSensorEdit(root.sensorIndex);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
Button {
|
||||
@@ -198,10 +226,10 @@ Dialog {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.bold: true
|
||||
font.pixelSize: 13
|
||||
font.pixelSize: Theme.fontSm
|
||||
}
|
||||
onClicked: root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user