[gnome-chat] chat-contacts-list-dialog: Add separator between each contact
- From: Yosef Or Boczko <yoseforb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chat] chat-contacts-list-dialog: Add separator between each contact
- Date: Thu, 12 Sep 2013 21:23:00 +0000 (UTC)
commit 2e94fa7822ae1188a97e8981b1be33a687fdaaa4
Author: Yosef Or Boczko <yoseforb gmail com>
Date: Fri Sep 13 00:08:44 2013 +0300
chat-contacts-list-dialog: Add separator between each contact
src/chat-contacts-list-dialog.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/chat-contacts-list-dialog.c b/src/chat-contacts-list-dialog.c
index 5c71b7e..1cc4e89 100644
--- a/src/chat-contacts-list-dialog.c
+++ b/src/chat-contacts-list-dialog.c
@@ -255,6 +255,24 @@ chat_contacts_list_dialog_account_manager_prepare (GObject *source_object, GAsyn
static void
+chat_contacts_list_dialog_update_header_func (GtkListBoxRow *row, GtkListBoxRow *before, gpointer user_data)
+{
+ GtkWidget *current;
+
+ if (before == NULL)
+ return;
+
+ current = gtk_list_box_row_get_header (row);
+ if (current == NULL)
+ {
+ current = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_show (current);
+ gtk_list_box_row_set_header (row, current);
+ }
+}
+
+
+static void
chat_contacts_list_dialog_dispose (GObject *object)
{
ChatContactsListDialog *self = CHAT_CONTACTS_LIST_DIALOG (object);
@@ -282,6 +300,8 @@ chat_contacts_list_dialog_init (ChatContactsListDialog *self)
gtk_widget_init_template (GTK_WIDGET (self));
+ gtk_list_box_set_header_func (GTK_LIST_BOX (priv->list_box), chat_contacts_list_dialog_update_header_func,
NULL, NULL);
+
priv->accounts = g_hash_table_new_full (g_direct_hash,
chat_contacts_list_dialog_accounts_key_equal_func,
g_object_unref,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]