Re: [evolution-patches] EEntry patch to emulate GtkEntry behavior



god I hate this behaviour in gtk :\

Jeff

On Fri, 2003-05-02 at 13:43, Ettore Perazzoli wrote:
> This patch makes EEntry behave like GtkEntry when you tab in (i.e.
> select the text if the corresponding GtkSetting is set).
> 
> -- Ettore
> 
> ______________________________________________________________________
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/gal/ChangeLog,v
> retrieving revision 1.764
> diff -u -p -r1.764 ChangeLog
> --- ChangeLog	1 May 2003 18:21:33 -0000	1.764
> +++ ChangeLog	2 May 2003 17:41:20 -0000
> @@ -1,3 +1,9 @@
> +2003-05-02  Ettore Perazzoli  <ettore ximian com>
> +
> +	* gal/e-text/e-entry.c (canvas_focus_in_event): If the
> +	gtk-entry-select-on-focus GtkSetting is set, select all the text;
> +	this way we behave like GtkEntry.
> +
>  2003-05-01  Mike Kestner  <mkestner ximian com>
>  
>  	* gal/e-text/e-completion-callbacks.c (e_completion_callbacks_new): 
> Index: gal/e-text/e-entry.c
> ===================================================================
> RCS file: /cvs/gnome/gal/gal/e-text/e-entry.c,v
> retrieving revision 1.57
> diff -u -p -r1.57 e-entry.c
> --- gal/e-text/e-entry.c	3 Apr 2003 23:31:22 -0000	1.57
> +++ gal/e-text/e-entry.c	2 May 2003 17:41:20 -0000
> @@ -230,9 +230,19 @@ canvas_size_request (GtkWidget *widget, 
>  static gint
>  canvas_focus_in_event (GtkWidget *widget, GdkEventFocus *focus, EEntry *entry)
>  {
> +	gboolean select_on_focus;
> +
>  	if (entry->canvas->focused_item != GNOME_CANVAS_ITEM(entry->item))
>  		gnome_canvas_item_grab_focus(GNOME_CANVAS_ITEM(entry->item));
>  
> +	g_object_get (G_OBJECT (gtk_widget_get_settings (widget)),
> +		      "gtk-entry-select-on-focus",
> +		      &select_on_focus,
> +		      NULL);
> +
> +	if (select_on_focus)
> +		e_text_select_all (E_TEXT (entry->item));
> +	
>  	return FALSE;
>  }
>  
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com




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