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
|
||||
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 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
|
||||
|
||||
@ -66,6 +67,7 @@ RowLayout {
|
||||
ItemDelegate {
|
||||
Layout.preferredWidth: app.iconSize * 2
|
||||
Layout.preferredHeight: width
|
||||
visible: root.canStop
|
||||
// color: Material.foreground
|
||||
// radius: height / 2
|
||||
|
||||
|
||||
@ -38,9 +38,20 @@ import "../customviews"
|
||||
DevicePageBase {
|
||||
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 {
|
||||
anchors.fill: parent
|
||||
id: logView
|
||||
anchors.fill: parent
|
||||
|
||||
logsModel: engine.jsonRpcClient.ensureServerVersion("1.10") ? logsModelNg : logsModel
|
||||
LogsModelNg {
|
||||
|
||||
@ -319,6 +319,7 @@ MainPageTile {
|
||||
ItemDelegate {
|
||||
Layout.preferredHeight: app.iconSize
|
||||
Layout.preferredWidth: height
|
||||
enabled: centerIcon.name.length > 0
|
||||
ColorIcon {
|
||||
id: centerIcon
|
||||
width: app.iconSize
|
||||
@ -332,10 +333,10 @@ MainPageTile {
|
||||
return ""
|
||||
case "garagegate":
|
||||
case "blind":
|
||||
case "extendedblind":
|
||||
case "awning":
|
||||
case "extendedawning":
|
||||
case "shutter":
|
||||
case "extendedblind":
|
||||
case "extendedawning":
|
||||
case "extendedshutter":
|
||||
return "../images/media-playback-stop.svg"
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user