Initial commit

This commit is contained in:
kossLAN 2025-06-07 04:01:14 -04:00
commit 05cd51b54e
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
148 changed files with 10112 additions and 0 deletions

View file

@ -0,0 +1,61 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.Notifications
import ".."
PanelWindow {
required property var bar;
id: notificationWindow;
color: "transparent";
width: 550;
height: 600;
visible: true;
mask: Region { item: notifLayout; }
anchors {
top: true;
bottom: true;
}
margins {
top: 5;
bottom: 5;
right: 5;
}
NotificationServer {
id: notificationServer;
actionsSupported: true;
persistenceSupported: true;
}
Connections {
target: notificationServer;
function onNotification(notification) {
notification.tracked = true;
}
}
ColumnLayout {
id: notifLayout;
spacing: 5;
anchors {
left: parent.left;
right: parent.right;
}
Repeater {
model: notificationServer.trackedNotifications;
Toast {
required property var modelData;
notification: modelData;
}
}
}
}

View file

@ -0,0 +1,71 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.Notifications
import ".."
Scope {
required property var bar;
NotificationServer {
id: notificationServer;
actionsSupported: true;
persistenceSupported: true;
}
Connections {
target: notificationServer;
function onNotification(notification) {
notificationLoader.item.visible = true;
notification.tracked = true;
}
}
LazyLoader {
id: notificationLoader;
loading: true;
PanelWindow {
id: notificationWindow;
color: "transparent";
width: 500;
visible: false;
exclusionMode: ExclusionMode.Normal;
mask: Region { item: notifLayout; }
anchors {
top: true;
bottom: true;
right: true;
}
margins {
top: 5;
bottom: 5;
right: 5;
}
ColumnLayout {
id: notifLayout;
spacing: 15;
anchors {
top: parent.top;
left: parent.left;
right: parent.right;
margins: 5;
}
Repeater {
model: notificationServer.trackedNotifications;
Toast {
required property var modelData;
notification: modelData;
}
}
}
}
}
}

View file

@ -0,0 +1,105 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import "../.."
Rectangle {
required property var notification
radius: 5;
color: ShellGlobals.colors.bar;
border.color: notificationArea.containsMouse
? ShellGlobals.colors.highlight
: ShellGlobals.colors.light;
border.width: 2;
width: parent.width;
height: column.implicitHeight + 20;
MouseArea {
id: notificationArea;
hoverEnabled: true;
anchors.fill: parent;
}
ColumnLayout {
id: column;
spacing: 5;
anchors {
fill: parent;
margins: 10;
}
RowLayout {
spacing: 5;
Layout.fillWidth: true;
IconImage {
visible: notification.appIcon == null;
source: Qt.resolvedUrl(notification.appIcon);
implicitSize: 25;
}
Text {
id: summaryText
text: notification.summary
color: ShellGlobals.colors.text
font.pointSize: 14
font.bold: true
wrapMode: Text.Wrap;
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom;
}
Item {
width: 16;
height: 16;
Layout.alignment: Qt.AlighRight | Qt.AlignTop;
Rectangle {
color: "#FF474D";
radius: 5;
visible: closeButtonArea.containsMouse;
anchors.fill: parent;
}
MouseArea {
id: closeButtonArea;
hoverEnabled: true;
anchors.fill: parent;
onPressed: {
notification.dismiss();
}
}
IconImage {
source: "image://icon/window-close";
implicitSize: 28;
anchors.centerIn: parent;
}
}
}
RowLayout {
Text {
id: bodyText
text: notification.body
color: ShellGlobals.colors.text
font.pointSize: 11;
wrapMode: Text.Wrap
Layout.fillWidth: true
}
//IconImage {
// visible: notification.image != null;
// source: Qt.resolvedUrl(notification.image);
// implicitSize: 25;
//}
Layout.fillWidth: true;
}
}
}

View file

@ -0,0 +1,105 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import "../.."
Rectangle {
required property var notification
radius: 5;
color: ShellGlobals.colors.bar;
border.color: notificationArea.containsMouse
? ShellGlobals.colors.highlight
: ShellGlobals.colors.light;
border.width: 2;
width: parent.width;
height: column.implicitHeight + 20;
MouseArea {
id: notificationArea;
hoverEnabled: true;
anchors.fill: parent;
}
ColumnLayout {
id: column;
spacing: 5;
anchors {
fill: parent;
margins: 10;
}
RowLayout {
spacing: 5;
Layout.fillWidth: true;
//IconImage {
// visible: notification.appIcon == null;
// source: Qt.resolvedUrl(notification.appIcon);
// implicitSize: 25;
//}
Text {
id: summaryText
text: notification.summary
color: ShellGlobals.colors.text
font.pointSize: 14
font.bold: true
wrapMode: Text.Wrap;
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom;
}
Item {
width: 16;
height: 16;
Layout.alignment: Qt.AlighRight | Qt.AlignTop;
Rectangle {
color: "#FF474D";
radius: 5;
visible: closeButtonArea.containsMouse;
anchors.fill: parent;
}
MouseArea {
id: closeButtonArea;
hoverEnabled: true;
anchors.fill: parent;
onPressed: {
notification.dismiss();
}
}
IconImage {
source: "image://icon/window-close";
implicitSize: 28;
anchors.centerIn: parent;
}
}
}
RowLayout {
Text {
id: bodyText
text: notification.body
color: ShellGlobals.colors.text
font.pointSize: 11;
wrapMode: Text.Wrap
Layout.fillWidth: true
}
//IconImage {
// visible: notification.image != null;
// source: Qt.resolvedUrl(notification.image);
// implicitSize: 25;
//}
Layout.fillWidth: true;
}
}
}

View file

@ -0,0 +1,105 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import "../.."
Rectangle {
required property var notification
radius: 5;
color: ShellGlobals.colors.bar;
border.color: notificationArea.containsMouse
? ShellGlobals.colors.highlight
: ShellGlobals.colors.light;
border.width: 2;
width: parent.width;
height: column.implicitHeight + 20;
MouseArea {
id: notificationArea;
hoverEnabled: true;
anchors.fill: parent;
}
ColumnLayout {
id: column;
spacing: 5;
anchors {
fill: parent;
margins: 10;
}
RowLayout {
spacing: 5;
Layout.fillWidth: true;
//IconImage {
// visible: notification.appIcon == null;
// source: Qt.resolvedUrl(notification.appIcon);
// implicitSize: 25;
//}
Text {
id: summaryText
text: notification.summary
color: ShellGlobals.colors.text
font.pointSize: 14
font.bold: true
wrapMode: Text.Wrap;
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom;
}
Item {
width: 16;
height: 16;
Layout.alignment: Qt.AlighRight | Qt.AlignTop;
Rectangle {
color: "#FF474D";
radius: 5;
visible: closeButtonArea.containsMouse;
anchors.fill: parent;
}
MouseArea {
id: closeButtonArea;
hoverEnabled: true;
anchors.fill: parent;
onPressed: {
notification.dismiss();
}
}
IconImage {
source: "image://icon/window-close";
implicitSize: 28;
anchors.centerIn: parent;
}
}
}
RowLayout {
Text {
id: bodyText
text: notification.body
color: ShellGlobals.colors.text
font.pointSize: 11;
wrapMode: Text.Wrap
Layout.fillWidth: true
}
IconImage {
visible: notification.image != null;
source: Qt.resolvedUrl(notification.image);
implicitSize: 25;
}
Layout.fillWidth: true;
}
}
}

View file

@ -0,0 +1,105 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import "../.."
Rectangle {
required property var notification
radius: 5;
color: ShellGlobals.colors.bar;
border.color: notificationArea.containsMouse
? ShellGlobals.colors.highlight
: ShellGlobals.colors.light;
border.width: 2;
width: parent.width;
height: column.implicitHeight + 20;
MouseArea {
id: notificationArea;
hoverEnabled: true;
anchors.fill: parent;
}
ColumnLayout {
id: column;
spacing: 5;
anchors {
fill: parent;
margins: 10;
}
RowLayout {
spacing: 5;
Layout.fillWidth: true;
IconImage {
visible: notification.appIcon == null;
source: Qt.resolvedUrl(notification.appIcon);
implicitSize: 25;
}
Text {
id: summaryText
text: notification.summary
color: ShellGlobals.colors.text
font.pointSize: 14
font.bold: true
wrapMode: Text.Wrap;
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom;
}
Item {
width: 16;
height: 16;
Layout.alignment: Qt.AlighRight | Qt.AlignTop;
Rectangle {
color: "#FF474D";
radius: 5;
visible: closeButtonArea.containsMouse;
anchors.fill: parent;
}
MouseArea {
id: closeButtonArea;
hoverEnabled: true;
anchors.fill: parent;
onPressed: {
notification.dismiss();
}
}
IconImage {
source: "image://icon/window-close";
implicitSize: 28;
anchors.centerIn: parent;
}
}
}
RowLayout {
Text {
id: bodyText
text: notification.body
color: ShellGlobals.colors.text
font.pointSize: 11;
wrapMode: Text.Wrap
Layout.fillWidth: true
}
IconImage {
visible: notification.image != null;
source: Qt.resolvedUrl(notification.image);
implicitSize: 25;
}
Layout.fillWidth: true;
}
}
}

View file

@ -0,0 +1,215 @@
import QtQuick
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import ".."
import "../.."
Rectangle {
required property var notification;
id: notificationRoot;
radius: 5;
color: ShellGlobals.colors.window;
width: parent.width;
height: column.implicitHeight + 30;
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true;
spread: 0.01;
samples: 25;
color: "#80000000";
}
Item {
property int totalDuration: 5000;
property int remainingTime: totalDuration;
property bool isRunning: false;
property real lastTime: 0;
id: timerController;
Timer {
id: internalTimer;
interval: 16;
repeat: true;
running: timerController.isRunning;
onTriggered: {
var currentTime = Date.now()
if (timerController.lastTime > 0) {
var delta = currentTime - timerController.lastTime;
timerController.remainingTime -= delta;
if (timerController.remainingTime <= 0) {
timerController.isRunning = false;
notification.expire();
}
}
timerController.lastTime = currentTime;
}
}
function start() {
if (!isRunning) {
lastTime = Date.now();
isRunning = true;
}
}
function pause() {
isRunning = false;
lastTime = 0;
}
Component.onCompleted: {
start();
}
}
MouseArea {
id: notificationArea;
hoverEnabled: true;
anchors.fill: parent;
onContainsMouseChanged: {
progressAnimation.paused = containsMouse;
if (containsMouse) {
timerController.pause();
} else {
timerController.start();
}
}
}
RowLayout {
id: column;
spacing: 5;
anchors {
fill: parent;
margins: 15;
}
ColumnLayout {
Layout.fillWidth: true;
RowLayout {
id: topRow;
spacing: 10;
IconImage {
visible: notification.appIcon != "";
source: Quickshell.iconPath(notification.appIcon);
implicitSize: 24;
}
RowLayout {
Text {
id: appName;
text: notification.appName;
color: ShellGlobals.colors.text;
font.pointSize: 11;
font.bold: true;
wrapMode: Text.Wrap;
Layout.fillWidth: false;
}
Separator {}
Text {
id: summaryText;
text: notification.summary;
color: ShellGlobals.colors.text;
font.pointSize: 11;
wrapMode: Text.Wrap;
Layout.fillWidth: true;
}
}
Item {
id: closeButton;
width: 24;
height: 24;
Layout.alignment: Qt.AlignTop;
Canvas {
id: progressCircle;
anchors.fill: parent;
antialiasing: true;
property real progress: 1.0;
onProgressChanged: requestPaint();
onPaint: {
var ctx = getContext("2d");
ctx.reset();
var centerX = width / 2;
var centerY = height / 2;
var radius = Math.min(width, height) / 2 - 2;
ctx.beginPath();
ctx.arc(centerX, centerY, radius, -Math.PI / 2, -Math.PI / 2 + 2 * Math.PI * progress);
ctx.strokeStyle = ShellGlobals.colors.highlight;
ctx.lineWidth = 2;
ctx.stroke();
}
}
NumberAnimation {
id: progressAnimation;
target: progressCircle;
property: "progress";
from: 1.0;
to: 0.0;
duration: 5000;
running: true;
easing.type: Easing.Linear;
}
Rectangle {
id: closeButtonBg;
anchors.centerIn: parent;
width: 16;
height: 16;
color: "#FF474D";
radius: 10;
visible: closeButtonArea.containsMouse;
}
MouseArea {
id: closeButtonArea;
hoverEnabled: true;
anchors.fill: parent;
onPressed: {
notification.dismiss();
}
}
IconImage {
source: "image://icon/window-close";
implicitSize: 16;
anchors.centerIn: parent;
}
}
}
RowLayout {
ColumnLayout {
Text {
id: bodyText;
text: notification.body;
color: ShellGlobals.colors.text;
font.pointSize: 11;
wrapMode: Text.Wrap;
Layout.fillWidth: true;
}
}
}
}
}
}