Changes
5 changed files (+128/-8)
-
-
@@ -140,6 +140,70 @@ "store_path": "/nix/store/jfia42fgcpz2gmb5l1mqps5qaaan3lcn-libadwaita-1.6.4"} } }, "libgee@0.20.8": { "last_modified": "2025-05-06T08:06:31Z", "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#libgee", "source": "devbox-search", "version": "0.20.8", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", "path": "/nix/store/y840k861b22mys0f3l83qcmp1wj0pz4w-libgee-0.20.8", "default": true }, { "name": "dev", "path": "/nix/store/14aj27pgrj1czgn7gqg2psw6icli7yqx-libgee-0.20.8-dev" } ], "store_path": "/nix/store/y840k861b22mys0f3l83qcmp1wj0pz4w-libgee-0.20.8" }, "aarch64-linux": { "outputs": [ { "name": "out", "path": "/nix/store/p4hllgaa7djbnyqxl1rqan7cqpcnhwz1-libgee-0.20.8", "default": true }, { "name": "dev", "path": "/nix/store/h5rkqjc9rlmcxa3b1hzfzaa4paqx5cvv-libgee-0.20.8-dev" } ], "store_path": "/nix/store/p4hllgaa7djbnyqxl1rqan7cqpcnhwz1-libgee-0.20.8" }, "x86_64-darwin": { "outputs": [ { "name": "out", "path": "/nix/store/vfmyw0ckc7w0fy0afpwiv0ddvgc30lc7-libgee-0.20.8", "default": true }, { "name": "dev", "path": "/nix/store/sq3530i1aaqc2jc7bfhblwy6lpd7bshz-libgee-0.20.8-dev" } ], "store_path": "/nix/store/vfmyw0ckc7w0fy0afpwiv0ddvgc30lc7-libgee-0.20.8" }, "x86_64-linux": { "outputs": [ { "name": "out", "path": "/nix/store/2dx5rcalgaxdrqrb7bnvpqrjkcd8m2gr-libgee-0.20.8", "default": true }, { "name": "dev", "path": "/nix/store/kcnn3igzyk7jvswk9vr6q5ydjscc2dy6-libgee-0.20.8-dev" } ], "store_path": "/nix/store/2dx5rcalgaxdrqrb7bnvpqrjkcd8m2gr-libgee-0.20.8" } } }, "librsvg@2.59.2": { "last_modified": "2025-04-12T07:19:22Z", "resolved": "github:NixOS/nixpkgs/2349f9de17183971db12ae9e0123dab132023bd7#librsvg",
-
-
-
@@ -68,6 +68,7 @@ "libadwaita-1",// Neither GTK4 nor Libadwaita provides SVG rendering. We need to use librsvg for // that purpose, whilst undocumented. "librsvg-2.0", "gee-0.8", }; // A directory containing C source files compiled from Vala source code.
-
-
-
@@ -42,7 +42,7 @@ <child><object class="GtkMenuButton"> <property name="label">Zone</property> <property name="popover"> <object class="GtkPopover"> <object class="GtkPopover" id="zone_list_popover"> <child> <object class="GtkListBox" id="zone_list" /> </child>
-
-
-
@@ -15,6 +15,10 @@ },"librsvg": { "version": "2.59.2", "outputs": ["out", "dev"] }, "libgee": { "version": "0.20.8", "outputs": ["out", "dev"] } } }
-
-
-
@@ -24,9 +24,16 @@ [GtkChild]private unowned Gtk.Button pause; [GtkChild] private unowned Gtk.Popover zone_list_popover; [GtkChild] private unowned Gtk.ListBox zone_list; private unowned PlacCore.App core; private Gee.HashMap<string, ZoneSelectorRow>zone_rows = new Gee.HashMap<string, ZoneSelectorRow>(); private string? zone_id = null; public PlaybackToolbar() { Object();
-
@@ -44,6 +51,12 @@core.lock(); render(); core.unlock(); zone_list.row_activated.connect((row) => { zone_id = ((ZoneSelectorRow) row).zone.id; render(); zone_list_popover.popdown(); }); } private void subscribe_zone_change() {
-
@@ -62,8 +75,6 @@ }} public void render() { zone_list.remove_all(); if (core.server == null) { return; }
-
@@ -71,20 +82,40 @@unowned PlacCore.Zone? zone = null; foreach (unowned PlacCore.Zone z in core.server.zones) { if (zone_id == null) { zone_id = z.id; break; } if (zone_id == z.id) { zone = z; } } foreach (unowned PlacCore.Zone z in core.server.zones) { // Zone was removed. if (zone == null) { zone_id = z.id; zone = z; } var row = new Gtk.ListBoxRow(); var label = new Gtk.Label(z.name); row.child = label; zone_list.append(row); if (zone_rows.has_key(z.id)) { // TODO: Separate update logic from rendering // TODO: Handle zone removal (currently segfaults) var row = zone_rows[z.id]; row.zone = z; row.render(); } else { var row = new ZoneSelectorRow(z); row.render(); zone_list.append(row); zone_rows[z.id] = row; } } if (zone == null) { return; } switch (zone.playback_state) { case STOPPED:
-
@@ -97,6 +128,26 @@ play.visible = false;pause.visible = true; break; } } } class ZoneSelectorRow : Gtk.ListBoxRow { private Gtk.Label label; public unowned PlacCore.Zone zone; public ZoneSelectorRow(PlacCore.Zone zone) { Object(); this.zone = zone; } construct { label = new Gtk.Label(""); this.child = label; this.activatable = true; } public void render() { this.label.label = this.zone.name; } } }
-