diff --git a/src/contents/ui/main.qml b/src/contents/ui/main.qml index 5a507ef9887240227d7701d5eb06b7db96ab2f96..e830600047d1fd53dee00637daef7756ab9ca5d0 100644 --- a/src/contents/ui/main.qml +++ b/src/contents/ui/main.qml @@ -71,77 +71,89 @@ Kirigami.ApplicationWindow { } } } - Kirigami.CardsListView { - anchors.fill: parent - id: vehicleView - model: vehicleModel - delegate: Kirigami.Card { - id: card - banner { - title: name - } - header: Row{ - topPadding: 10.0 - rightPadding: 10.0 - leftPadding: 10.0 - layoutDirection: Qt.RightToLeft - spacing: 5 - Controls.Label { - text: vin - visible: root.wideScreen && mainPage.width > 550 - anchors.verticalCenter: parent.verticalCenter - } - Image { - id: vinIcon - source: "qrc:/license.svg" - sourceSize.width: 32 - sourceSize.height: 32 - anchors.verticalCenter: parent.verticalCenter - MouseArea { - id: vinMouse - hoverEnabled: true - anchors.fill: vinIcon - } - Controls.ToolTip { - id: vinTip + Layouts.ColumnLayout { + anchors.fill: parent + Kirigami.InlineMessage { //TODO:connect to code to detect car alerts. + Layouts.Layout.fillWidth: true + Layouts.Layout.leftMargin: 10 + Layouts.Layout.rightMargin: 10 + z: 9997 + type: Kirigami.MessageType.Information + id: infoMessage + showCloseButton: true + } + Kirigami.CardsListView { + anchors.fill: parent + id: vehicleView + model: vehicleModel + delegate: Kirigami.Card { + id: card + banner { + title: name + } + header: Row{ + topPadding: 10.0 + rightPadding: 10.0 + leftPadding: 10.0 + layoutDirection: Qt.RightToLeft + spacing: 5 + Controls.Label { text: vin - visible: vinMouse.containsMouse + visible: root.wideScreen && mainPage.width > 550 + anchors.verticalCenter: parent.verticalCenter + } + Image { + id: vinIcon + source: "qrc:/license.svg" + sourceSize.width: 32 + sourceSize.height: 32 + anchors.verticalCenter: parent.verticalCenter + MouseArea { + id: vinMouse + hoverEnabled: true + anchors.fill: vinIcon + } + Controls.ToolTip { + id: vinTip + text: vin + visible: vinMouse.containsMouse + } } - } - } - contentItem: Item{ - implicitHeight: Kirigami.Units.gridUnit * 4 - Layouts.ColumnLayout { - Kirigami.Heading { - text: maker + " " + vmodel - level: 2 - } - Kirigami.Heading { - text: year - level: 4 - } } - } - actions: [ - Kirigami.Action { - text: qsTr("Examine Logs") - iconName: "edit-find" - onTriggered: { - router.navigateToRoute(["main", {"route": "servicerecords", "data": {"id": id, "name": name}}]); + contentItem: Item{ + implicitHeight: Kirigami.Units.gridUnit * 4 + Layouts.ColumnLayout { + Kirigami.Heading { + text: maker + " " + vmodel + level: 2 + } + Kirigami.Heading { + text: year + level: 4 + } } } - ] - hiddenActions: [ - Kirigami.Action { - text: qsTr("Delete") - iconName: "edit-delete" - onTriggered: { - vehicleModel.removeVehicle(index); + actions: [ + Kirigami.Action { + text: qsTr("Examine Logs") + iconName: "edit-find" + onTriggered: { + router.navigateToRoute(["main", {"route": "servicerecords", "data": {"id": id, "name": name}}]); + } } - } - ] - } - Controls.ScrollBar.vertical: Controls.ScrollBar {} + ] + hiddenActions: [ + Kirigami.Action { + text: qsTr("Delete") + iconName: "edit-delete" + onTriggered: { + vehicleModel.removeVehicle(index); + } + } + ] + } + Controls.ScrollBar.vertical: Controls.ScrollBar {} + } } } }