diff options
author | Davyd Madeley <davyd@madeley.id.au> | 2009-04-11 00:53:13 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-04-11 00:53:13 +0800 |
commit | 1a1ed44c4b3802b86d2ae97c602b7d68243e95a1 (patch) | |
tree | c767fbc2711a863387858a2edc7ed7f21011897c | |
parent | cbadf749d1cc3974d4f02ee3ecc0423d768d922c (diff) | |
download | gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar.gz gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar.bz2 gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar.lz gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar.xz gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.tar.zst gsoc2013-empathy-1a1ed44c4b3802b86d2ae97c602b7d68243e95a1.zip |
Set the chooser in "editing mode" when you start editing it
From: Davyd Madeley <davyd@madeley.id.au>
svn path=/trunk/; revision=2769
-rw-r--r-- | libempathy-gtk/empathy-presence-chooser.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 8ca4770de..d58be5171 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -275,10 +275,30 @@ set_status_editing (EmpathyPresenceChooser *self, gboolean editing) gtk_entry_set_icon_sensitive (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE); + + // FIXME - move the focus somewhere } } static void +entry_icon_release_cb (EmpathyPresenceChooser *self, + GtkEntryIconPosition icon_pos, + GdkEvent *event, + GtkEntry *entry) +{ + set_status_editing (self, FALSE); +} + +static void +entry_activate_cb (EmpathyPresenceChooser *self, + GtkEntry *entry) +{ + g_print ("ACTIVATE! (form of a dragon)\n"); + + set_status_editing (self, FALSE); +} + +static void changed_cb (GtkComboBox *self, gpointer user_data) { g_print ("Changed\n"); @@ -290,7 +310,8 @@ changed_cb (GtkComboBox *self, gpointer user_data) GtkTreeModel *model = gtk_combo_box_get_model (self); if (!gtk_combo_box_get_active_iter (self, &iter)) { - g_print ("not an iter!\n"); + /* the combo is being edited to a custom entry */ + set_status_editing (self, TRUE); return; } @@ -310,6 +331,12 @@ changed_cb (GtkComboBox *self, gpointer user_data) gtk_widget_grab_focus (entry); set_status_editing (self, TRUE); } + else + { + /* just in case we were setting a new status when + * things were changed */ + set_status_editing (self, FALSE); + } g_free (icon_name); } @@ -333,6 +360,12 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser) GtkWidget *entry = gtk_bin_get_child (GTK_BIN (chooser)); gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, FALSE); + g_signal_connect_object (entry, "icon-release", + G_CALLBACK (entry_icon_release_cb), chooser, + G_CONNECT_SWAPPED); + g_signal_connect_object (entry, "activate", + G_CALLBACK (entry_activate_cb), chooser, + G_CONNECT_SWAPPED); GtkCellRenderer *renderer; gtk_cell_layout_clear (GTK_CELL_LAYOUT (chooser)); |