4
0
mirror of https://github.com/QuasarApp/SimpleQmlNotify.git synced 2025-05-03 08:49:37 +00:00

Merge pull request from QuasarApp/histury_ui_fixes

Ssome gui fixes:
This commit is contained in:
Snegovoy Alex 2023-04-16 12:40:29 +03:00 committed by GitHub
commit 7de9ea7a23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 176 additions and 70 deletions

@ -1,27 +1,20 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15 import QtQuick.Controls.Material 2.15
import QtQuick.Layouts 1.3
Popup { Dialog {
id: root id: root
readonly property var historyModel: notificationService.history readonly property var historyModel: notificationService.history
ToolBar { header: ToolBar {
id: toolbar id: toolbar
width: parent.width
height: parent.height * 0.1
anchors {
top: parent.top
left: parent.left
right: parent.right
}
ToolButton { ToolButton {
id: clearAllButton id: clearAllButton
text: qsTr("Clear All") text: qsTr("clear")
height: parent.height height: parent.height
font.pointSize: 10
anchors { anchors {
left: parent.left left: parent.left
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -33,53 +26,25 @@ Popup {
Label { Label {
id: toolbarTitle id: toolbarTitle
text: qsTr("Notification history") text: qsTr("Notification history")
font.pointSize: 12
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
ToolButton {
id: closePopupButton
text: "X"
font.pointSize: 12
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
} }
onClicked: root.close() contentItem: ListView {
}
}
ListView {
id: notificationLV id: notificationLV
width: parent.width
height: parent.height * 0.9
clip: true clip: true
spacing: 5 spacing: 10
model: historyModel model: historyModel
anchors {
top: toolbar.bottom
horizontalCenter: parent.horizontalCenter
}
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {}
hoverEnabled: true
active: hovered || pressed
anchors {
top: notificationLV.top
right: notificationLV.right
bottom: notificationLV.bottom
}
}
delegate: SwipeDelegate { delegate: SwipeDelegate {
id: swipeDelegate id: swipeDelegate
text: model.notificationValue text: model.notificationValue
width: notificationLV.width width: notificationLV.width
height: notificationLV.height * 0.15
ListView.onRemove: SequentialAnimation { ListView.onRemove: SequentialAnimation {
@ -91,9 +56,9 @@ Popup {
NumberAnimation { NumberAnimation {
target: swipeDelegate target: swipeDelegate
property: "height" property: "x"
to: 0 to: -swipeDelegate.width
duration: 20 duration: 200
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
@ -104,43 +69,33 @@ Popup {
} }
} }
contentItem: Row { contentItem: RowLayout {
width: parent.width
spacing: width * 0.2
Image { Image {
id: notificationIcon id: image
width: notificationIcon.sourceSize.width * 0.2 Layout.preferredWidth: toolbar.height;
height: notificationIcon.sourceSize.height * 0.2 Layout.preferredHeight: toolbar.height;
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
fillMode: Image.PreserveAspectCrop
clip: true
source: model.icon 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 { Label {
id: notificationTitle id: notificationTitle
width: parent.width text: model.title
text: qsTr(model.title)
font.pointSize: 12
elide: Label.ElideRight elide: Label.ElideRight
} }
Label { Label {
id: notificationText id: notificationText
width: parent.width text: model.text
text: qsTr(model.text)
font.pointSize: 12
elide: Label.ElideRight elide: Label.ElideRight
linkColor: Material.accent linkColor: Material.accent
wrapMode: Text.WordWrap
Layout.fillWidth: true
} }
} }
} }

@ -76,8 +76,9 @@ Item {
NotificationHistoryView { NotificationHistoryView {
id: history id: history
width: parent.width * 0.8 width: Math.min(Math.max(Math.min(parent.width * 0.6, 1024 ), 320), parent.width)
height: parent.height * 0.5 height: Math.min(Math.max(Math.min(parent.height * 0.6, 720), 240), parent.height)
anchors.centerIn: parent anchors.centerIn: parent
} }

@ -8,4 +8,19 @@
<translation>Botschaft</translation> <translation>Botschaft</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Message</translation> <translation>Message</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Mensaje</translation> <translation>Mensaje</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Un message</translation> <translation>Un message</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Wiadomość</translation> <translation>Wiadomość</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Cообщение</translation> <translation>Cообщение</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>İleti</translation> <translation>İleti</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation>Повідомлення</translation> <translation>Повідомлення</translation>
</message> </message>
</context> </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> </TS>

@ -8,4 +8,19 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </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> </TS>