[empathy/wip/gbsneto/ui-refresh: 2/6] new-message-dialog: switch to use an header bar



commit e589b6a4caed87e0debb9b3f66c549b0bf73865a
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun Apr 19 14:40:05 2015 +0200

    new-message-dialog: switch to use an header bar

 libempathy-gtk/empathy-contact-chooser.c    |   10 +++++++---
 libempathy-gtk/empathy-new-message-dialog.c |   25 +++++++++++++++----------
 2 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index 05dbe34..4a4e4b4 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -12,6 +12,8 @@
 #include "config.h"
 #include "empathy-contact-chooser.h"
 
+#include <glib/gi18n-lib.h>
+
 #include "empathy-client-factory.h"
 #include "empathy-individual-store-manager.h"
 #include "empathy-individual-view.h"
@@ -409,8 +411,10 @@ empathy_contact_chooser_init (EmpathyContactChooser *self)
   tp_proxy_prepare_async (self->priv->account_mgr, features, NULL, NULL);
 
   /* Search entry */
-  self->priv->search_entry = gtk_entry_new ();
-  gtk_box_pack_start (GTK_BOX (self), self->priv->search_entry, FALSE, TRUE, 6);
+  self->priv->search_entry = gtk_search_entry_new ();
+  gtk_entry_set_placeholder_text ( GTK_ENTRY(self->priv->search_entry),
+                  _("Type to search a contact…"));
+  gtk_box_pack_start (GTK_BOX (self), self->priv->search_entry, FALSE, TRUE, 0);
   gtk_widget_show (self->priv->search_entry);
 
   g_signal_connect (self->priv->search_entry, "changed",
@@ -446,7 +450,7 @@ empathy_contact_chooser_init (EmpathyContactChooser *self)
   gtk_container_add (GTK_CONTAINER (self->priv->scroll_view),
       GTK_WIDGET (self->priv->view));
 
-  gtk_box_pack_start (GTK_BOX (self), self->priv->scroll_view, TRUE, TRUE, 6);
+  gtk_box_pack_start (GTK_BOX (self), self->priv->scroll_view, TRUE, TRUE, 0);
   gtk_widget_show (GTK_WIDGET (self->priv->view));
   gtk_widget_show (self->priv->scroll_view);
 }
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index 3661472..aa55ae0 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -254,7 +254,9 @@ selection_changed_cb (GtkWidget *chooser,
     }
 
   gtk_widget_set_sensitive (self->priv->button_chat, can_chat);
+#if 0
   gtk_widget_set_sensitive (self->priv->button_sms, can_sms);
+#endif
 }
 
 static void
@@ -267,7 +269,6 @@ selection_activate_cb (GtkWidget *chooser,
 static void
 empathy_new_message_dialog_init (EmpathyNewMessageDialog *self)
 {
-  GtkWidget *label;
   GtkWidget *image;
   GtkWidget *content;
 
@@ -276,17 +277,13 @@ empathy_new_message_dialog_init (EmpathyNewMessageDialog *self)
 
   content = gtk_dialog_get_content_area (GTK_DIALOG (self));
 
-  label = gtk_label_new (_("Enter a contact identifier or phone number:"));
-  gtk_box_pack_start (GTK_BOX (content), label, FALSE, FALSE, 0);
-  gtk_widget_show (label);
-
   /* contact chooser */
   self->priv->chooser = empathy_contact_chooser_new ();
 
   empathy_contact_chooser_set_filter_func (
       EMPATHY_CONTACT_CHOOSER (self->priv->chooser), filter_individual, self);
 
-  gtk_box_pack_start (GTK_BOX (content), self->priv->chooser, TRUE, TRUE, 6);
+  gtk_box_pack_start (GTK_BOX (content), self->priv->chooser, TRUE, TRUE, 0);
   gtk_widget_show (self->priv->chooser);
 
   g_signal_connect (self->priv->chooser, "selection-changed",
@@ -296,23 +293,27 @@ empathy_new_message_dialog_init (EmpathyNewMessageDialog *self)
 
   /* close button */
   gtk_dialog_add_button (GTK_DIALOG (self),
-      GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 
+#if 0
   /* add SMS button */
   self->priv->button_sms = gtk_button_new_with_mnemonic (_("_SMS"));
   image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_SMS,
       GTK_ICON_SIZE_BUTTON);
   gtk_button_set_image (GTK_BUTTON (self->priv->button_sms), image);
+#endif
 
   /* add chat button */
-  self->priv->button_chat = gtk_button_new_with_mnemonic (_("_Chat"));
+  self->priv->button_chat = gtk_button_new_with_mnemonic (_("_Done"));
   image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_NEW_MESSAGE,
       GTK_ICON_SIZE_BUTTON);
   gtk_button_set_image (GTK_BUTTON (self->priv->button_chat), image);
 
+#if 0
   gtk_dialog_add_action_widget (GTK_DIALOG (self), self->priv->button_sms,
       EMP_NEW_MESSAGE_SMS);
   gtk_widget_show (self->priv->button_sms);
+#endif
 
   gtk_dialog_add_action_widget (GTK_DIALOG (self), self->priv->button_chat,
       EMP_NEW_MESSAGE_TEXT);
@@ -323,10 +324,12 @@ empathy_new_message_dialog_init (EmpathyNewMessageDialog *self)
   gtk_window_set_role (GTK_WINDOW (self), "new_message");
 
   /* Set a default height so a few contacts are displayed */
-  gtk_window_set_default_size (GTK_WINDOW (self), -1, 400);
+  gtk_window_set_default_size (GTK_WINDOW (self), -1, 600);
 
   gtk_widget_set_sensitive (self->priv->button_chat, FALSE);
+#if 0
   gtk_widget_set_sensitive (self->priv->button_sms, FALSE);
+#endif
 }
 
 static void
@@ -356,7 +359,9 @@ empathy_new_message_dialog_show (GtkWindow *parent)
 {
   GtkWidget *dialog;
 
-  dialog = g_object_new (EMPATHY_TYPE_NEW_MESSAGE_DIALOG, NULL);
+  dialog = g_object_new (EMPATHY_TYPE_NEW_MESSAGE_DIALOG,
+                  "use-header-bar", 1,
+                  NULL);
 
   if (parent)
     {


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