Skip to content

Commit

Permalink
CategoryView: Gtk4 prep (#2073)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Aug 22, 2023
1 parent 495d90c commit 2971547
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Views/CategoryView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

public class AppCenter.CategoryView : Gtk.Stack {
public class AppCenter.CategoryView : Gtk.Box {
public signal void show_app (AppCenterCore.Package package);

public AppStream.Category category { get; construct; }

private Gtk.Stack stack;
private Gtk.ScrolledWindow scrolled;
private Gtk.Box box;
private SubcategoryFlowbox free_flowbox;
Expand All @@ -45,17 +46,21 @@ public class AppCenter.CategoryView : Gtk.Stack {
};

scrolled = new Gtk.ScrolledWindow (null, null) {
child = box,
hscrollbar_policy = Gtk.PolicyType.NEVER
};
scrolled.add (box);

var spinner = new Gtk.Spinner () {
halign = Gtk.Align.CENTER
halign = Gtk.Align.CENTER,
hexpand = true
};
spinner.start ();

add (spinner);
add (scrolled);
stack = new Gtk.Stack ();
stack.add (spinner);
stack.add (scrolled);

add (stack);
show_all ();

populate ();
Expand Down Expand Up @@ -148,7 +153,7 @@ public class AppCenter.CategoryView : Gtk.Stack {
}

show_all ();
visible_child = scrolled;
stack.visible_child = scrolled;
});
}

Expand Down

0 comments on commit 2971547

Please sign in to comment.