Compare commits
2
Commits
ecf00de898
...
b2d5c0d5fb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2d5c0d5fb | ||
|
|
f1d01cadf8 |
@@ -16,7 +16,7 @@ PanelWindow {
|
|||||||
anchors.left: true
|
anchors.left: true
|
||||||
|
|
||||||
// implicitHeight: screen.height/6
|
// implicitHeight: screen.height/6
|
||||||
implicitHeight: contentHeight+(content.spacing*(notificationListModel.count-1))
|
implicitHeight: Math.max(contentHeight+(content.spacing*(notificationListModel.count-1)), 0)
|
||||||
implicitWidth: contentWidth
|
implicitWidth: contentWidth
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Rectangle {
|
|||||||
property bool closing: false
|
property bool closing: false
|
||||||
|
|
||||||
property real duration: (
|
property real duration: (
|
||||||
notification.expireTimeout > 0 ? notification.expireTimeout :
|
notification.expireTimeout > 0 ? notification.expireTimeout*1000 :
|
||||||
urgency ? urgency * 2000 :
|
urgency ? urgency * 2000 :
|
||||||
5000
|
5000
|
||||||
)
|
)
|
||||||
@@ -47,7 +47,7 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.closeNotification(true)
|
root.closeNotification(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Column {
|
Column {
|
||||||
@@ -62,11 +62,47 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.width: Config.border_width
|
border.width: Config.border_width
|
||||||
border.color: textColor
|
border.color: textColor
|
||||||
|
|
||||||
|
MouseArea { // covers cross only, not whole row
|
||||||
|
id: closingMouseArea
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.margins: Config.spacing // or 10 to match Row margins
|
||||||
|
|
||||||
|
width: closeIconText.height
|
||||||
|
height: closeIconText.height // Config.screen_height_to_font_small(screen.height) ~12-16
|
||||||
|
|
||||||
|
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: {
|
||||||
|
mouse.accepted=true
|
||||||
|
root.closeNotification(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: contentRow
|
id: contentRow
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
spacing: Config.spacing*4
|
spacing: Config.spacing*4
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
// Left side: icon + icon information
|
// Left side: icon + icon information
|
||||||
Rectangle{
|
Rectangle{
|
||||||
@@ -77,7 +113,7 @@ Rectangle {
|
|||||||
Column {
|
Column {
|
||||||
id: iconColumn
|
id: iconColumn
|
||||||
// height: Math.max(childrenRect.height, contentBodyColumn.height)
|
// height: Math.max(childrenRect.height, contentBodyColumn.height)
|
||||||
width: 1.25*128
|
width: 1.25*iconImage.width
|
||||||
spacing: Config.spacing
|
spacing: Config.spacing
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
@@ -121,6 +157,7 @@ Rectangle {
|
|||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: contentBodyColumn
|
id: contentBodyColumn
|
||||||
width: root.width - iconColumn.width
|
width: root.width - iconColumn.width
|
||||||
@@ -306,7 +343,7 @@ Rectangle {
|
|||||||
from: 1.0
|
from: 1.0
|
||||||
to: 0.0
|
to: 0.0
|
||||||
duration: root.duration
|
duration: root.duration
|
||||||
paused: mouseArea.containsMouse
|
paused: mouseArea.containsMouse || closingMouseArea.containsMouse || inlineReplyButtonMouseArea.containsMouse
|
||||||
|
|
||||||
onFinished: root.closeNotification(false)
|
onFinished: root.closeNotification(false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user