[gnome-builder] style: don't use GtkSeparator for row separators
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] style: don't use GtkSeparator for row separators
- Date: Mon, 11 May 2015 20:01:45 +0000 (UTC)
commit b44befd5b3471a3d07f2507f3fe7f2dee664c54c
Author: Christian Hergert <christian hergert me>
Date: Mon May 11 13:01:18 2015 -0700
style: don't use GtkSeparator for row separators
This is really slow on gtk master. So while the current situation adds a
bit of a extra styling at the bottom of the list, the 10s of seconds of
reduced startup time is well worth it.
Once more cssnode stuff lands and we can disable it for the last row,
(or first, depending on implementation), things will be better.
data/theme/shared.css | 5 +++++
src/greeter/gb-greeter-window.c | 7 -------
src/preferences/gb-preferences-page-language.c | 21 ++-------------------
src/util/gb-gtk.c | 20 --------------------
src/util/gb-gtk.h | 4 ----
5 files changed, 7 insertions(+), 50 deletions(-)
---
diff --git a/data/theme/shared.css b/data/theme/shared.css
index e782993..2a5f291 100644
--- a/data/theme/shared.css
+++ b/data/theme/shared.css
@@ -98,3 +98,8 @@ GbDocumentStack .button {
transition: none;
}
+
+GbGreeterProjectRow,
+GtkListBoxRow.with-header {
+ border-bottom: 1px solid alpha(@borders, 0.4);
+}
diff --git a/src/greeter/gb-greeter-window.c b/src/greeter/gb-greeter-window.c
index 0f916b8..7738f4e 100644
--- a/src/greeter/gb-greeter-window.c
+++ b/src/greeter/gb-greeter-window.c
@@ -513,13 +513,6 @@ gb_greeter_window_init (GbGreeterWindow *self)
self,
G_CONNECT_SWAPPED);
- gtk_list_box_set_header_func (self->my_projects_list_box,
- gb_gtk_list_box_row_separator_func,
- NULL, NULL);
- gtk_list_box_set_header_func (self->other_projects_list_box,
- gb_gtk_list_box_row_separator_func,
- NULL, NULL);
-
gtk_list_box_set_sort_func (self->my_projects_list_box,
gb_greeter_window_sort_rows,
NULL, NULL);
diff --git a/src/preferences/gb-preferences-page-language.c b/src/preferences/gb-preferences-page-language.c
index ebce11f..dc919ff 100644
--- a/src/preferences/gb-preferences-page-language.c
+++ b/src/preferences/gb-preferences-page-language.c
@@ -23,6 +23,7 @@
#include "gb-editor-settings-widget.h"
#include "gb-preferences-page-language.h"
+#include "gb-gtk.h"
#include "gb-string.h"
#include "gb-widget.h"
@@ -73,6 +74,7 @@ make_language_row (GtkSourceLanguage *language)
row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
"visible", TRUE,
NULL);
+ gb_widget_add_style_class (row, "with-header");
gtk_container_add (GTK_CONTAINER (row), GTK_WIDGET (box));
g_object_set_data (G_OBJECT (row), "GTK_SOURCE_LANGUAGE", language);
@@ -80,23 +82,6 @@ make_language_row (GtkSourceLanguage *language)
return GTK_WIDGET (row);
}
-static void
-item_header_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- g_return_if_fail (GTK_IS_LIST_BOX_ROW (row));
-
- if (before)
- {
- GtkWidget *sep;
-
- sep = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_list_box_row_set_header (row, sep);
- gtk_widget_show (sep);
- }
-}
-
static gboolean
item_filter_func (GtkListBoxRow *row,
gpointer user_data)
@@ -213,8 +198,6 @@ gb_preferences_page_language_constructed (GObject *object)
const gchar * const *lang_ids;
guint i;
- gtk_list_box_set_header_func (page->language_list_box,
- item_header_func, NULL, NULL);
gtk_list_box_set_filter_func (page->language_list_box,
item_filter_func, page->search_entry,
NULL);
diff --git a/src/util/gb-gtk.c b/src/util/gb-gtk.c
index ed30b6d..e1f3184 100644
--- a/src/util/gb-gtk.c
+++ b/src/util/gb-gtk.c
@@ -186,23 +186,3 @@ gb_gtk_text_iter_get_next_char (const GtkTextIter *iter)
return gtk_text_iter_get_char (©);
}
-
-void
-gb_gtk_list_box_row_separator_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- g_return_if_fail (GTK_IS_LIST_BOX_ROW (row));
- g_return_if_fail (!before || GTK_IS_LIST_BOX_ROW (before));
-
- if (before != NULL)
- {
- GtkWidget *header;
-
- header = g_object_new (GTK_TYPE_SEPARATOR,
- "orientation", GTK_ORIENTATION_HORIZONTAL,
- "visible", TRUE,
- NULL);
- gtk_list_box_row_set_header (row, header);
- }
-}
diff --git a/src/util/gb-gtk.h b/src/util/gb-gtk.h
index 8724c45..6c5129d 100644
--- a/src/util/gb-gtk.h
+++ b/src/util/gb-gtk.h
@@ -35,10 +35,6 @@ void gb_gtk_text_view_scroll_to_iter (GtkTextView *text_view,
gdouble xalign,
gdouble yalign);
-void gb_gtk_list_box_row_separator_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data);
-
gboolean gb_gtk_text_view_get_iter_visible (GtkTextView *text_view,
GtkTextIter *iter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]