**shadows** update
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
property real radius
|
||||||
|
Rectangle {
|
||||||
|
id: shadowRect
|
||||||
|
anchors.fill: root
|
||||||
|
radius: root.radius
|
||||||
|
layer.enabled: true
|
||||||
|
color: "black"
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiEffect {
|
||||||
|
id: effects
|
||||||
|
source: shadowRect
|
||||||
|
anchors.fill: shadowRect
|
||||||
|
shadowBlur: 2.0
|
||||||
|
shadowEnabled: true
|
||||||
|
shadowOpacity: 1
|
||||||
|
shadowColor: "black"
|
||||||
|
maskSource: shadowRect
|
||||||
|
maskEnabled: true
|
||||||
|
maskInverted: true
|
||||||
|
autoPaddingEnabled: true
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-21
@@ -7,6 +7,7 @@ import QtQuick.Effects
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
|
import qs.Effects
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
@@ -50,34 +51,15 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mask: Region { item: backgroundRect }
|
ShadowRect {
|
||||||
|
id: effects
|
||||||
Rectangle {
|
|
||||||
id: shadowRect
|
|
||||||
anchors {
|
anchors {
|
||||||
top: appListRect.top
|
top: appListRect.top
|
||||||
bottom: backgroundRect.bottom
|
bottom: backgroundRect.bottom
|
||||||
left: appListRect.left
|
left: appListRect.left
|
||||||
right: appListRect.right
|
right: appListRect.right
|
||||||
}
|
}
|
||||||
layer.enabled: true
|
|
||||||
radius: 8
|
radius: 8
|
||||||
color: "black"
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
MultiEffect {
|
|
||||||
id: effects
|
|
||||||
source: shadowRect
|
|
||||||
anchors.fill: shadowRect
|
|
||||||
shadowBlur: 2.0
|
|
||||||
shadowEnabled: true
|
|
||||||
shadowOpacity: 1
|
|
||||||
shadowColor: "black"
|
|
||||||
maskSource: shadowRect
|
|
||||||
maskEnabled: true
|
|
||||||
maskInverted: true
|
|
||||||
autoPaddingEnabled: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Repeater {
|
|||||||
property bool previewHidden: groupColumn.shouldShow && index > 0
|
property bool previewHidden: groupColumn.shouldShow && index > 0
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: contentColumn.height + 20
|
height: contentColumn.height + 15
|
||||||
color: Config.baseBgColor
|
color: Config.baseBgColor
|
||||||
border.color: "#555555"
|
border.color: "#555555"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
@@ -107,19 +107,25 @@ Repeater {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on height {
|
// Behavior on height {
|
||||||
Anim {
|
// Anim {
|
||||||
duration: MaterialEasing.expressiveDefaultSpatialTime
|
// duration: MaterialEasing.expressiveDefaultSpatialTime
|
||||||
easing.bezierCurve: MaterialEasing.expressiveDefaultSpatial
|
// easing.bezierCurve: MaterialEasing.expressiveDefaultSpatial
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
anchors.centerIn: parent
|
anchors.top: parent.top
|
||||||
width: parent.width - 20
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.leftMargin: 10
|
||||||
|
anchors.rightMargin: 10
|
||||||
|
anchors.topMargin: 5
|
||||||
|
// width: parent.width - 20
|
||||||
spacing: 10
|
spacing: 10
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
id: infoRow
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
@@ -135,7 +141,6 @@ Repeater {
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: groupHeader.modelData.summary
|
text: groupHeader.modelData.summary
|
||||||
@@ -144,6 +149,7 @@ Repeater {
|
|||||||
font.pointSize: 16
|
font.pointSize: 16
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -161,7 +167,7 @@ Repeater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: groupColumn.notifications.length > 1 ? ( groupColumn.isExpanded ? "" : "(" + groupColumn.notifications.length + ")" ) : ""
|
text: groupHeader.modelData.timeStr
|
||||||
font.pointSize: 10
|
font.pointSize: 10
|
||||||
color: "#666666"
|
color: "#666666"
|
||||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import Quickshell.Io
|
|||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls.FluentWinUI3
|
import QtQuick.Controls.FluentWinUI3
|
||||||
|
import QtQuick.Effects
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Daemons
|
import qs.Daemons
|
||||||
|
import qs.Effects
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
@@ -94,6 +96,11 @@ PanelWindow {
|
|||||||
bar: root.bar
|
bar: root.bar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShadowRect {
|
||||||
|
anchors.fill: backgroundRect
|
||||||
|
radius: backgroundRect.radius
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: backgroundRect
|
id: backgroundRect
|
||||||
y: 10
|
y: 10
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import QtQuick
|
|||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Daemons
|
import qs.Daemons
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
|
import qs.Effects
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
@@ -106,98 +107,109 @@ PanelWindow {
|
|||||||
NotifRegion {}
|
NotifRegion {}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Item {
|
||||||
id: backgroundRect
|
id: rootItem
|
||||||
required property NotifServer.Notif modelData
|
|
||||||
implicitWidth: 400
|
implicitWidth: 400
|
||||||
implicitHeight: contentLayout.childrenRect.height + 16
|
implicitHeight: contentLayout.childrenRect.height + 16
|
||||||
color: Config.baseBgColor
|
required property NotifServer.Notif modelData
|
||||||
border.color: "#555555"
|
|
||||||
radius: 8
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
ShadowRect {
|
||||||
root.notifRegions.push( notifRegion.createObject(root, { item: backgroundRect }));
|
anchors.fill: backgroundRect
|
||||||
}
|
radius: backgroundRect.radius
|
||||||
|
|
||||||
Column {
|
|
||||||
id: contentLayout
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: 10
|
|
||||||
spacing: 8
|
|
||||||
RowLayout {
|
|
||||||
spacing: 12
|
|
||||||
IconImage {
|
|
||||||
source: backgroundRect.modelData.image
|
|
||||||
Layout.preferredWidth: 48
|
|
||||||
Layout.preferredHeight: 48
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
|
|
||||||
visible: backgroundRect.modelData.image !== ""
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.leftMargin: 0
|
|
||||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: backgroundRect.modelData.appName
|
|
||||||
color: "white"
|
|
||||||
font.bold: true
|
|
||||||
font.pointSize: 14
|
|
||||||
elide: Text.ElideRight
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: backgroundRect.modelData.summary
|
|
||||||
color: "white"
|
|
||||||
font.pointSize: 12
|
|
||||||
font.bold: true
|
|
||||||
elide: Text.ElideRight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: backgroundRect.modelData.body
|
|
||||||
color: "#dddddd"
|
|
||||||
font.pointSize: 14
|
|
||||||
elide: Text.ElideRight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
maximumLineCount: 4
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.right: parent.right
|
id: backgroundRect
|
||||||
anchors.top: parent.top
|
implicitWidth: 400
|
||||||
anchors.rightMargin: 6
|
implicitHeight: contentLayout.childrenRect.height + 16
|
||||||
anchors.topMargin: 6
|
color: Config.baseBgColor
|
||||||
width: 18
|
border.color: "#555555"
|
||||||
height: 18
|
radius: 8
|
||||||
color: closeArea.containsMouse ? "#FF6077" : "transparent"
|
|
||||||
radius: 9
|
|
||||||
|
|
||||||
Text {
|
Component.onCompleted: {
|
||||||
anchors.centerIn: parent
|
root.notifRegions.push( notifRegion.createObject(root, { item: backgroundRect }));
|
||||||
text: "✕"
|
|
||||||
color: closeArea.containsMouse ? "white" : "#888888"
|
|
||||||
font.pointSize: 12
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
Column {
|
||||||
id: closeArea
|
id: contentLayout
|
||||||
anchors.fill: parent
|
anchors.left: parent.left
|
||||||
hoverEnabled: true
|
anchors.right: parent.right
|
||||||
onClicked: {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
backgroundRect.modelData.close();
|
anchors.margins: 10
|
||||||
|
spacing: 8
|
||||||
|
RowLayout {
|
||||||
|
spacing: 12
|
||||||
|
IconImage {
|
||||||
|
source: rootItem.modelData.image
|
||||||
|
Layout.preferredWidth: 48
|
||||||
|
Layout.preferredHeight: 48
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
|
||||||
|
visible: rootItem.modelData.image !== ""
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.leftMargin: 0
|
||||||
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: rootItem.modelData.appName
|
||||||
|
color: "white"
|
||||||
|
font.bold: true
|
||||||
|
font.pointSize: 14
|
||||||
|
elide: Text.ElideRight
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: rootItem.modelData.summary
|
||||||
|
color: "white"
|
||||||
|
font.pointSize: 12
|
||||||
|
font.bold: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: rootItem.modelData.body
|
||||||
|
color: "#dddddd"
|
||||||
|
font.pointSize: 14
|
||||||
|
elide: Text.ElideRight
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
maximumLineCount: 4
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.rightMargin: 6
|
||||||
|
anchors.topMargin: 6
|
||||||
|
width: 18
|
||||||
|
height: 18
|
||||||
|
color: closeArea.containsMouse ? "#FF6077" : "transparent"
|
||||||
|
radius: 9
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: "✕"
|
||||||
|
color: closeArea.containsMouse ? "white" : "#888888"
|
||||||
|
font.pointSize: 12
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: closeArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {
|
||||||
|
rootItem.modelData.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Scope {
|
|||||||
screen: modelData
|
screen: modelData
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.layer: WlrLayer.Bottom
|
WlrLayershell.layer: WlrLayer.Bottom
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
|
|||||||
Reference in New Issue
Block a user