Settings: more cleanup and conditionnal controls (NightLight)

+ Auto formatting
This commit is contained in:
LemmyCook 2025-08-28 06:57:37 -04:00
parent 85b92d9c6f
commit 0562dbbbf9
14 changed files with 434 additions and 431 deletions

View file

@ -25,7 +25,9 @@ Variants {
property var removingNotifications: ({})
// If no notification display activated in settings, then show them all
active: Settings.isLoaded && modelData && (NotificationService.notificationModel.count > 0) ? (Settings.data.notifications.monitors.includes(modelData.name)
active: Settings.isLoaded && modelData
&& (NotificationService.notificationModel.count > 0) ? (Settings.data.notifications.monitors.includes(
modelData.name)
|| (Settings.data.notifications.monitors.length === 0)) : false
visible: (NotificationService.notificationModel.count > 0)

View file

@ -37,7 +37,6 @@ ColumnLayout {
}
}
NText {
text: "Noctalia Shell"
font.pointSize: Style.fontSizeXXXL * scaling
@ -209,8 +208,7 @@ ColumnLayout {
}
NText {
text: (modelData.contributions || 0) + " " + ((modelData.contributions
|| 0) === 1 ? "commit" : "commits")
text: (modelData.contributions || 0) + " " + ((modelData.contributions || 0) === 1 ? "commit" : "commits")
font.pointSize: Style.fontSizeXS * scaling
color: contributorArea.containsMouse ? Color.mSurface : Color.mOnSurface
}
@ -232,4 +230,3 @@ ColumnLayout {
}
}
}

View file

@ -7,6 +7,8 @@ import qs.Commons
import qs.Services
ColumnLayout {
id: root
property real localVolume: AudioService.volume
Connections {

View file

@ -6,6 +6,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
ColumnLayout {
spacing: Style.marginL * scaling

View file

@ -7,9 +7,8 @@ import qs.Services
import qs.Widgets
ColumnLayout {
readonly property real scaling: ScalingService.scale(screen)
readonly property string tabIcon: "brightness_6"
readonly property string tabLabel: "Brightness"
id: root
spacing: Style.marginL * scaling
// Brightness Step Section

View file

@ -9,6 +9,13 @@ import qs.Widgets
ColumnLayout {
id: root
// Cache for scheme JSON (can be flat or {dark, light})
property var schemeColorsCache: ({})
// Scale properties for card animations
property real cardScaleLow: 0.95
property real cardScaleHigh: 1.0
// Helper function to get color from scheme file (supports dark/light variants)
function getSchemeColor(schemePath, colorKey) {
// Extract scheme name from path
@ -29,13 +36,6 @@ ColumnLayout {
return "#000000"
}
// Cache for scheme JSON (can be flat or {dark, light})
property var schemeColorsCache: ({})
// Scale properties for card animations
property real cardScaleLow: 0.95
property real cardScaleHigh: 1.0
// This function is called by the FileView Repeater when a scheme file is loaded
function schemeLoaded(schemeName, jsonData) {
var value = jsonData || {}

View file

@ -7,10 +7,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
readonly property real scaling: ScalingService.scale(screen)
readonly property string tabIcon: "monitor"
readonly property string tabLabel: "Display"
readonly property int tabIndex: 5
id: root
// Time dropdown options (00:00 .. 23:30)
ListModel {
@ -43,7 +40,6 @@ ColumnLayout {
})
}
NText {
text: "Monitor-specific configuration"
font.pointSize: Style.fontSizeL * scaling
@ -123,8 +119,8 @@ ColumnLayout {
Settings.data.notifications.monitors = addMonitor(Settings.data.notifications.monitors,
modelData.name)
} else {
Settings.data.notifications.monitors = removeMonitor(
Settings.data.notifications.monitors, modelData.name)
Settings.data.notifications.monitors = removeMonitor(Settings.data.notifications.monitors,
modelData.name)
}
}
}
@ -246,15 +242,9 @@ ColumnLayout {
onToggled: checked => Settings.data.nightLight.enabled = checked
}
NToggle {
label: "Auto Schedule"
description: "Automatically enable night light based on time schedule."
checked: Settings.data.nightLight.autoSchedule
onToggled: checked => Settings.data.nightLight.autoSchedule = checked
}
// Intensity settings
ColumnLayout {
visible: Settings.data.nightLight.enabled
NLabel {
label: "Intensity"
description: "Higher values create warmer light."
@ -281,9 +271,18 @@ ColumnLayout {
}
}
NToggle {
label: "Auto Schedule"
description: "Automatically enable night light based on time schedule."
checked: Settings.data.nightLight.autoSchedule
onToggled: checked => Settings.data.nightLight.autoSchedule = checked
visible: Settings.data.nightLight.enabled
}
// Schedule settings
ColumnLayout {
spacing: Style.marginXS * scaling
visible: Settings.data.nightLight.enabled && Settings.data.nightLight.autoSchedule
NLabel {
label: "Schedule"
@ -327,7 +326,6 @@ ColumnLayout {
}
}
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginXL * scaling

View file

@ -6,6 +6,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
// Profile section
RowLayout {

View file

@ -6,6 +6,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
ColumnLayout {
spacing: Style.marginL * scaling

View file

@ -8,6 +8,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
spacing: Style.marginL * scaling
NToggle {

View file

@ -6,6 +6,8 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
spacing: Style.marginL * scaling
// Output Directory

View file

@ -6,6 +6,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
// Location section
NTextInput {

View file

@ -7,10 +7,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
readonly property real scaling: ScalingService.scale(screen)
readonly property string tabIcon: "photo_library"
readonly property string tabLabel: "Wallpaper Selector"
readonly property int tabIndex: 7
id: root
spacing: Style.marginL * scaling

View file

@ -7,6 +7,7 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
// Process to check if swww is installed
Process {