progress row: improve performance with ListBoxRow

Adw.ActionRow is rather complex and does not perform well with ListBox
models. Use simpler ListBoxRow as base to increase performance.
This commit is contained in:
Peter Eisenmann
2022-10-17 02:05:02 +02:00
parent 75abfc505d
commit e405f00856
2 changed files with 25 additions and 8 deletions

View File

@@ -1,11 +1,26 @@
using Gtk 4.0;
using Adw 1;
template ProgressRow : Adw.ActionRow {
template ProgressRow : ListBoxRow {
activatable: true;
focusable: true;
child: Box {
hexpand: true;
margin-start: 12;
margin-end: 12;
margin-top: 12;
margin-bottom: 12;
spacing: 6;
Image {
icon-name: "go-next-symbolic";
}
Label title {
ellipsize: end;
hexpand: true;
xalign: 0;
}
Image {
halign: end;
icon-name: "go-next-symbolic";
}
};
}

View File

@@ -49,18 +49,20 @@ class PageWrapper(Gtk.Box):
return self.content.get_child()
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/progress_row.ui')
class ProgressRow(Adw.ActionRow):
class ProgressRow(Gtk.ListBoxRow):
__gtype_name__ = 'ProgressRow'
def __init__(self, label, additional_info, **kwargs):
title = Gtk.Template.Child()
def __init__(self, label, additional_info = None, **kwargs):
super().__init__(**kwargs)
self.set_title(label)
self.title.set_label(label)
self.info = additional_info
def get_label(self):
return self.get_title()
return self.title.get_label()
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/selection_row.ui')