Skip to content

Commit

Permalink
show loading icon when loading thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Oct 21, 2023
1 parent 6f2391e commit d46e483
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/player/now-playing/view.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Gtk from "gi://Gtk?version=4.0";
import Gdk from "gi://Gdk?version=4.0";
import GObject from "gi://GObject";
import GLib from "gi://GLib";
import Adw from "gi://Adw";
Expand Down Expand Up @@ -227,6 +228,18 @@ export class PlayerNowPlayingView extends Adw.NavigationPage {
} else {
this.abort_thumbnail = new AbortController();

const theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default()!);
const icon = theme.lookup_icon(
"icon-missing-symbolic",
[],
400,
this.scale_factor,
this.get_direction(),
Gtk.IconLookupFlags.FORCE_SYMBOLIC,
);

this._picture.set_paintable(icon);

load_thumbnails(this._picture, song.thumbnails, {
width: 400,
signal: this.abort_thumbnail.signal,
Expand Down

0 comments on commit d46e483

Please sign in to comment.