mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-27 00:07:16 +00:00
Merge pull request #826 from art0rz/fix/recording-button
Add screen recording loading feedback
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user