Skip to content

Commit

Permalink
Renamed it 'List View with a Tree', moved link buttons, removed expan…
Browse files Browse the repository at this point in the history
…ders for items without children
  • Loading branch information
Nokse22 committed Oct 9, 2024
1 parent dcd29c1 commit 5386236
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Tree List Model/main.blp → src/List View with a Tree/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Gtk 4.0;
using Adw 1;

Adw.StatusPage {
title: _("List View with TreeListModel");
title: _("List View with a Tree");
description: _("Arrange items in a tree like structure");
valign: start;

Expand All @@ -13,6 +13,15 @@ Adw.StatusPage {
orientation: vertical;
spacing: 18;

ScrolledWindow {
has-frame: true;
height-request: 320;

child: ListView list_view {
factory: SignalListItemFactory factory {};
};
}

Box {
halign: center;

Expand All @@ -26,15 +35,6 @@ Adw.StatusPage {
uri: "https://docs.gtk.org/gtk4/section-list-widget.html#displaying-trees";
}
}

ScrolledWindow {
has-frame: true;
height-request: 320;

child: ListView list_view {
factory: SignalListItemFactory factory {};
};
}
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self):


def create_model_func(item):
if item.children == []:
return None
child_model = Gio.ListStore.new(TreeNode)
for child in item.children:
child_model.append(child)
Expand Down

0 comments on commit 5386236

Please sign in to comment.