Add a Placeholder in button views if there are no presses yet
This commit is contained in:
parent
33feaed389
commit
314acedd13
@ -38,9 +38,10 @@ RowLayout {
|
|||||||
id: root
|
id: root
|
||||||
implicitWidth: childrenRect.width
|
implicitWidth: childrenRect.width
|
||||||
|
|
||||||
property var device: null
|
property Device device: null
|
||||||
readonly property var deviceClass: device ? engine.deviceManager.deviceClasses.getDeviceClass(device.deviceClassId) : null
|
readonly property var deviceClass: device ? engine.deviceManager.deviceClasses.getDeviceClass(device.deviceClassId) : null
|
||||||
readonly property var openState: device ? device.states.getState(deviceClass.stateTypes.findByName("state").id) : null
|
readonly property var openState: device ? device.states.getState(deviceClass.stateTypes.findByName("state").id) : null
|
||||||
|
readonly property bool canStop: device && device.deviceClass.actionTypes.findByName("stop")
|
||||||
|
|
||||||
property bool invert: false
|
property bool invert: false
|
||||||
|
|
||||||
@ -66,6 +67,7 @@ RowLayout {
|
|||||||
ItemDelegate {
|
ItemDelegate {
|
||||||
Layout.preferredWidth: app.iconSize * 2
|
Layout.preferredWidth: app.iconSize * 2
|
||||||
Layout.preferredHeight: width
|
Layout.preferredHeight: width
|
||||||
|
visible: root.canStop
|
||||||
// color: Material.foreground
|
// color: Material.foreground
|
||||||
// radius: height / 2
|
// radius: height / 2
|
||||||
|
|
||||||
|
|||||||
@ -38,9 +38,20 @@ import "../customviews"
|
|||||||
DevicePageBase {
|
DevicePageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
EmptyViewPlaceholder {
|
||||||
|
anchors { left: parent.left; right: parent.right; margins: app.margins }
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
title: qsTr("This switch has not been used yet.")
|
||||||
|
text: qsTr("Press a button on the switch to see logs appearing here.")
|
||||||
|
visible: logView.logsModel.count === 0
|
||||||
|
buttonVisible: false
|
||||||
|
imageSource: "../images/system-shutdown.svg"
|
||||||
|
}
|
||||||
|
|
||||||
GenericTypeLogView {
|
GenericTypeLogView {
|
||||||
anchors.fill: parent
|
|
||||||
id: logView
|
id: logView
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
logsModel: engine.jsonRpcClient.ensureServerVersion("1.10") ? logsModelNg : logsModel
|
logsModel: engine.jsonRpcClient.ensureServerVersion("1.10") ? logsModelNg : logsModel
|
||||||
LogsModelNg {
|
LogsModelNg {
|
||||||
|
|||||||
@ -319,6 +319,7 @@ MainPageTile {
|
|||||||
ItemDelegate {
|
ItemDelegate {
|
||||||
Layout.preferredHeight: app.iconSize
|
Layout.preferredHeight: app.iconSize
|
||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
|
enabled: centerIcon.name.length > 0
|
||||||
ColorIcon {
|
ColorIcon {
|
||||||
id: centerIcon
|
id: centerIcon
|
||||||
width: app.iconSize
|
width: app.iconSize
|
||||||
@ -332,10 +333,10 @@ MainPageTile {
|
|||||||
return ""
|
return ""
|
||||||
case "garagegate":
|
case "garagegate":
|
||||||
case "blind":
|
case "blind":
|
||||||
case "extendedblind":
|
|
||||||
case "awning":
|
case "awning":
|
||||||
case "extendedawning":
|
|
||||||
case "shutter":
|
case "shutter":
|
||||||
|
case "extendedblind":
|
||||||
|
case "extendedawning":
|
||||||
case "extendedshutter":
|
case "extendedshutter":
|
||||||
return "../images/media-playback-stop.svg"
|
return "../images/media-playback-stop.svg"
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user