Settings: more cleanup and conditionnal controls (NightLight)
+ Auto formatting
This commit is contained in:
parent
85b92d9c6f
commit
0562dbbbf9
14 changed files with 434 additions and 431 deletions
|
|
@ -25,7 +25,9 @@ Variants {
|
||||||
property var removingNotifications: ({})
|
property var removingNotifications: ({})
|
||||||
|
|
||||||
// If no notification display activated in settings, then show them all
|
// 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
|
|| (Settings.data.notifications.monitors.length === 0)) : false
|
||||||
|
|
||||||
visible: (NotificationService.notificationModel.count > 0)
|
visible: (NotificationService.notificationModel.count > 0)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Noctalia Shell"
|
text: "Noctalia Shell"
|
||||||
font.pointSize: Style.fontSizeXXXL * scaling
|
font.pointSize: Style.fontSizeXXXL * scaling
|
||||||
|
|
@ -209,8 +208,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: (modelData.contributions || 0) + " " + ((modelData.contributions
|
text: (modelData.contributions || 0) + " " + ((modelData.contributions || 0) === 1 ? "commit" : "commits")
|
||||||
|| 0) === 1 ? "commit" : "commits")
|
|
||||||
font.pointSize: Style.fontSizeXS * scaling
|
font.pointSize: Style.fontSizeXS * scaling
|
||||||
color: contributorArea.containsMouse ? Color.mSurface : Color.mOnSurface
|
color: contributorArea.containsMouse ? Color.mSurface : Color.mOnSurface
|
||||||
}
|
}
|
||||||
|
|
@ -232,4 +230,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import qs.Commons
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
property real localVolume: AudioService.volume
|
property real localVolume: AudioService.volume
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,8 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
id: root
|
||||||
readonly property string tabIcon: "brightness_6"
|
|
||||||
readonly property string tabLabel: "Brightness"
|
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
||||||
// Brightness Step Section
|
// Brightness Step Section
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,13 @@ import qs.Widgets
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
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)
|
// Helper function to get color from scheme file (supports dark/light variants)
|
||||||
function getSchemeColor(schemePath, colorKey) {
|
function getSchemeColor(schemePath, colorKey) {
|
||||||
// Extract scheme name from path
|
// Extract scheme name from path
|
||||||
|
|
@ -29,13 +36,6 @@ ColumnLayout {
|
||||||
return "#000000"
|
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
|
// This function is called by the FileView Repeater when a scheme file is loaded
|
||||||
function schemeLoaded(schemeName, jsonData) {
|
function schemeLoaded(schemeName, jsonData) {
|
||||||
var value = jsonData || {}
|
var value = jsonData || {}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
id: root
|
||||||
readonly property string tabIcon: "monitor"
|
|
||||||
readonly property string tabLabel: "Display"
|
|
||||||
readonly property int tabIndex: 5
|
|
||||||
|
|
||||||
// Time dropdown options (00:00 .. 23:30)
|
// Time dropdown options (00:00 .. 23:30)
|
||||||
ListModel {
|
ListModel {
|
||||||
|
|
@ -43,7 +40,6 @@ ColumnLayout {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Monitor-specific configuration"
|
text: "Monitor-specific configuration"
|
||||||
font.pointSize: Style.fontSizeL * scaling
|
font.pointSize: Style.fontSizeL * scaling
|
||||||
|
|
@ -123,8 +119,8 @@ ColumnLayout {
|
||||||
Settings.data.notifications.monitors = addMonitor(Settings.data.notifications.monitors,
|
Settings.data.notifications.monitors = addMonitor(Settings.data.notifications.monitors,
|
||||||
modelData.name)
|
modelData.name)
|
||||||
} else {
|
} else {
|
||||||
Settings.data.notifications.monitors = removeMonitor(
|
Settings.data.notifications.monitors = removeMonitor(Settings.data.notifications.monitors,
|
||||||
Settings.data.notifications.monitors, modelData.name)
|
modelData.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -246,15 +242,9 @@ ColumnLayout {
|
||||||
onToggled: checked => Settings.data.nightLight.enabled = checked
|
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
|
// Intensity settings
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
visible: Settings.data.nightLight.enabled
|
||||||
NLabel {
|
NLabel {
|
||||||
label: "Intensity"
|
label: "Intensity"
|
||||||
description: "Higher values create warmer light."
|
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
|
// Schedule settings
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginXS * scaling
|
||||||
|
visible: Settings.data.nightLight.enabled && Settings.data.nightLight.autoSchedule
|
||||||
|
|
||||||
NLabel {
|
NLabel {
|
||||||
label: "Schedule"
|
label: "Schedule"
|
||||||
|
|
@ -327,7 +326,6 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NDivider {
|
NDivider {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: Style.marginXL * scaling
|
Layout.topMargin: Style.marginXL * scaling
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
// Profile section
|
// Profile section
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
||||||
NToggle {
|
NToggle {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
||||||
// Output Directory
|
// Output Directory
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
// Location section
|
// Location section
|
||||||
NTextInput {
|
NTextInput {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
id: root
|
||||||
readonly property string tabIcon: "photo_library"
|
|
||||||
readonly property string tabLabel: "Wallpaper Selector"
|
|
||||||
readonly property int tabIndex: 7
|
|
||||||
|
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
// Process to check if swww is installed
|
// Process to check if swww is installed
|
||||||
Process {
|
Process {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue