as
This commit is contained in:
+90
-20
@@ -23,6 +23,61 @@ Item {
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 6
|
||||
Text {
|
||||
text: "Интервал, мин"
|
||||
color: page.muted
|
||||
font.pixelSize: 12
|
||||
}
|
||||
TextField {
|
||||
id: intervalField
|
||||
Layout.preferredWidth: 72
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
color: page.fg
|
||||
font.pixelSize: 13
|
||||
Component.onCompleted: text = String(sensorsBridge.reportIntervalMin)
|
||||
background: Rectangle {
|
||||
color: "#1a1a28"
|
||||
border.color: "#555570"
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: sensorsBridge
|
||||
onChanged: {
|
||||
// Не затирать поле, пока пользователь печатает.
|
||||
if (!intervalField.activeFocus)
|
||||
intervalField.text = String(sensorsBridge.reportIntervalMin)
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: "Сохранить"
|
||||
Layout.preferredHeight: 32
|
||||
onClicked: {
|
||||
var v = parseInt(intervalField.text, 10)
|
||||
if (isNaN(v) || v < 1) v = 1
|
||||
if (v > 65535) v = 65535
|
||||
if (!sensorsBridge.saveReportIntervalMin(v))
|
||||
console.warn("save interval failed")
|
||||
}
|
||||
background: Rectangle {
|
||||
radius: 3
|
||||
color: parent.down ? "#3a3a58" : "#2a2a40"
|
||||
border.color: "#555570"
|
||||
}
|
||||
contentItem: Text {
|
||||
text: parent.text
|
||||
color: page.fg
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
}
|
||||
|
||||
// Table header
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
@@ -31,13 +86,15 @@ Item {
|
||||
radius: 2
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 6
|
||||
anchors.rightMargin: 6
|
||||
spacing: 4
|
||||
Text { Layout.preferredWidth: parent.width * 0.34; text: "MAC"; color: page.muted; font.pixelSize: 12 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.18; text: "Аккум."; color: page.muted; font.pixelSize: 12 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.26; text: "Показание"; color: page.muted; font.pixelSize: 12 }
|
||||
Text { Layout.fillWidth: true; text: "RSSI"; color: page.muted; font.pixelSize: 12 }
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
spacing: 2
|
||||
Text { Layout.preferredWidth: parent.width * 0.18; text: "Имя"; color: page.muted; font.pixelSize: 11 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.26; text: "MAC"; color: page.muted; font.pixelSize: 11 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.12; text: "Аккум."; color: page.muted; font.pixelSize: 11 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.18; text: "Показание"; color: page.muted; font.pixelSize: 11 }
|
||||
Text { Layout.preferredWidth: parent.width * 0.12; text: "RSSI"; color: page.muted; font.pixelSize: 11 }
|
||||
Text { Layout.fillWidth: true; text: "Давно"; color: page.muted; font.pixelSize: 11 }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,33 +113,46 @@ Item {
|
||||
opacity: modelData.empty ? 0.45 : 1.0
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 6
|
||||
anchors.rightMargin: 6
|
||||
spacing: 4
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
spacing: 2
|
||||
Text {
|
||||
Layout.preferredWidth: parent.width * 0.34
|
||||
text: modelData.empty ? ("слот " + modelData.slot) : modelData.mac
|
||||
Layout.preferredWidth: parent.width * 0.18
|
||||
text: modelData.empty ? ("слот " + modelData.slot) : (modelData.name || "—")
|
||||
color: page.fg
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: 11
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Text {
|
||||
Layout.preferredWidth: parent.width * 0.18
|
||||
text: modelData.empty ? "—" : modelData.battery
|
||||
Layout.preferredWidth: parent.width * 0.26
|
||||
text: modelData.empty ? "—" : modelData.mac
|
||||
color: page.fg
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: 11
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Text {
|
||||
Layout.preferredWidth: parent.width * 0.26
|
||||
Layout.preferredWidth: parent.width * 0.12
|
||||
text: modelData.empty ? "—" : modelData.battery
|
||||
color: page.fg
|
||||
font.pixelSize: 11
|
||||
}
|
||||
Text {
|
||||
Layout.preferredWidth: parent.width * 0.18
|
||||
text: modelData.empty ? "—" : modelData.reading
|
||||
color: page.fg
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: 11
|
||||
}
|
||||
Text {
|
||||
Layout.preferredWidth: parent.width * 0.12
|
||||
text: modelData.empty ? "—" : modelData.rssi
|
||||
color: page.fg
|
||||
font.pixelSize: 11
|
||||
}
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: modelData.empty ? "—" : modelData.rssi
|
||||
text: modelData.empty ? "—" : modelData.age
|
||||
color: page.fg
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: 11
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user