Merge pull request #826 from art0rz/fix/recording-button

Add screen recording loading feedback
This commit is contained in:
Lysec
2025-11-22 12:49:32 +01:00
committed by GitHub
+30 -1
View File
@@ -1,3 +1,4 @@
import QtQuick
import Quickshell
import qs.Commons
import qs.Services.Media
@@ -11,7 +12,7 @@ NIconButton {
property ShellScreen screen
icon: "camera-video"
icon: ScreenRecorderService.isPending ? "" : "camera-video"
tooltipText: ScreenRecorderService.isRecording ? I18n.tr("tooltips.click-to-stop-recording") : I18n.tr("tooltips.click-to-start-recording")
tooltipDirection: BarService.getTooltipDirection()
density: Settings.data.bar.density
@@ -31,4 +32,32 @@ NIconButton {
}
onClicked: handleClick()
// Custom spinner shown only during pending start
NIcon {
id: pendingSpinner
icon: "loader-2"
visible: ScreenRecorderService.isPending
pointSize: {
switch (root.density) {
case "compact":
return Math.max(1, root.width * 0.65);
default:
return Math.max(1, root.width * 0.48);
}
}
applyUiScale: root.applyUiScale
color: root.enabled && root.hovering ? colorFgHover : colorFg
anchors.centerIn: parent
transformOrigin: Item.Center
RotationAnimation on rotation {
running: ScreenRecorderService.isPending
from: 0
to: 360
duration: Style.animationSlow
loops: Animation.Infinite
onStopped: pendingSpinner.rotation = 0
}
}
}