TopCard: check if wlsunset/gpu-screen-recorder is installed, else

disable buttons
i18n: add tooltips
This commit is contained in:
lysec
2025-10-07 13:26:39 +02:00
parent 8627cfe2a4
commit 8a0c0b4aec
7 changed files with 13 additions and 4 deletions
+1
View File
@@ -1177,6 +1177,7 @@
"night-light-disabled": "Nachtlicht ist deaktiviert.\\nLinksklick zum Wechseln des Modus.\\nRechtsklick für Einstellungen.",
"night-light-enabled": "Nachtlicht ist aktiviert.\\nLinksklick zum Wechseln des Modus.\\nRechtsklick für Einstellungen.",
"night-light-forced": "Nachtlicht ist erzwungen.\\nLinksklick zum Wechseln des Modus.\\nRechtsklick für Einstellungen.",
"night-light-not-installed": "Nachtlicht ist nicht verfügbar.\\nwlsunset ist nicht installiert.",
"click-to-start-recording": "Klicken zum Starten der Aufnahme",
"click-to-stop-recording": "Klicken zum Stoppen der Aufnahme",
"open-control-center": "Kontrollzentrum öffnen",
+1
View File
@@ -1158,6 +1158,7 @@
"night-light-disabled": "Night light is disabled.\nLeft click to cycle mode.\nRight click to access settings.",
"night-light-enabled": "Night light is enabled.\nLeft click to cycle mode.\nRight click to access settings.",
"night-light-forced": "Night light is forced.\nLeft click to cycle mode.\nRight click to access settings.",
"night-light-not-installed": "Night light is not available.\nwlsunset is not installed.",
"click-to-start-recording": "Click to start recording",
"click-to-stop-recording": "Click to stop recording",
"open-control-center": "Open control center",
+1
View File
@@ -1156,6 +1156,7 @@
"night-light-disabled": "Luz nocturna desactivada.\nClic izquierdo para cambiar de modo.\nClic derecho para acceder a la configuración.",
"night-light-enabled": "Luz nocturna activada.\nClic izquierdo para cambiar de modo.\nClic derecho para acceder a la configuración.",
"night-light-forced": "Luz nocturna forzada.\nClic izquierdo para cambiar de modo.\nClic derecho para acceder a la configuración.",
"night-light-not-installed": "Luz nocturna no disponible.\nwlsunset no está instalado.",
"click-to-start-recording": "Haz clic para iniciar la grabación",
"click-to-stop-recording": "Haz clic para detener la grabación",
"open-control-center": "Abrir el centro de control",
+1
View File
@@ -1156,6 +1156,7 @@
"night-light-disabled": "L'éclairage nocturne est désactivé.\nClic gauche pour changer de mode.\nClic droit pour accéder aux paramètres.",
"night-light-enabled": "L'éclairage nocturne est activé.\nClic gauche pour changer de mode.\nClic droit pour accéder aux paramètres.",
"night-light-forced": "L'éclairage nocturne est forcé.\nClic gauche pour changer de mode.\nClic droit pour accéder aux paramètres.",
"night-light-not-installed": "L'éclairage nocturne n'est pas disponible.\nwlsunset n'est pas installé.",
"click-to-start-recording": "Cliquez pour démarrer l'enregistrement",
"click-to-stop-recording": "Cliquez pour arrêter l'enregistrement",
"open-control-center": "Ouvrir le centre de contrôle",
+1
View File
@@ -1156,6 +1156,7 @@
"night-light-disabled": "Luz noturna desativada.\nClique esquerdo para alternar o modo.\nClique direito para acessar as configurações.",
"night-light-enabled": "Luz noturna ativada.\nClique esquerdo para alternar o modo.\nClique direito para acessar as configurações.",
"night-light-forced": "Luz noturna forçada.\nClique esquerdo para alternar o modo.\nClique direito para acessar as configurações.",
"night-light-not-installed": "Luz noturna não disponível.\nwlsunset não está instalado.",
"click-to-start-recording": "Clique para iniciar a gravação",
"click-to-stop-recording": "Clique para parar a gravação",
"open-control-center": "Abrir central de controle",
+1
View File
@@ -1156,6 +1156,7 @@
"night-light-disabled": "夜间模式已禁用。\n左键点击循环模式。\n右键点击访问设置。",
"night-light-enabled": "夜间模式已启用。\n左键点击循环模式。\n右键点击访问设置。",
"night-light-forced": "夜间模式已强制启用。\n左键点击循环模式。\n右键点击访问设置。",
"night-light-not-installed": "夜间模式不可用。\nwlsunset 未安装。",
"click-to-start-recording": "点击开始录制",
"click-to-stop-recording": "点击停止录制",
"open-control-center": "打开控制中心",
+7 -4
View File
@@ -114,12 +114,13 @@ NBox {
NIconButton {
baseSize: Style.baseWidgetSize * 0.8
icon: "camera-video"
enabled: ScreenRecorderService.isAvailable
tooltipText: ScreenRecorderService.isAvailable ? (ScreenRecorderService.isRecording ? I18n.tr("tooltips.stop-screen-recording") : I18n.tr("tooltips.start-screen-recording")) : I18n.tr("tooltips.screen-recorder-not-installed")
enabled: ProgramCheckerService.gpuScreenRecorderAvailable
opacity: ProgramCheckerService.gpuScreenRecorderAvailable ? Style.opacityFull : Style.opacityMedium
tooltipText: ProgramCheckerService.gpuScreenRecorderAvailable ? (ScreenRecorderService.isRecording ? I18n.tr("tooltips.stop-screen-recording") : I18n.tr("tooltips.start-screen-recording")) : I18n.tr("tooltips.screen-recorder-not-installed")
colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : Color.mSurfaceVariant
colorFg: ScreenRecorderService.isRecording ? Color.mOnPrimary : Color.mPrimary
onClicked: {
if (!ScreenRecorderService.isAvailable)
if (!ProgramCheckerService.gpuScreenRecorderAvailable)
return
ScreenRecorderService.toggleRecording()
// If we were not recording and we just initiated a start, close the panel
@@ -199,10 +200,12 @@ NBox {
// Night Light
NIconButton {
baseSize: Style.baseWidgetSize * 0.8
enabled: ProgramCheckerService.wlsunsetAvailable
opacity: ProgramCheckerService.wlsunsetAvailable ? Style.opacityFull : Style.opacityMedium
colorBg: Settings.data.nightLight.forced ? Color.mPrimary : Color.transparent
colorFg: Settings.data.nightLight.forced ? Color.mOnPrimary : Color.mPrimary
icon: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? "nightlight-forced" : "nightlight-on") : "nightlight-off"
tooltipText: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? I18n.tr("tooltips.night-light-forced") : I18n.tr("tooltips.night-light-enabled")) : I18n.tr("tooltips.night-light-disabled")
tooltipText: ProgramCheckerService.wlsunsetAvailable ? (Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? I18n.tr("tooltips.night-light-forced") : I18n.tr("tooltips.night-light-enabled")) : I18n.tr("tooltips.night-light-disabled")) : I18n.tr("tooltips.night-light-not-installed")
onClicked: {
// Check if wlsunset is available before enabling night light
if (!ProgramCheckerService.wlsunsetAvailable) {