diff --git a/NotifyModule/NotificationHistoryView.qml b/NotifyModule/NotificationHistoryView.qml index b4b8974..4fcf5d6 100644 --- a/NotifyModule/NotificationHistoryView.qml +++ b/NotifyModule/NotificationHistoryView.qml @@ -1,27 +1,20 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Controls.Material 2.15 +import QtQuick.Layouts 1.3 -Popup { +Dialog { id: root readonly property var historyModel: notificationService.history - ToolBar { + header: ToolBar { id: toolbar - width: parent.width - height: parent.height * 0.1 - anchors { - top: parent.top - left: parent.left - right: parent.right - } ToolButton { id: clearAllButton - text: qsTr("Clear All") + text: qsTr("clear") height: parent.height - font.pointSize: 10 anchors { left: parent.left verticalCenter: parent.verticalCenter @@ -33,53 +26,25 @@ Popup { Label { id: toolbarTitle text: qsTr("Notification history") - font.pointSize: 12 anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter } } - - ToolButton { - id: closePopupButton - text: "X" - font.pointSize: 12 - anchors { - right: parent.right - verticalCenter: parent.verticalCenter - } - - onClicked: root.close() - } } - ListView { + contentItem: ListView { id: notificationLV - width: parent.width - height: parent.height * 0.9 clip: true - spacing: 5 + spacing: 10 model: historyModel - anchors { - top: toolbar.bottom - horizontalCenter: parent.horizontalCenter - } - ScrollBar.vertical: ScrollBar { - hoverEnabled: true - active: hovered || pressed - anchors { - top: notificationLV.top - right: notificationLV.right - bottom: notificationLV.bottom - } - } + ScrollBar.vertical: ScrollBar {} delegate: SwipeDelegate { id: swipeDelegate text: model.notificationValue width: notificationLV.width - height: notificationLV.height * 0.15 ListView.onRemove: SequentialAnimation { @@ -91,9 +56,9 @@ Popup { NumberAnimation { target: swipeDelegate - property: "height" - to: 0 - duration: 20 + property: "x" + to: -swipeDelegate.width + duration: 200 easing.type: Easing.InOutQuad } @@ -104,43 +69,33 @@ Popup { } } - contentItem: Row { - width: parent.width - spacing: width * 0.2 + contentItem: RowLayout { Image { - id: notificationIcon - width: notificationIcon.sourceSize.width * 0.2 - height: notificationIcon.sourceSize.height * 0.2 + id: image + Layout.preferredWidth: toolbar.height; + Layout.preferredHeight: toolbar.height; + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + + fillMode: Image.PreserveAspectCrop + clip: true source: model.icon - fillMode: Image.PreserveAspectFit - anchors { - verticalCenter: parent.verticalCenter - } } - Column { - id: column - width: parent.width - notificationIcon.width - parent.spacing - anchors { - verticalCenter: parent.verticalCenter - } - + ColumnLayout { Label { id: notificationTitle - width: parent.width - text: qsTr(model.title) - font.pointSize: 12 + text: model.title elide: Label.ElideRight } Label { id: notificationText - width: parent.width - text: qsTr(model.text) - font.pointSize: 12 + text: model.text elide: Label.ElideRight linkColor: Material.accent + wrapMode: Text.WordWrap + Layout.fillWidth: true } } } diff --git a/NotifyModule/NotificationServiceView.qml b/NotifyModule/NotificationServiceView.qml index 3a23658..27a1262 100644 --- a/NotifyModule/NotificationServiceView.qml +++ b/NotifyModule/NotificationServiceView.qml @@ -76,8 +76,9 @@ Item { NotificationHistoryView { id: history - width: parent.width * 0.8 - height: parent.height * 0.5 + width: Math.min(Math.max(Math.min(parent.width * 0.6, 1024 ), 320), parent.width) + height: Math.min(Math.max(Math.min(parent.height * 0.6, 720), 240), parent.height) + anchors.centerIn: parent } diff --git a/qmlNotify_languages/de.ts b/qmlNotify_languages/de.ts index b918166..5f635ac 100644 --- a/qmlNotify_languages/de.ts +++ b/qmlNotify_languages/de.ts @@ -8,4 +8,19 @@ <translation>Botschaft</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/en.ts b/qmlNotify_languages/en.ts index 9d8f17e..d53a1e0 100644 --- a/qmlNotify_languages/en.ts +++ b/qmlNotify_languages/en.ts @@ -8,4 +8,19 @@ <translation>Message</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/es.ts b/qmlNotify_languages/es.ts index ffb535e..ebefb5f 100644 --- a/qmlNotify_languages/es.ts +++ b/qmlNotify_languages/es.ts @@ -8,4 +8,19 @@ <translation>Mensaje</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/fr.ts b/qmlNotify_languages/fr.ts index b1d0e30..9ce777a 100644 --- a/qmlNotify_languages/fr.ts +++ b/qmlNotify_languages/fr.ts @@ -8,4 +8,19 @@ <translation>Un message</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/ja.ts b/qmlNotify_languages/ja.ts index 84649da..2a2dd2c 100644 --- a/qmlNotify_languages/ja.ts +++ b/qmlNotify_languages/ja.ts @@ -8,4 +8,19 @@ <translation>メッセージ</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/pl.ts b/qmlNotify_languages/pl.ts index 5d17eaf..f517a72 100644 --- a/qmlNotify_languages/pl.ts +++ b/qmlNotify_languages/pl.ts @@ -8,4 +8,19 @@ <translation>Wiadomość</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/ru.ts b/qmlNotify_languages/ru.ts index 2e44356..5a676a6 100644 --- a/qmlNotify_languages/ru.ts +++ b/qmlNotify_languages/ru.ts @@ -8,4 +8,19 @@ <translation>Cообщение</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/tr.ts b/qmlNotify_languages/tr.ts index aefaa8f..c19218f 100644 --- a/qmlNotify_languages/tr.ts +++ b/qmlNotify_languages/tr.ts @@ -8,4 +8,19 @@ <translation>İleti</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/uk.ts b/qmlNotify_languages/uk.ts index 04fd4ff..0226e27 100644 --- a/qmlNotify_languages/uk.ts +++ b/qmlNotify_languages/uk.ts @@ -8,4 +8,19 @@ <translation>Повідомлення</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/qmlNotify_languages/zh.ts b/qmlNotify_languages/zh.ts index db5c2bf..e4a644f 100644 --- a/qmlNotify_languages/zh.ts +++ b/qmlNotify_languages/zh.ts @@ -8,4 +8,19 @@ <translation>信息</translation> </message> </context> +<context> + <name>NotificationHistoryView</name> + <message> + <source>Notification history</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>clear</source> + <translation type="unfinished"></translation> + </message> +</context> </TS>