fancy notifs

This commit is contained in:
2026-03-02 19:28:15 +02:00
parent 8fa89bb99c
commit aa8c07b136
8 changed files with 811 additions and 360 deletions

View File

@@ -36,6 +36,7 @@ Item {
property int activeSelection: 0
property bool inBluetoothMenu: false
property bool inWallpaperMenu: false
property bool inNotificationsMenu: false
property bool isSelected: false
@@ -81,7 +82,7 @@ Item {
}
function currentAction() {
if (root.inBluetoothMenu || root.inWallpaperMenu)
if (root.inBluetoothMenu || root.inWallpaperMenu || root.inNotificationsMenu)
return null;
return menuLength() > 0 ? menuAt(activeSelection) : null;
}
@@ -195,6 +196,7 @@ Item {
property int bluetoothActionIndex: 1
property int wallpaperActionIndex: 2
property int notificationsActionIndex: 3
property var actions: [
{
name: "Master Volume",
@@ -218,6 +220,7 @@ Item {
ent: function () {
root.inBluetoothMenu = true;
root.inWallpaperMenu = false;
root.inNotificationsMenu = false;
root.isSelected = false;
root.activeSelection = 0;
root.clampSelection();
@@ -231,6 +234,7 @@ Item {
ent: function () {
root.inWallpaperMenu = true;
root.inBluetoothMenu = false;
root.inNotificationsMenu = false;
root.isSelected = false;
var currentIndex = root.currentWallpaperIndex();
root.activeSelection = currentIndex >= 0 ? currentIndex : 0;
@@ -241,10 +245,39 @@ Item {
getState: function () {
return "";
}
},
{
name: "Notifications",
ent: function () {
root.inNotificationsMenu = true;
root.inBluetoothMenu = false;
root.inWallpaperMenu = false;
root.isSelected = false;
root.activeSelection = 0;
root.clampSelection();
},
getState: function () {
return "";
}
}
]
property var menuModel: root.inBluetoothMenu ? Bluetooth.devices : (root.inWallpaperMenu ? wallpaperFolderModel : actions)
property var notificationActions: [
{
name: "Stack Preview",
ent: function () {
if (manager && manager.toggleNotificationStackPreviewEnabled)
manager.toggleNotificationStackPreviewEnabled();
},
getState: function () {
if (!manager || !manager.notificationStackPreviewEnabled)
return "ON";
return manager.notificationStackPreviewEnabled() ? "ON" : "OFF";
}
}
]
property var menuModel: root.inBluetoothMenu ? Bluetooth.devices : (root.inWallpaperMenu ? wallpaperFolderModel : (root.inNotificationsMenu ? notificationActions : actions))
FolderListModel {
id: wallpaperFolderModel
@@ -320,7 +353,7 @@ Item {
}
Text {
text: root.inBluetoothMenu ? "BLUETOOTH" : (root.inWallpaperMenu ? "WALLPAPER" : "CONFIG")
text: root.inBluetoothMenu ? "BLUETOOTH" : (root.inWallpaperMenu ? "WALLPAPER" : (root.inNotificationsMenu ? "NOTIFICATIONS" : "CONFIG"))
font.family: "8bitoperator JVE"
font.pixelSize: 71
renderType: Text.NativeRendering
@@ -440,6 +473,10 @@ Item {
const wallpaperPath = wallpaperPathAt(activeSelection);
if (wallpaperPath && wallpaperPath.length > 0)
root.applyWallpaper(wallpaperPath);
} else if (root.inNotificationsMenu) {
const notificationAction = menuAt(activeSelection);
if (notificationAction && notificationAction.ent)
notificationAction.ent();
} else {
const a = currentAction();
if (a && a.ent) {
@@ -459,6 +496,11 @@ Item {
root.scrollOffset = 0;
root.activeSelection = root.wallpaperActionIndex;
root.clampSelection();
} else if (root.inNotificationsMenu) {
root.inNotificationsMenu = false;
root.isSelected = false;
root.activeSelection = root.notificationsActionIndex;
root.clampSelection();
} else if (root.inBluetoothMenu) {
root.inBluetoothMenu = false;
root.isSelected = false;
@@ -481,6 +523,7 @@ Item {
root.isSelected = false;
root.inBluetoothMenu = false;
root.inWallpaperMenu = false;
root.inNotificationsMenu = false;
root.scrollOffset = 0;
root.refreshCurrentWallpaper();
ShellInputManager.registerHandler("quickSettings", handleKey);