[empathy/wip/gbsneto/ui-refresh: 3/6] window: add a header bar to the main window



commit 36491903f01cf1424cb73a06b0bf2dc6bbfaa283
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun Apr 19 15:31:03 2015 +0200

    window: add a header bar to the main window

 src/empathy-roster-window.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index b953e0e..e584cdd 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -2286,6 +2286,9 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
   GtkWidget *sw;
   gchar *filename;
   GtkWidget *search_vbox;
+  GtkWidget *header_bar;
+  GtkWidget *new_conversation_button;
+  GtkWidget *image;
   guint i;
   EmpathyRosterModel *model;
 
@@ -2326,6 +2329,20 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
       NULL);
   g_free (filename);
 
+  header_bar = gtk_header_bar_new ();
+  gtk_header_bar_set_title (GTK_HEADER_BAR(header_bar), _("Conversations"));
+  gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header_bar), TRUE);
+
+  image = gtk_image_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON);
+  new_conversation_button = gtk_button_new ();
+  g_signal_connect (new_conversation_button, "clicked",
+      G_CALLBACK (roster_window_chat_new_message_cb), self);
+  gtk_button_set_image (GTK_BUTTON (new_conversation_button), image);
+  gtk_widget_set_tooltip_text (new_conversation_button, _("New Conversation"));
+  gtk_window_set_titlebar (GTK_WINDOW (self), header_bar);
+  gtk_container_add (GTK_CONTAINER (header_bar), new_conversation_button);
+  gtk_widget_show_all (header_bar);
+
   gtk_container_add (GTK_CONTAINER (self), self->priv->main_vbox);
   gtk_widget_show (self->priv->main_vbox);
 


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