[gedit] Add a "last-child" class to the last row of the open selector



commit 69476d4726c0f90b935390b5c8d7d8b3422b02bb
Author: Paolo Borelli <pborelli gnome org>
Date:   Thu Aug 28 20:19:08 2014 +0200

    Add a "last-child" class to the last row of the open selector

 gedit/gedit-open-document-selector.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-open-document-selector.c b/gedit/gedit-open-document-selector.c
index d94a135..d9ebb17 100644
--- a/gedit/gedit-open-document-selector.c
+++ b/gedit/gedit-open-document-selector.c
@@ -188,6 +188,15 @@ real_populate_listbox (gpointer data)
                row = create_row (open_document_selector, info);
                gtk_recent_info_unref(info);
 
+               /* add a class until gtk implements :last-child */
+               if (l->next == NULL)
+               {
+                       GtkStyleContext *context;
+
+                       context = gtk_widget_get_style_context (row);
+                       gtk_style_context_add_class (context, "last-child");
+               }
+
                gtk_list_box_insert (GTK_LIST_BOX (priv->listbox), row, -1);
        }
 


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