Formatting

This commit is contained in:
quadbyte 2025-08-19 13:31:13 -04:00
parent dd79920d92
commit 1d7b47ee4c
14 changed files with 267 additions and 254 deletions

View file

@ -43,12 +43,10 @@ NLoader {
} }
margins { margins {
top: (Settings.data.bar.monitors.includes(modelData.name) top: (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0))
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top" && Settings.data.bar.position === "top" ? Math.floor(Style.barHeight * scaling) : 0
? Math.floor(Style.barHeight * scaling) : 0 bottom: (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0))
bottom: (Settings.data.bar.monitors.includes(modelData.name) && Settings.data.bar.position === "bottom" ? Math.floor(Style.barHeight * scaling) : 0
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom"
? Math.floor(Style.barHeight * scaling) : 0
} }
// Source we want to show only as a ring // Source we want to show only as a ring

View file

@ -347,7 +347,7 @@ ColumnLayout {
command: ["which", "matugen"] command: ["which", "matugen"]
running: false running: false
onExited: function(exitCode) { onExited: function (exitCode) {
if (exitCode === 0) { if (exitCode === 0) {
// Matugen exists, enable it // Matugen exists, enable it
Settings.data.colorSchemes.useWallpaperColors = true Settings.data.colorSchemes.useWallpaperColors = true

View file

@ -349,7 +349,7 @@ ColumnLayout {
command: ["which", "swww"] command: ["which", "swww"]
running: false running: false
onExited: function(exitCode) { onExited: function (exitCode) {
if (exitCode === 0) { if (exitCode === 0) {
// SWWW exists, enable it // SWWW exists, enable it
Settings.data.wallpaper.swww.enabled = true Settings.data.wallpaper.swww.enabled = true

View file

@ -48,9 +48,7 @@ Variants {
targetY: Style.marginS * scaling targetY: Style.marginS * scaling
// Hidden position based on bar location // Hidden position based on bar location
hiddenY: Settings.data.bar.position === "top" hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20
? -toast.height - 20
: toast.height + 20
Component.onCompleted: { Component.onCompleted: {
// Register this toast with the service // Register this toast with the service

View file

@ -20,6 +20,7 @@ Singleton {
} }
} }
} catch (e) { } catch (e) {
//Logger.warn(e) //Logger.warn(e)
} }

View file

@ -60,14 +60,25 @@ QtObject {
// Simple function to show a random toast (useful for testing or fun messages) // Simple function to show a random toast (useful for testing or fun messages)
function showRandomToast() { function showRandomToast() {
var messages = [ var messages = [{
{ type: "notice", text: "Everything is working smoothly!" }, "type": "notice",
{ type: "notice", text: "Noctalia is looking great today!" }, "text": "Everything is working smoothly!"
{ type: "notice", text: "Your desktop setup is amazing!" }, }, {
{ type: "warning", text: "Don't forget to take a break!" }, "type": "notice",
{ type: "notice", text: "Configuration saved successfully!" }, "text": "Noctalia is looking great today!"
{ type: "warning", text: "Remember to backup your settings!" } }, {
] "type": "notice",
"text": "Your desktop setup is amazing!"
}, {
"type": "warning",
"text": "Don't forget to take a break!"
}, {
"type": "notice",
"text": "Configuration saved successfully!"
}, {
"type": "warning",
"text": "Remember to backup your settings!"
}]
var randomMessage = messages[Math.floor(Math.random() * messages.length)] var randomMessage = messages[Math.floor(Math.random() * messages.length)]
showToast(randomMessage.text, randomMessage.type) showToast(randomMessage.text, randomMessage.type)
@ -141,16 +152,14 @@ QtObject {
// Generic method to show a toast // Generic method to show a toast
function showToast(label, description = "", type = "notice", persistent = false, duration = 3000) { function showToast(label, description = "", type = "notice", persistent = false, duration = 3000) {
var toastData = { var toastData = {
label: label, "label": label,
description: description, "description": description,
type: type, "type": type,
persistent: persistent, "persistent": persistent,
duration: duration, "duration": duration,
timestamp: Date.now() "timestamp": Date.now()
} }
// Add to queue // Add to queue
messageQueue.push(toastData) messageQueue.push(toastData)
@ -175,8 +184,6 @@ QtObject {
var toastData = messageQueue.shift() var toastData = messageQueue.shift()
isShowingToast = true isShowingToast = true
// Configure and show toast // Configure and show toast
currentToast.label = toastData.label currentToast.label = toastData.label
currentToast.description = toastData.description currentToast.description = toastData.description
@ -192,7 +199,7 @@ QtObject {
isShowingToast = false isShowingToast = false
// Small delay before showing next toast // Small delay before showing next toast
Qt.callLater(function() { Qt.callLater(function () {
processQueue() processQueue()
}) })
} }

View file

@ -20,7 +20,7 @@ Item {
property real targetY: 0 property real targetY: 0
property real hiddenY: -height - 20 property real hiddenY: -height - 20
signal dismissed() signal dismissed
width: Math.min(500 * scaling, parent.width * 0.8) width: Math.min(500 * scaling, parent.width * 0.8)
height: Math.max(60 * scaling, contentLayout.implicitHeight + Style.marginL * 2 * scaling) height: Math.max(60 * scaling, contentLayout.implicitHeight + Style.marginL * 2 * scaling)
@ -85,9 +85,12 @@ Item {
// Simple colored border all around // Simple colored border all around
border.color: { border.color: {
switch (root.type) { switch (root.type) {
case "warning": return Color.mError case "warning":
case "notice": return Color.mPrimary return Color.mError
default: return Color.mOutline case "notice":
return Color.mPrimary
default:
return Color.mOutline
} }
} }
border.width: Math.max(2, Style.borderM * scaling) border.width: Math.max(2, Style.borderM * scaling)
@ -112,17 +115,23 @@ Item {
id: icon id: icon
text: { text: {
switch (root.type) { switch (root.type) {
case "warning": return "warning" case "warning":
case "notice": return "info" return "warning"
default: return "info" case "notice":
return "info"
default:
return "info"
} }
} }
color: { color: {
switch (root.type) { switch (root.type) {
case "warning": return Color.mError case "warning":
case "notice": return Color.mPrimary return Color.mError
default: return Color.mPrimary case "notice":
return Color.mPrimary
default:
return Color.mPrimary
} }
} }