Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47562185f1 | ||
|
|
4f49575069 | ||
|
|
8c6662871a | ||
|
|
b2d5c0d5fb | ||
|
|
f1d01cadf8 |
@@ -16,7 +16,7 @@ PanelWindow {
|
||||
anchors.left: true
|
||||
|
||||
// implicitHeight: screen.height/6
|
||||
implicitHeight: contentHeight+(content.spacing*(notificationListModel.count-1))
|
||||
implicitHeight: Math.max(contentHeight+(content.spacing*(notificationListModel.count-1)), 0)
|
||||
implicitWidth: contentWidth
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Rectangle {
|
||||
property bool closing: false
|
||||
|
||||
property real duration: (
|
||||
notification.expireTimeout > 0 ? notification.expireTimeout :
|
||||
notification.expireTimeout > 0 ? notification.expireTimeout*1000 :
|
||||
urgency ? urgency * 2000 :
|
||||
5000
|
||||
)
|
||||
@@ -42,12 +42,20 @@ Rectangle {
|
||||
root.dismissed(root.notification, dismiss)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.notification
|
||||
function onClosed(reason){
|
||||
// It is known that it can be triggered twice and delete multiple Index but since it is only temporary display and the chance is low it is ignored
|
||||
root.closeNotification(false)
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
root.closeNotification(true)
|
||||
root.closeNotification(false)
|
||||
}
|
||||
}
|
||||
Column {
|
||||
@@ -62,11 +70,47 @@ Rectangle {
|
||||
color: "transparent"
|
||||
border.width: Config.border_width
|
||||
border.color: textColor
|
||||
|
||||
MouseArea {
|
||||
id: closingMouseArea
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.margins: Config.spacing
|
||||
|
||||
width: closeIconText.implicitHeight + Config.spacing
|
||||
height: closeIconText.implicitHeight + Config.spacing
|
||||
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Config.radius
|
||||
color: parent.containsMouse ? Colors.errorContainer : "transparent"
|
||||
|
||||
border.width: Config.border_width
|
||||
border.color: parent.containsMouse ? Colors.error : textColor
|
||||
|
||||
Text {
|
||||
id: closeIconText
|
||||
anchors.centerIn: parent
|
||||
text: "✕"; // or "✕"
|
||||
font.family: Config.font
|
||||
font.pixelSize: Config.screen_height_to_font_small(screen.height)
|
||||
color: parent.parent.containsMouse ? Colors.error_fg : textColor
|
||||
}
|
||||
}
|
||||
onClicked: function(mouse){
|
||||
mouse.accepted=true
|
||||
root.closeNotification(true)
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
id: contentRow
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
spacing: Config.spacing*4
|
||||
width: parent.width
|
||||
|
||||
// Left side: icon + icon information
|
||||
Rectangle{
|
||||
@@ -77,7 +121,7 @@ Rectangle {
|
||||
Column {
|
||||
id: iconColumn
|
||||
// height: Math.max(childrenRect.height, contentBodyColumn.height)
|
||||
width: 1.25*128
|
||||
width: 1.25*iconImage.width
|
||||
spacing: Config.spacing
|
||||
|
||||
Image {
|
||||
@@ -121,6 +165,7 @@ Rectangle {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
color: "transparent"
|
||||
|
||||
Column {
|
||||
id: contentBodyColumn
|
||||
width: root.width - iconColumn.width
|
||||
@@ -199,7 +244,8 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
onClicked: function(mouse){
|
||||
mouse.accepted=true
|
||||
modelData.invoke()
|
||||
// resident check is allready in .invoke()
|
||||
root.closeNotification(false)
|
||||
@@ -280,7 +326,8 @@ Rectangle {
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
onClicked: function(mouse){
|
||||
mouse.accepted=true;
|
||||
console.log("[NotificationBodyInlineReply]: Pressed SEND:", inlineReplyTextField.text)
|
||||
inlineReplyRectangle.sendReply(inlineReplyTextField.text)
|
||||
}
|
||||
@@ -306,7 +353,7 @@ Rectangle {
|
||||
from: 1.0
|
||||
to: 0.0
|
||||
duration: root.duration
|
||||
paused: mouseArea.containsMouse
|
||||
paused: mouseArea.containsMouse || closingMouseArea.containsMouse || inlineReplyButtonMouseArea.containsMouse
|
||||
|
||||
onFinished: root.closeNotification(false)
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ Item {
|
||||
notificationSound.play()
|
||||
}
|
||||
|
||||
// destroy()
|
||||
destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user