Formatting
This commit is contained in:
parent
dd79920d92
commit
1d7b47ee4c
14 changed files with 267 additions and 254 deletions
|
|
@ -43,12 +43,10 @@ NLoader {
|
|||
}
|
||||
|
||||
margins {
|
||||
top: (Settings.data.bar.monitors.includes(modelData.name)
|
||||
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top"
|
||||
? Math.floor(Style.barHeight * scaling) : 0
|
||||
bottom: (Settings.data.bar.monitors.includes(modelData.name)
|
||||
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom"
|
||||
? Math.floor(Style.barHeight * scaling) : 0
|
||||
top: (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0))
|
||||
&& Settings.data.bar.position === "top" ? Math.floor(Style.barHeight * scaling) : 0
|
||||
bottom: (Settings.data.bar.monitors.includes(modelData.name) || (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
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ ColumnLayout {
|
|||
command: ["which", "matugen"]
|
||||
running: false
|
||||
|
||||
onExited: function(exitCode) {
|
||||
onExited: function (exitCode) {
|
||||
if (exitCode === 0) {
|
||||
// Matugen exists, enable it
|
||||
Settings.data.colorSchemes.useWallpaperColors = true
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ ColumnLayout {
|
|||
command: ["which", "swww"]
|
||||
running: false
|
||||
|
||||
onExited: function(exitCode) {
|
||||
onExited: function (exitCode) {
|
||||
if (exitCode === 0) {
|
||||
// SWWW exists, enable it
|
||||
Settings.data.wallpaper.swww.enabled = true
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ Variants {
|
|||
targetY: Style.marginS * scaling
|
||||
|
||||
// Hidden position based on bar location
|
||||
hiddenY: Settings.data.bar.position === "top"
|
||||
? -toast.height - 20
|
||||
: toast.height + 20
|
||||
hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20
|
||||
|
||||
Component.onCompleted: {
|
||||
// Register this toast with the service
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ Singleton {
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
//Logger.warn(e)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,14 +60,25 @@ QtObject {
|
|||
|
||||
// Simple function to show a random toast (useful for testing or fun messages)
|
||||
function showRandomToast() {
|
||||
var messages = [
|
||||
{ type: "notice", text: "Everything is working smoothly!" },
|
||||
{ type: "notice", text: "Noctalia is looking great today!" },
|
||||
{ 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 messages = [{
|
||||
"type": "notice",
|
||||
"text": "Everything is working smoothly!"
|
||||
}, {
|
||||
"type": "notice",
|
||||
"text": "Noctalia is looking great today!"
|
||||
}, {
|
||||
"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)]
|
||||
showToast(randomMessage.text, randomMessage.type)
|
||||
|
|
@ -141,16 +152,14 @@ QtObject {
|
|||
// Generic method to show a toast
|
||||
function showToast(label, description = "", type = "notice", persistent = false, duration = 3000) {
|
||||
var toastData = {
|
||||
label: label,
|
||||
description: description,
|
||||
type: type,
|
||||
persistent: persistent,
|
||||
duration: duration,
|
||||
timestamp: Date.now()
|
||||
"label": label,
|
||||
"description": description,
|
||||
"type": type,
|
||||
"persistent": persistent,
|
||||
"duration": duration,
|
||||
"timestamp": Date.now()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add to queue
|
||||
messageQueue.push(toastData)
|
||||
|
||||
|
|
@ -175,8 +184,6 @@ QtObject {
|
|||
var toastData = messageQueue.shift()
|
||||
isShowingToast = true
|
||||
|
||||
|
||||
|
||||
// Configure and show toast
|
||||
currentToast.label = toastData.label
|
||||
currentToast.description = toastData.description
|
||||
|
|
@ -192,7 +199,7 @@ QtObject {
|
|||
isShowingToast = false
|
||||
|
||||
// Small delay before showing next toast
|
||||
Qt.callLater(function() {
|
||||
Qt.callLater(function () {
|
||||
processQueue()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Item {
|
|||
property real targetY: 0
|
||||
property real hiddenY: -height - 20
|
||||
|
||||
signal dismissed()
|
||||
signal dismissed
|
||||
|
||||
width: Math.min(500 * scaling, parent.width * 0.8)
|
||||
height: Math.max(60 * scaling, contentLayout.implicitHeight + Style.marginL * 2 * scaling)
|
||||
|
|
@ -85,9 +85,12 @@ Item {
|
|||
// Simple colored border all around
|
||||
border.color: {
|
||||
switch (root.type) {
|
||||
case "warning": return Color.mError
|
||||
case "notice": return Color.mPrimary
|
||||
default: return Color.mOutline
|
||||
case "warning":
|
||||
return Color.mError
|
||||
case "notice":
|
||||
return Color.mPrimary
|
||||
default:
|
||||
return Color.mOutline
|
||||
}
|
||||
}
|
||||
border.width: Math.max(2, Style.borderM * scaling)
|
||||
|
|
@ -112,17 +115,23 @@ Item {
|
|||
id: icon
|
||||
text: {
|
||||
switch (root.type) {
|
||||
case "warning": return "warning"
|
||||
case "notice": return "info"
|
||||
default: return "info"
|
||||
case "warning":
|
||||
return "warning"
|
||||
case "notice":
|
||||
return "info"
|
||||
default:
|
||||
return "info"
|
||||
}
|
||||
}
|
||||
|
||||
color: {
|
||||
switch (root.type) {
|
||||
case "warning": return Color.mError
|
||||
case "notice": return Color.mPrimary
|
||||
default: return Color.mPrimary
|
||||
case "warning":
|
||||
return Color.mError
|
||||
case "notice":
|
||||
return Color.mPrimary
|
||||
default:
|
||||
return Color.mPrimary
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue