Removed unused overlay, slowed down turning speed
This commit is contained in:
1 parent
354031528d
commit
884b8be1cc
1 file changed
+1
-20
+1
-20
@@ -25,7 +25,7 @@ function VinylRecord({ player, size }: { player: any; size: number }) {
|
|||||||
|
|
||||||
const startSpin = () => {
|
const startSpin = () => {
|
||||||
if (timerId !== null) return
|
if (timerId !== null) return
|
||||||
timerId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 33, () => {
|
timerId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 50, () => {
|
||||||
angle = (angle + 2) % 360
|
angle = (angle + 2) % 360
|
||||||
applyAngle()
|
applyAngle()
|
||||||
return true
|
return true
|
||||||
@@ -59,25 +59,6 @@ function VinylRecord({ player, size }: { player: any; size: number }) {
|
|||||||
img.icon_name = "audio-x-generic-symbolic"
|
img.icon_name = "audio-x-generic-symbolic"
|
||||||
img.pixel_size = size
|
img.pixel_size = size
|
||||||
|
|
||||||
const holeSize = Math.round(size * 0.1)
|
|
||||||
const hole = new Gtk.Box({
|
|
||||||
halign: Gtk.Align.CENTER,
|
|
||||||
valign: Gtk.Align.CENTER,
|
|
||||||
})
|
|
||||||
const holeProvider = new Gtk.CssProvider()
|
|
||||||
holeProvider.load_from_string(`
|
|
||||||
box {
|
|
||||||
background: rgba(0, 0, 0, 0.85);
|
|
||||||
border: 2px solid rgba(255, 255, 255, 0.15);
|
|
||||||
border-radius: 50%;
|
|
||||||
min-width: ${holeSize}px;
|
|
||||||
min-height: ${holeSize}px;
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
hole
|
|
||||||
.get_style_context()
|
|
||||||
.add_provider(holeProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
|
|
||||||
|
|
||||||
const overlay = new Gtk.Overlay()
|
const overlay = new Gtk.Overlay()
|
||||||
overlay.child = img
|
overlay.child = img
|
||||||
frame.child = overlay
|
frame.child = overlay
|
||||||
|
|||||||
Reference in new issue
Block a user