[gnome-contacts] sheet: Use AdwPreferencesGroup to combine properties



commit c57e4d7d2fba6439b977b5a1888a9e0d1c0fa998
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Jun 6 13:51:48 2022 +0200

    sheet: Use AdwPreferencesGroup to combine properties
    
    It's a little bit less code, and has the added benefit that it adds an
    accessibility role as well.

 src/contacts-contact-sheet.vala | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/contacts-contact-sheet.vala b/src/contacts-contact-sheet.vala
index 1bba207a..5c6677ed 100644
--- a/src/contacts-contact-sheet.vala
+++ b/src/contacts-contact-sheet.vala
@@ -103,15 +103,13 @@ public class Contacts.ContactSheet : Gtk.Grid {
     if (rows == null)
       return;
 
-    var list_box = new Gtk.ListBox ();
-    list_box.selection_mode = Gtk.SelectionMode.NONE;
-    list_box.add_css_class ("boxed-list");
-    list_box.add_css_class ("contacts-sheet-property");
+    var group = new Adw.PreferencesGroup ();
+    group.add_css_class ("contacts-sheet-property");
 
     foreach (unowned var row in rows)
-      list_box.append (row);
+      group.add (row);
 
-    this.attach (list_box, 0, this.last_row, 3, 1);
+    this.attach (group, 0, this.last_row, 3, 1);
     this.last_row++;
   }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]