Formatting
This commit is contained in:
parent
c49e59220a
commit
a57f2f5d68
8 changed files with 132 additions and 130 deletions
|
|
@ -7,7 +7,7 @@ import qs.Widgets
|
|||
|
||||
NLoader {
|
||||
active: Workspaces.isNiri
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
if (Workspaces.isNiri) {
|
||||
console.log("[Overview] Loading Overview component (Niri detected)")
|
||||
|
|
@ -15,55 +15,55 @@ NLoader {
|
|||
console.log("[Overview] Skipping Overview component (Niri not detected)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sourceComponent: Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
delegate: PanelWindow {
|
||||
required property ShellScreen modelData
|
||||
property string wallpaperSource: Wallpapers.currentWallpaper !== ""
|
||||
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : ""
|
||||
required property ShellScreen modelData
|
||||
property string wallpaperSource: Wallpapers.currentWallpaper !== ""
|
||||
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : ""
|
||||
|
||||
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled
|
||||
color: "transparent"
|
||||
screen: modelData
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.namespace: "quickshell-overview"
|
||||
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled
|
||||
color: "transparent"
|
||||
screen: modelData
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.namespace: "quickshell-overview"
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
right: true
|
||||
left: true
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
right: true
|
||||
left: true
|
||||
}
|
||||
|
||||
Image {
|
||||
id: bgImage
|
||||
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
source: wallpaperSource
|
||||
cache: true
|
||||
smooth: true
|
||||
mipmap: false
|
||||
visible: wallpaperSource !== ""
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
id: overviewBgBlur
|
||||
|
||||
anchors.fill: parent
|
||||
source: bgImage
|
||||
blurEnabled: true
|
||||
blur: 0.48
|
||||
blurMax: 128
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(Colors.backgroundPrimary.r, Colors.backgroundPrimary.g, Colors.backgroundPrimary.b, 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: bgImage
|
||||
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
source: wallpaperSource
|
||||
cache: true
|
||||
smooth: true
|
||||
mipmap: false
|
||||
visible: wallpaperSource !== ""
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
id: overviewBgBlur
|
||||
|
||||
anchors.fill: parent
|
||||
source: bgImage
|
||||
blurEnabled: true
|
||||
blur: 0.48
|
||||
blurMax: 128
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(Colors.backgroundPrimary.r, Colors.backgroundPrimary.g, Colors.backgroundPrimary.b, 0.5)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ Variants {
|
|||
// anchors.verticalCenter: parent.verticalCenter
|
||||
// font.weight: Style.fontWeightBold
|
||||
// }
|
||||
|
||||
SystemMonitor {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ NIconButton {
|
|||
NotificationHistoryPanel {
|
||||
id: notificationHistoryPanelLoader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,4 +159,4 @@ NLoader {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: allowOverdrive
|
||||
label: "Allow Volume Overdrive"
|
||||
description: "Enable volume levels above 100% (up to 200%)"
|
||||
value: Settings.data.audio ? Settings.data.audio.volumeOverdrive : false
|
||||
onToggled: function (checked) {
|
||||
Settings.data.audio.volumeOverdrive = checked
|
||||
|
||||
NToggle {
|
||||
id: allowOverdrive
|
||||
label: "Allow Volume Overdrive"
|
||||
description: "Enable volume levels above 100% (up to 200%)"
|
||||
value: Settings.data.audio ? Settings.data.audio.volumeOverdrive : false
|
||||
onToggled: function (checked) {
|
||||
Settings.data.audio.volumeOverdrive = checked
|
||||
|
||||
// If overdrive is disabled and current volume is above 100%, cap it
|
||||
if (!checked && Audio.volume > 1.0) {
|
||||
Audio.volumeSet(1.0)
|
||||
|
|
@ -140,58 +140,56 @@ ColumnLayout {
|
|||
font.weight: Style.fontWeightBold
|
||||
color: Colors.textPrimary
|
||||
Layout.bottomMargin: Style.marginSmall * scaling
|
||||
}
|
||||
|
||||
// Output Device
|
||||
NComboBox {
|
||||
id: outputDeviceCombo
|
||||
label: "Output Device"
|
||||
description: "Default audio output device"
|
||||
optionsKeys: outputDeviceKeys
|
||||
optionsLabels: outputDeviceLabels
|
||||
currentKey: Audio.sink ? Audio.sink.id.toString() : ""
|
||||
onSelected: function (key) {
|
||||
// Find the node by ID and set it as preferred
|
||||
for (let i = 0; i < Pipewire.nodes.count; i++) {
|
||||
let node = Pipewire.nodes.get(i)
|
||||
if (node.id.toString() === key && node.isSink) {
|
||||
Pipewire.preferredDefaultAudioSink = node
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Input Device
|
||||
NComboBox {
|
||||
id: inputDeviceCombo
|
||||
label: "Input Device"
|
||||
description: "Default audio input device"
|
||||
optionsKeys: inputDeviceKeys
|
||||
optionsLabels: inputDeviceLabels
|
||||
currentKey: Audio.source ? Audio.source.id.toString() : ""
|
||||
onSelected: function (key) {
|
||||
// Find the node by ID and set it as preferred
|
||||
for (let i = 0; i < Pipewire.nodes.count; i++) {
|
||||
let node = Pipewire.nodes.get(i)
|
||||
if (node.id.toString() === key && !node.isSink) {
|
||||
Pipewire.preferredDefaultAudioSource = node
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Divider
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginLarge * scaling
|
||||
Layout.bottomMargin: Style.marginMedium * scaling
|
||||
}
|
||||
|
||||
// Output Device
|
||||
NComboBox {
|
||||
id: outputDeviceCombo
|
||||
label: "Output Device"
|
||||
description: "Default audio output device"
|
||||
optionsKeys: outputDeviceKeys
|
||||
optionsLabels: outputDeviceLabels
|
||||
currentKey: Audio.sink ? Audio.sink.id.toString() : ""
|
||||
onSelected: function (key) {
|
||||
// Find the node by ID and set it as preferred
|
||||
for (var i = 0; i < Pipewire.nodes.count; i++) {
|
||||
let node = Pipewire.nodes.get(i)
|
||||
if (node.id.toString() === key && node.isSink) {
|
||||
Pipewire.preferredDefaultAudioSink = node
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Input Device
|
||||
NComboBox {
|
||||
id: inputDeviceCombo
|
||||
label: "Input Device"
|
||||
description: "Default audio input device"
|
||||
optionsKeys: inputDeviceKeys
|
||||
optionsLabels: inputDeviceLabels
|
||||
currentKey: Audio.source ? Audio.source.id.toString() : ""
|
||||
onSelected: function (key) {
|
||||
// Find the node by ID and set it as preferred
|
||||
for (var i = 0; i < Pipewire.nodes.count; i++) {
|
||||
let node = Pipewire.nodes.get(i)
|
||||
if (node.id.toString() === key && !node.isSink) {
|
||||
Pipewire.preferredDefaultAudioSource = node
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Divider
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginLarge * scaling
|
||||
Layout.bottomMargin: Style.marginMedium * scaling
|
||||
}
|
||||
|
||||
// Audio Visualizer Category
|
||||
ColumnLayout {
|
||||
spacing: Style.marginSmall * scaling
|
||||
|
|
@ -298,11 +296,11 @@ ColumnLayout {
|
|||
outputDeviceCombo.optionsKeys = outputDeviceKeys
|
||||
outputDeviceCombo.optionsLabels = outputDeviceLabels
|
||||
}
|
||||
|
||||
|
||||
if (inputDeviceCombo) {
|
||||
inputDeviceCombo.optionsKeys = inputDeviceKeys
|
||||
inputDeviceCombo.optionsLabels = inputDeviceLabels
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ ColumnLayout {
|
|||
color: Colors.textPrimary
|
||||
Layout.bottomMargin: Style.marginSmall * scaling
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ QtObject {
|
|||
property int maxHistory: 100
|
||||
|
||||
// Cached history file path
|
||||
property string historyFile: Quickshell.env("NOCTALIA_NOTIF_HISTORY_FILE") || (Settings.cacheDir + "notifications.json")
|
||||
property string historyFile: Quickshell.env("NOCTALIA_NOTIF_HISTORY_FILE")
|
||||
|| (Settings.cacheDir + "notifications.json")
|
||||
|
||||
// Persisted storage for history
|
||||
property FileView historyFileView: FileView {
|
||||
|
|
@ -130,12 +131,12 @@ QtObject {
|
|||
// Add a simplified copy into persistent history
|
||||
function addToHistory(notification) {
|
||||
historyModel.insert(0, {
|
||||
"summary": notification.summary,
|
||||
"body": notification.body,
|
||||
"appName": notification.appName,
|
||||
"urgency": notification.urgency,
|
||||
"timestamp": new Date()
|
||||
})
|
||||
"summary": notification.summary,
|
||||
"body": notification.body,
|
||||
"appName": notification.appName,
|
||||
"urgency": notification.urgency,
|
||||
"timestamp": new Date()
|
||||
})
|
||||
while (historyModel.count > maxHistory) {
|
||||
historyModel.remove(historyModel.count - 1)
|
||||
}
|
||||
|
|
@ -155,12 +156,12 @@ QtObject {
|
|||
for (var i = 0; i < items.length; i++) {
|
||||
const it = items[i]
|
||||
historyModel.append({
|
||||
"summary": it.summary || "",
|
||||
"body": it.body || "",
|
||||
"appName": it.appName || "",
|
||||
"urgency": it.urgency,
|
||||
"timestamp": it.timestamp ? new Date(it.timestamp) : new Date()
|
||||
})
|
||||
"summary": it.summary || "",
|
||||
"body": it.body || "",
|
||||
"appName": it.appName || "",
|
||||
"urgency": it.urgency,
|
||||
"timestamp": it.timestamp ? new Date(it.timestamp) : new Date()
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[Notifications] Failed to load history:", e)
|
||||
|
|
@ -174,11 +175,11 @@ QtObject {
|
|||
for (var i = 0; i < historyModel.count; i++) {
|
||||
const n = historyModel.get(i)
|
||||
arr.push({
|
||||
summary: n.summary,
|
||||
body: n.body,
|
||||
appName: n.appName,
|
||||
urgency: n.urgency,
|
||||
timestamp: (n.timestamp instanceof Date) ? n.timestamp.getTime() : n.timestamp
|
||||
"summary": n.summary,
|
||||
"body": n.body,
|
||||
"appName": n.appName,
|
||||
"urgency": n.urgency,
|
||||
"timestamp": (n.timestamp instanceof Date) ? n.timestamp.getTime() : n.timestamp
|
||||
})
|
||||
}
|
||||
historyAdapter.history = arr
|
||||
|
|
|
|||
|
|
@ -193,8 +193,14 @@ Singleton {
|
|||
|
||||
Connections {
|
||||
target: adapter.wallpaper
|
||||
function onIsRandomChanged() { Wallpapers.toggleRandomWallpaper() }
|
||||
function onRandomIntervalChanged() { Wallpapers.restartRandomWallpaperTimer() }
|
||||
function onDirectoryChanged() { Wallpapers.loadWallpapers() }
|
||||
function onIsRandomChanged() {
|
||||
Wallpapers.toggleRandomWallpaper()
|
||||
}
|
||||
function onRandomIntervalChanged() {
|
||||
Wallpapers.restartRandomWallpaperTimer()
|
||||
}
|
||||
function onDirectoryChanged() {
|
||||
Wallpapers.loadWallpapers()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue