progress-row: Use AdwActionRow as base

This commit is contained in:
Peter Eisenmann
2024-10-09 01:09:28 -05:00
parent db9bf1e424
commit e89ee64e8e
3 changed files with 10 additions and 29 deletions

View File

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

View File

@@ -70,9 +70,9 @@ class FilterPage(Gtk.Box):
def _row_selected(self, list_box, row):
match self.type:
case FilterType.format:
set_system_formats(row.info, row.get_label())
set_system_formats(row.info, row.get_title())
case FilterType.timezone:
set_system_timezone(row.get_label())
set_system_timezone(row.get_title())
global_state.advance(self)

View File

@@ -90,21 +90,15 @@ class MultiSelectionRow(Adw.ComboRow):
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/progress_row.ui')
class ProgressRow(Gtk.ListBoxRow):
class ProgressRow(Adw.ActionRow):
__gtype_name__ = __qualname__
title = Gtk.Template.Child()
def __init__(self, label, additional_info=None, **kwargs):
super().__init__(**kwargs)
self.title.set_label(label)
self.set_title(label)
self.info = additional_info
def get_label(self):
return self.title.get_label()
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/selection_row.ui')
class SelectionRow(Adw.ActionRow):