[epiphany/wip/exalm/sep: 4/5] Stop manually adding css for page lists
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/sep: 4/5] Stop manually adding css for page lists
- Date: Sat, 6 Jun 2020 08:49:03 +0000 (UTC)
commit f9a05ad06ccddce12eea89b7018e131aee088b41
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Jun 6 13:47:01 2020 +0500
Stop manually adding css for page lists
Use the shared stylesheet for that.
src/ephy-pages-popover.c | 17 -----------------
src/ephy-pages-view.c | 17 -----------------
src/resources/gtk/pages-popover.ui | 3 +++
src/resources/gtk/pages-view.ui | 3 +++
src/resources/themes/_shared-base.scss | 4 ++++
5 files changed, 10 insertions(+), 34 deletions(-)
---
diff --git a/src/ephy-pages-popover.c b/src/ephy-pages-popover.c
index e6b0e1957..6cc8c477b 100644
--- a/src/ephy-pages-popover.c
+++ b/src/ephy-pages-popover.c
@@ -208,28 +208,11 @@ ephy_pages_popover_class_init (EphyPagesPopoverClass *klass)
gtk_widget_class_bind_template_callback (widget_class, row_selected_cb);
}
-static void
-list_init (EphyPagesPopover *self)
-{
- GtkCssProvider *provider = gtk_css_provider_new ();
-
- /* This makes the list's background transparent. */
- gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
- "list { border-style: none; background-color: transparent; }", -1, NULL);
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self->list_box)),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- g_object_unref (provider);
-}
-
static void
ephy_pages_popover_init (EphyPagesPopover *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- list_init (self);
-
self->list_store = g_list_store_new (EPHY_TYPE_PAGE_ROW);
gtk_list_box_bind_model (self->list_box,
diff --git a/src/ephy-pages-view.c b/src/ephy-pages-view.c
index b208e9ba2..13485f816 100644
--- a/src/ephy-pages-view.c
+++ b/src/ephy-pages-view.c
@@ -180,21 +180,6 @@ ephy_pages_view_class_init (EphyPagesViewClass *klass)
gtk_widget_class_bind_template_callback (widget_class, row_activated_cb);
}
-static void
-list_init (EphyPagesView *self)
-{
- GtkCssProvider *provider = gtk_css_provider_new ();
-
- /* This makes the list's background transparent. */
- gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
- "list { border-style: none; background-color: transparent; }", -1, NULL);
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self->list_box)),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- g_object_unref (provider);
-}
-
static void
separator_header (GtkListBoxRow *row,
GtkListBoxRow *before,
@@ -221,8 +206,6 @@ ephy_pages_view_init (EphyPagesView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- list_init (self);
-
gtk_list_box_set_header_func (self->list_box, separator_header, NULL, NULL);
self->list_store = g_list_store_new (EPHY_TYPE_PAGE_ROW);
diff --git a/src/resources/gtk/pages-popover.ui b/src/resources/gtk/pages-popover.ui
index 92a64e164..219ec5dcd 100644
--- a/src/resources/gtk/pages-popover.ui
+++ b/src/resources/gtk/pages-popover.ui
@@ -18,6 +18,9 @@
<property name="visible">True</property>
<property name="width_request">300</property>
<signal name="row-selected" handler="row_selected_cb" swapped="true"/>
+ <style>
+ <class name="transparent"/>
+ </style>
</object>
</child>
</object>
diff --git a/src/resources/gtk/pages-view.ui b/src/resources/gtk/pages-view.ui
index ec0a1fd22..cb97d1979 100644
--- a/src/resources/gtk/pages-view.ui
+++ b/src/resources/gtk/pages-view.ui
@@ -11,6 +11,9 @@
<property name="visible">True</property>
<property name="width_request">300</property>
<signal name="row-activated" handler="row_activated_cb" swapped="true"/>
+ <style>
+ <class name="transparent"/>
+ </style>
</object>
</child>
</template>
diff --git a/src/resources/themes/_shared-base.scss b/src/resources/themes/_shared-base.scss
index 87c7a3be3..1463b5a7b 100644
--- a/src/resources/themes/_shared-base.scss
+++ b/src/resources/themes/_shared-base.scss
@@ -195,3 +195,7 @@ dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > li
min-width: 14px;
}
}
+
+.transparent {
+ background: none;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]