I know this is a very specific question, so I was hoping that you could help me, I’m trying to convert the signal GListModel::items-changed, specifically I’m trying to convert the return value of GListModel.get_n_items into an expression that I can use in a widget like this:
let is_header_bar_visible_expr = gtk::ClosureExpression::new<bool>(
[/* I don't know what to put here */],
glib::closure!(|...| {
})
);
is_header_bar_visible_expr.bind(&widget, "is_header_bar_visible");
What I’m trying to achieve is that if n_items > 1, then the expression should resolve to true, false otherwise
Solved, what I did was to use the Adw.NavigationView:visible-child property as a GtkExpression and access to the previous pages using the method Adw.NavigationView.get_previous_page(), to determine whether or not to show the header bar.