aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorDavyd Madeley <davyd@madeley.id.au>2009-04-11 00:54:31 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-04-11 00:54:31 +0800
commit9be19b4a971ad556bed8615456bd81b596516dde (patch)
tree889a2722abea12f6b5d64e3101a1f9eca6f5c973 /libempathy-gtk
parentcaa724ffce993eb7910236d58eca04fdf9eeeadc (diff)
downloadgsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar.gz
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar.bz2
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar.lz
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar.xz
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.tar.zst
gsoc2013-empathy-9be19b4a971ad556bed8615456bd81b596516dde.zip
Editing mode on click
From: Davyd Madeley <davyd@madeley.id.au> svn path=/trunk/; revision=2791
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 1d84c52e0..74eefee2a 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -362,6 +362,25 @@ entry_key_press_event_cb (EmpathyPresenceChooser *self,
return FALSE; /* send this event elsewhere */
}
+static gboolean
+entry_button_press_event_cb (EmpathyPresenceChooser *self,
+ GdkEventButton *event,
+ GtkWidget *entry)
+{
+ EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
+
+ if (!priv->editing_status && event->button == 1)
+ {
+ set_status_editing (self, TRUE);
+ gtk_widget_grab_focus (entry);
+ gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
text_changed_cb (EmpathyPresenceChooser *self, gpointer user_data)
{
@@ -525,7 +544,9 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
g_signal_connect_object (entry, "key-press-event",
G_CALLBACK (entry_key_press_event_cb), chooser,
G_CONNECT_SWAPPED);
- // FIXME - should this also happen when the user presses TAB ?
+ g_signal_connect_object (entry, "button-press-event",
+ G_CALLBACK (entry_button_press_event_cb), chooser,
+ G_CONNECT_SWAPPED);
GtkCellRenderer *renderer;
gtk_cell_layout_clear (GTK_CELL_LAYOUT (chooser));