QuickSettings: customization!?

This commit is contained in:
lysec
2025-10-09 13:56:35 +02:00
parent a90bca23aa
commit f77efc409b
15 changed files with 507 additions and 33 deletions
+2 -2
View File
@@ -106,8 +106,8 @@ NBox {
id: grid
Layout.fillWidth: true
columns: 3
columnSpacing: Style.marginL * scaling
rowSpacing: Style.marginM * scaling
columnSpacing: Style.marginM * scaling
rowSpacing: Style.marginS * scaling
Repeater {
model: Settings.data.controlCenter.widgets.quickSettings
+6 -3
View File
@@ -4,14 +4,17 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
outlined: true
text: "Bluetooth"
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
active: BluetoothService.enabled
tooltipText: BluetoothService.enabled ? "Bluetooth enabled" : "Bluetooth disabled"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: PanelService.getPanel("bluetoothPanel")?.toggle(this)
}
@@ -4,14 +4,17 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
outlined: true
text: "Do not Disturb"
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell"
fontWeight: Style.fontWeightMedium
icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell"
active: Settings.data.notifications.doNotDisturb
tooltipText: Settings.data.notifications.doNotDisturb ? "Turn off Do Not Disturb" : "Turn on Do Not Disturb"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb
}
+7 -4
View File
@@ -4,14 +4,17 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
outlined: true
text: IdleInhibitorService.isInhibited ? "Keep-awake" : "Keep-awake"
text: "Keep-awake"
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
active: IdleInhibitorService.isInhibited
tooltipText: IdleInhibitorService.isInhibited ? "Disable keep-awake" : "Enable keep-awake"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: IdleInhibitorService.manualToggle()
}
+15 -3
View File
@@ -4,16 +4,27 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
outlined: true
enabled: ProgramCheckerService.wlsunsetAvailable
text: "Night Light"
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
icon: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? "nightlight-forced" : "nightlight-on") : "nightlight-off"
active: Settings.data.nightLight.enabled
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
tooltipText: {
if (!Settings.data.nightLight.enabled) {
return "Turn on Night Light"
} else if (Settings.data.nightLight.forced) {
return "Night Light forced on"
} else {
return "Turn off Night Light"
}
}
onClicked: {
if (!Settings.data.nightLight.enabled) {
Settings.data.nightLight.enabled = true
@@ -25,6 +36,7 @@ NButton {
Settings.data.nightLight.forced = false
}
}
onRightClicked: {
var settingsPanel = PanelService.getPanel("settingsPanel")
settingsPanel.requestedTab = SettingsPanel.Tab.Display
@@ -6,17 +6,20 @@ import qs.Services
import qs.Widgets
// Performance
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
readonly property bool hasPP: PowerProfileService.available
enabled: hasPP
outlined: true
text: PowerProfileService.getName()
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
icon: PowerProfileService.getIcon()
active: hasPP
tooltipText: hasPP ? "Current: " + PowerProfileService.getName() : "Power profiles not available"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: {
PowerProfileService.cycleProfile()
}
@@ -4,17 +4,19 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
enabled: ProgramCheckerService.gpuScreenRecorderAvailable
outlined: true
icon: "camera-video"
text: "Screen Rec."
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
active: ScreenRecorderService.isRecording
tooltipText: ScreenRecorderService.isRecording ? "Stop recording" : "Start screen recording"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: {
ScreenRecorderService.toggleRecording()
if (!ScreenRecorderService.isRecording) {
@@ -4,17 +4,19 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
enabled: Settings.data.wallpaper.enabled
outlined: true
icon: "wallpaper-selector"
text: "Wallpaper"
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
active: Settings.data.wallpaper.enabled
tooltipText: "Open wallpaper selector"
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: PanelService.getPanel("wallpaperPanel")?.toggle(this)
onRightClicked: WallpaperService.setRandomWallpaper()
}
+36 -4
View File
@@ -4,12 +4,10 @@ import qs.Commons
import qs.Services
import qs.Widgets
NButton {
NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
outlined: true
icon: {
try {
if (NetworkService.ethernetConnected) {
@@ -30,13 +28,47 @@ NButton {
return "signal_wifi_bad"
}
}
text: {
if (NetworkService.ethernetConnected) {
return "Network"
}
return "Wi-Fi"
}
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightRegular
fontWeight: Style.fontWeightMedium
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
active: {
if (NetworkService.ethernetConnected) {
return true
}
try {
for (const net in NetworkService.networks) {
if (NetworkService.networks[net].connected) {
return true
}
}
return false
} catch (error) {
return false
}
}
tooltipText: {
if (NetworkService.ethernetConnected) {
return "Ethernet connected"
}
let connected = false
for (const net in NetworkService.networks) {
if (NetworkService.networks[net].connected) {
connected = true
break
}
}
return connected ? "Wi-Fi connected" : "Wi-Fi disconnected"
}
onClicked: PanelService.getPanel("wifiPanel")?.toggle(this)
}
@@ -27,6 +27,41 @@ ColumnLayout {
}
}
// Quick Settings Style Section
ColumnLayout {
spacing: Style.marginL * scaling
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.controlCenter.quickSettingsStyle.section.label")
description: I18n.tr("settings.controlCenter.quickSettingsStyle.section.description")
}
NComboBox {
id: quickSettingsStyle
label: I18n.tr("settings.controlCenter.quickSettingsStyle.style.label")
description: I18n.tr("settings.controlCenter.quickSettingsStyle.style.description")
Layout.fillWidth: true
model: [{
"key": "modern",
"name": I18n.tr("options.controlCenter.quickSettingsStyle.modern")
}, {
"key": "classic",
"name": I18n.tr("options.controlCenter.quickSettingsStyle.classic")
}]
currentKey: Settings.data.controlCenter.quickSettingsStyle || "modern"
onSelected: function (key) {
Settings.data.controlCenter.quickSettingsStyle = key
}
}
}
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginXL * scaling
Layout.bottomMargin: Style.marginXL * scaling
}
// Widgets Management Section
ColumnLayout {
spacing: Style.marginXXS * scaling