language row: use AdwActionRow as base

This commit is contained in:
Peter Eisenmann
2022-04-23 16:09:56 +02:00
parent fbbe2bf5eb
commit 427f97c654
2 changed files with 9 additions and 25 deletions

View File

@@ -1,26 +1,12 @@
using Gtk 4.0;
using Adw 1;
template LanguageRow : ListBoxRow {
template LanguageRow : .AdwActionRow {
activatable: true;
focusable: true;
selectable: false;
child:
Box {
margin-start: 12;
margin-end: 12;
margin-top: 6;
margin-bottom: 6;
spacing: 18;
[center]
Label label {
hexpand: true;
wrap: true;
ellipsize: end;
lines: 2;
}
Image {
icon-name: "go-next-symbolic";
}
};
Image {
icon-name: "go-next-symbolic";
}
}

View File

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from gi.repository import Gtk
from gi.repository import Adw, Gtk
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/device_row.ui')
@@ -49,16 +49,14 @@ class DeviceRow(Gtk.ListBoxRow):
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/language_row.ui')
class LanguageRow(Gtk.ListBoxRow):
class LanguageRow(Adw.ActionRow):
__gtype_name__ = 'LanguageRow'
label = Gtk.Template.Child()
def __init__(self, info, **kwargs):
super().__init__(**kwargs)
self.info = info
self.label.set_label(info.name)
self.set_title(info.name)
@Gtk.Template(resource_path='/com/github/p3732/os-installer/ui/widgets/no_partitions_row.ui')