quicksettings: replace hardcoded text with i18n, edit label & tooltip,

force hover when recording
This commit is contained in:
lysec
2025-10-09 17:56:49 +02:00
parent bfb57f13c6
commit 075c8f08f6
19 changed files with 754 additions and 53 deletions
+2 -2
View File
@@ -8,12 +8,12 @@ NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
text: "Bluetooth"
text: I18n.tr("quickSettings.bluetooth.label.enabled")
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightMedium
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
active: BluetoothService.enabled
tooltipText: BluetoothService.enabled ? "Bluetooth enabled" : "Bluetooth disabled"
tooltipText: I18n.tr("quickSettings.bluetooth.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: PanelService.getPanel("bluetoothPanel")?.toggle(this)
+2 -2
View File
@@ -8,12 +8,12 @@ NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
text: "Keep-awake"
text: I18n.tr("quickSettings.keepAwake.label.enabled")
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightMedium
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
active: IdleInhibitorService.isInhibited
tooltipText: IdleInhibitorService.isInhibited ? "Disable keep-awake" : "Enable keep-awake"
tooltipText: I18n.tr("quickSettings.keepAwake.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: IdleInhibitorService.manualToggle()
+2 -10
View File
@@ -9,21 +9,13 @@ NQuickSetting {
property real scaling: 1.0
enabled: ProgramCheckerService.wlsunsetAvailable
text: "Night Light"
text: I18n.tr("quickSettings.nightLight.label.enabled")
fontSize: Style.fontSizeS * scaling
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"
}
}
tooltipText: I18n.tr("quickSettings.nightLight.tooltip.action")
onClicked: {
if (!Settings.data.nightLight.enabled) {
@@ -8,13 +8,14 @@ NQuickSetting {
property ShellScreen screen
property real scaling: 1.0
text: "Do not Disturb"
text: Settings.data.notifications.doNotDisturb ? I18n.tr("quickSettings.notifications.label.disabled") : I18n.tr("quickSettings.notifications.label.enabled")
fontSize: Style.fontSizeS * scaling
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"
tooltipText: I18n.tr("quickSettings.notifications.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb
onClicked: PanelService.getPanel("notificationHistoryPanel")?.toggle(this)
onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb
}
@@ -12,12 +12,12 @@ NQuickSetting {
readonly property bool hasPP: PowerProfileService.available
enabled: hasPP
text: PowerProfileService.getName()
text: hasPP ? PowerProfileService.getName() : I18n.tr("quickSettings.powerProfile.label.unavailable")
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightMedium
icon: PowerProfileService.getIcon()
active: hasPP
tooltipText: hasPP ? "Current: " + PowerProfileService.getName() : "Power profiles not available"
tooltipText: I18n.tr("quickSettings.powerProfile.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: {
@@ -10,13 +10,17 @@ NQuickSetting {
enabled: ProgramCheckerService.gpuScreenRecorderAvailable
icon: "camera-video"
text: "Screen Rec."
text: ScreenRecorderService.isRecording ? I18n.tr("quickSettings.screenRecorder.label.recording") : I18n.tr("quickSettings.screenRecorder.label.stopped")
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightMedium
active: ScreenRecorderService.isRecording
tooltipText: ScreenRecorderService.isRecording ? "Stop recording" : "Start screen recording"
tooltipText: I18n.tr("quickSettings.screenRecorder.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
// Force hover state when recording to get hover colors
property bool originalHovered: hovered
hovered: ScreenRecorderService.isRecording || originalHovered
onClicked: {
ScreenRecorderService.toggleRecording()
if (!ScreenRecorderService.isRecording) {
@@ -10,11 +10,11 @@ NQuickSetting {
enabled: Settings.data.wallpaper.enabled
icon: "wallpaper-selector"
text: "Wallpaper"
text: I18n.tr("quickSettings.wallpaperSelector.label")
fontSize: Style.fontSizeS * scaling
fontWeight: Style.fontWeightMedium
active: Settings.data.wallpaper.enabled
tooltipText: "Open wallpaper selector"
tooltipText: I18n.tr("quickSettings.wallpaperSelector.tooltip.action")
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
onClicked: PanelService.getPanel("wallpaperPanel")?.toggle(this)
+10 -15
View File
@@ -31,9 +31,16 @@ NQuickSetting {
text: {
if (NetworkService.ethernetConnected) {
return "Network"
return I18n.tr("quickSettings.wifi.label.ethernet")
}
return "Wi-Fi"
let connected = false
for (const net in NetworkService.networks) {
if (NetworkService.networks[net].connected) {
connected = true
break
}
}
return connected ? I18n.tr("quickSettings.wifi.label.wifi") : I18n.tr("quickSettings.wifi.label.disconnected")
}
fontSize: Style.fontSizeS * scaling
@@ -56,19 +63,7 @@ NQuickSetting {
}
}
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"
}
tooltipText: I18n.tr("quickSettings.wifi.tooltip.action")
onClicked: PanelService.getPanel("wifiPanel")?.toggle(this)
}