Changes
2 changed files (+96/-80)
-
-
@@ -20,104 +20,108 @@ <interface><template class="PlacGtkAdwaitaBrowse" parent="GtkBox"> <property name="orientation">vertical</property> <child> <object class="GtkOverlay"> <object class="AdwToastOverlay" id="toasts"> <child> <object class="GtkBox"> <property name="orientation">vertical</property> <object class="GtkOverlay"> <child> <object class="GtkBox" id="metadata"> <property name="margin-top">20</property> <property name="margin-bottom">10</property> <property name="margin-start">12</property> <binding name="margin-end"> <lookup name="margin-start">metadata</lookup> </binding> <object class="GtkBox"> <property name="orientation">vertical</property> <child> <object class="GtkBox"> <property name="orientation">horizontal</property> <property name="spacing">4</property> <child> <object class="GtkButton" id="back"> <property name="visible">false</property> <property name="icon-name">go-previous-symbolic</property> <property name="valign">center</property> <accessibility> <property name="label">Go back to previous page</property> </accessibility> <style> <class name="flat" /> </style> </object> </child> <object class="GtkBox" id="metadata"> <property name="margin-top">20</property> <property name="margin-bottom">10</property> <property name="margin-start">12</property> <binding name="margin-end"> <lookup name="margin-start">metadata</lookup> </binding> <property name="orientation">vertical</property> <child> <object class="GtkBox" id="metadata_labels"> <property name="orientation">vertical</property> <property name="margin-start">4</property> <property name="margin-top">4</property> <binding name="margin-bottom"> <lookup name="margin-top">metadata_labels</lookup> </binding> <object class="GtkBox"> <property name="orientation">horizontal</property> <property name="spacing">4</property> <child> <object class="GtkLabel" id="title"> <property name="xalign">0</property> <property name="ellipsize">end</property> <object class="GtkButton" id="back"> <property name="visible">false</property> <property name="icon-name">go-previous-symbolic</property> <property name="valign">center</property> <accessibility> <property name="label">Go back to previous page</property> </accessibility> <style> <class name="title-2" /> <class name="flat" /> </style> </object> </child> <child> <object class="GtkLabel" id="subtitle"> <property name="visible">false</property> <property name="xalign">0</property> <property name="ellipsize">end</property> <object class="GtkBox" id="metadata_labels"> <property name="orientation">vertical</property> <property name="margin-start">4</property> <property name="margin-top">4</property> <binding name="margin-bottom"> <lookup name="margin-top">metadata_labels</lookup> </binding> <child> <object class="GtkLabel" id="title"> <property name="xalign">0</property> <property name="ellipsize">end</property> <style> <class name="title-2" /> </style> </object> </child> <child> <object class="GtkLabel" id="subtitle"> <property name="visible">false</property> <property name="xalign">0</property> <property name="ellipsize">end</property> </object> </child> </object> </child> </object> </child> </object> </child> </object> </child> <child> <object class="GtkScrolledWindow" id="scroller"> <property name="vexpand">true</property> <property name="child"> <object class="GtkListBox" id="items"> <property name="margin-bottom">12</property> <style> <class name="background" /> </style> <child> <object class="GtkScrolledWindow" id="scroller"> <property name="vexpand">true</property> <property name="child"> <object class="GtkListBox" id="items"> <property name="margin-bottom">12</property> <style> <class name="background" /> </style> </object> </property> </object> </property> </object> </child> </object> </child> <child type="overlay"> <object class="GtkBox" id="loading"> <property name="visible">false</property> <property name="halign">end</property> <property name="valign">start</property> <property name="orientation">horizontal</property> <property name="spacing">4</property> <property name="margin-top">2</property> <property name="margin-end">2</property> <style> <class name="osd" /> </style> <child> <object class="AdwSpinner"> <property name="margin-start">4</property> </child> </object> </child> <child> <object class="GtkLabel"> <property name="label">Loading...</property> <property name="margin-top">4</property> <property name="margin-bottom">4</property> <property name="margin-end">4</property> <child type="overlay"> <object class="GtkBox" id="loading"> <property name="visible">false</property> <property name="halign">end</property> <property name="valign">start</property> <property name="orientation">horizontal</property> <property name="spacing">4</property> <property name="margin-top">2</property> <property name="margin-end">2</property> <style> <class name="osd" /> </style> <child> <object class="AdwSpinner"> <property name="margin-start">4</property> </object> </child> <child> <object class="GtkLabel"> <property name="label">Loading...</property> <property name="margin-top">4</property> <property name="margin-bottom">4</property> <property name="margin-end">4</property> </object> </child> </object> </child> </object>
-
-
-
@@ -38,6 +38,9 @@[GtkChild] private unowned Gtk.ScrolledWindow scroller; [GtkChild] private unowned Adw.ToastOverlay toasts; private Plac.AsyncConnection? conn = null; private Plac.Transport.Zone? _zone = null;
-
@@ -125,13 +128,22 @@ var result = conn.browse.end(res);if (result.code != OK) { GLib.log("Plac", LEVEL_WARNING, "Browse request failed: %s", result.code.to_string()); loading.visible = false; var toast = new Adw.Toast.format("Browse operation failed: %s", result.code.to_string()); toast.priority = HIGH; toasts.add_toast(toast); end_loading(); return; } if (result.action != LIST) { GLib.log("Plac", LEVEL_WARNING, "Unexpected result action: %s", result.action.to_string()); loading.visible = false; var toast = new Adw.Toast.format( "Browse operation failed: unexpected item type %s", result.action.to_string() ); toast.priority = HIGH; toasts.add_toast(toast); end_loading(); return; }
-