[epiphany/wip/exalm/sep: 3/5] pages-view: Reimplement separator header func
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/sep: 3/5] pages-view: Reimplement separator header func
- Date: Sat, 6 Jun 2020 08:48:58 +0000 (UTC)
commit 94d71f541d4d132d7fa1daaae39969f456e9a7d9
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Jun 6 13:42:35 2020 +0500
pages-view: Reimplement separator header func
See https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/491
src/ephy-pages-view.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/src/ephy-pages-view.c b/src/ephy-pages-view.c
index 6a4aaee82..b208e9ba2 100644
--- a/src/ephy-pages-view.c
+++ b/src/ephy-pages-view.c
@@ -24,8 +24,6 @@
#include "ephy-pages-view.h"
-#define HANDY_USE_UNSTABLE_API
-#include <handy.h>
#include "ephy-notebook.h"
#include "ephy-page-row.h"
#include "ephy-window.h"
@@ -197,6 +195,27 @@ list_init (EphyPagesView *self)
g_object_unref (provider);
}
+static void
+separator_header (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
+{
+ GtkWidget *header;
+
+ if (before == NULL) {
+ gtk_list_box_row_set_header (row, NULL);
+
+ return;
+ }
+
+ if (gtk_list_box_row_get_header (row) != NULL)
+ return;
+
+ header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_show (header);
+ gtk_list_box_row_set_header (row, header);
+}
+
static void
ephy_pages_view_init (EphyPagesView *self)
{
@@ -204,7 +223,7 @@ ephy_pages_view_init (EphyPagesView *self)
list_init (self);
- gtk_list_box_set_header_func (self->list_box, hdy_list_box_separator_header, NULL, NULL);
+ gtk_list_box_set_header_func (self->list_box, separator_header, NULL, NULL);
self->list_store = g_list_store_new (EPHY_TYPE_PAGE_ROW);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]