Skip to content

Commit

Permalink
fix #264: mpris exampe
Browse files Browse the repository at this point in the history
  • Loading branch information
Aylur committed Jan 28, 2025
1 parent a23ef6a commit cb1578a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/gtk3/js/simple-bar/widget/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ function Media() {
)}
/>
<label
label={bind(ps[0], "title").as(() =>
label={bind(ps[0], "metadata").as(() =>
`${ps[0].title} - ${ps[0].artist}`
)}
/>
</box>
) : (
"Nothing Playing"
<label label="Nothing Playing" />
))}
</box>
}
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk3/py/simple-bar/widget/Bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def sync(self):
self.add(label)

player.bind_property(
"title",
"metadata",
label,
"label",
SYNC,
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk3/vala/simple-bar/widget/Bar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Media : Gtk.Box {
};

Astal.widget_set_class_names(cover, {"Cover"});
player.bind_property("title", label, "label", BindingFlags.SYNC_CREATE, (_, src, ref trgt) => {
player.bind_property("metadata", label, "label", BindingFlags.SYNC_CREATE, (_, src, ref trgt) => {
var title = player.title;
var artist = player.artist;
trgt.set_string(@"$artist - $title");
Expand Down

0 comments on commit cb1578a

Please sign in to comment.