[gnome-clocks/wip/exalm/header: 2/2] Add list separators via css instead of header func



commit 08bd4405781c8942278896a7b923066e3e64a7a6
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Jun 6 16:23:18 2020 +0500

    Add list separators via css instead of header func
    
    See https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/491

 data/css/gnome-clocks.css | 4 ++++
 src/alarm.vala            | 4 ----
 src/stopwatch.vala        | 1 -
 src/timer.vala            | 1 -
 src/world.vala            | 2 --
 5 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index 3197e7b..74d96a0 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -19,6 +19,10 @@ label.destructive-action {
        margin: 18px 6px;
 }
 
+.clocks-list > row:not(:last-child) {
+       border-bottom: 1px solid rgba(0, 0, 0, .1);
+}
+
 .pill-button {
        border-radius: 9999px;
        -gtk-outline-radius: 9999px;
diff --git a/src/alarm.vala b/src/alarm.vala
index bc67f0b..da6d082 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -546,8 +546,6 @@ private class SetupDialog : Hdy.Dialog {
     [GtkChild]
     private Gtk.Revealer label_revealer;
     [GtkChild]
-    private Gtk.ListBox listbox;
-    [GtkChild]
     private Gtk.Button delete_button;
     private List<Item> other_alarms;
 
@@ -569,7 +567,6 @@ private class SetupDialog : Hdy.Dialog {
         set_default_response (Gtk.ResponseType.OK);
 
         delete_button.visible = alarm != null;
-        listbox.set_header_func ((Gtk.ListBoxUpdateHeaderFunc) Hdy.list_box_separator_header);
 
         other_alarms = new List<Item> ();
         var n = all_alarms.get_n_items ();
@@ -833,7 +830,6 @@ public class Face : Gtk.Stack, Clocks.Clock {
             }
         });
 
-        listbox.set_header_func ((Gtk.ListBoxUpdateHeaderFunc) Hdy.list_box_separator_header);
         listbox.bind_model (alarms, (item) => {
             return new Row ((Item) item, this);
         });
diff --git a/src/stopwatch.vala b/src/stopwatch.vala
index f67a5bd..462affc 100644
--- a/src/stopwatch.vala
+++ b/src/stopwatch.vala
@@ -160,7 +160,6 @@ public class Face : Gtk.Box, Clocks.Clock {
         timer = new GLib.Timer ();
         tick_id = 0;
 
-        laps_list.set_header_func ((Gtk.ListBoxUpdateHeaderFunc) Hdy.list_box_separator_header);
         laps_list.bind_model (laps, (lap) => {
             var total_items = laps.get_n_items ();
             Lap? before = null;
diff --git a/src/timer.vala b/src/timer.vala
index 6ce6ddd..ba84450 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -403,7 +403,6 @@ public class Face : Gtk.Stack, Clocks.Clock {
         settings = new GLib.Settings ("org.gnome.clocks");
         timers = new ContentStore ();
 
-        timers_list.set_header_func ((Gtk.ListBoxUpdateHeaderFunc) Hdy.list_box_separator_header);
         timers_list.bind_model (timers, (timer) => {
             var row = new Row ((Item) timer);
             row.deleted.connect (() => remove_timer ((Item) timer));
diff --git a/src/world.vala b/src/world.vala
index 127dc85..e7d3792 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -636,8 +636,6 @@ public class Face : Gtk.Stack, Clocks.Clock {
             return 0;
         });
 
-        listbox.set_header_func ((Gtk.ListBoxUpdateHeaderFunc) Hdy.list_box_separator_header);
-
         listbox.bind_model (locations, (item) => {
             var tile = new Tile ((Item) item);
 


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