[evolution-patches] [Memo] Fix for 328285



Hi

Worked on #328285.

Please review.

Thanks
Johnny
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2953
diff -u -p -r1.2953 ChangeLog
--- calendar/ChangeLog	23 Jan 2006 08:09:45 -0000	1.2953
+++ calendar/ChangeLog	23 Jan 2006 11:20:07 -0000
@@ -1,3 +1,12 @@
+2006-01-23  Johnny Jacob  <johnnyjacob gmail com>
+
+	Fixes #328285
+	* gui/dialogs/memo-page.c (widget_focus_out_cb), 
+	(widget_focus_out_cb) : Added. Handle focus in and out
+	events.
+	(init_widgets): Connect focus in and out signals for 
+	memo_content .
+
 2006-01-23  Pavithran <pavithran gmx de>
 
 	** Fixes bug #327713 , #327730
Index: calendar/gui/dialogs/memo-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/memo-page.c,v
retrieving revision 1.2
diff -u -p -r1.2 memo-page.c
--- calendar/gui/dialogs/memo-page.c	26 Nov 2005 02:31:52 -0000	1.2
+++ calendar/gui/dialogs/memo-page.c	23 Jan 2006 11:20:42 -0000
@@ -500,6 +500,30 @@ source_changed_cb (GtkWidget *widget, ES
 	}
 }
 
+/*sets the current focused widget */
+static gboolean
+widget_focus_in_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
+{
+	MemoPage *tpage;
+	tpage = MEMO_PAGE (data);
+
+	comp_editor_page_set_focused_widget (COMP_EDITOR_PAGE (tpage), widget);
+
+	return FALSE;
+}
+
+/*unset the current focused widget */
+static gboolean
+widget_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
+{
+	MemoPage *tpage;
+	tpage = MEMO_PAGE (data);
+
+	comp_editor_page_unset_focused_widget (COMP_EDITOR_PAGE (tpage), widget);
+
+	return FALSE;
+}
+
 /* Hooks the widget signals */
 static gboolean
 init_widgets (MemoPage *tpage)
@@ -513,6 +537,11 @@ init_widgets (MemoPage *tpage)
 	text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content));
 
 	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->memo_content), GTK_WRAP_WORD);
+
+	g_signal_connect(priv->memo_content, "focus-in-event",
+		G_CALLBACK (widget_focus_in_cb), tpage);
+	g_signal_connect(priv->memo_content, "focus-out-event",
+		G_CALLBACK (widget_focus_out_cb), tpage);
 
 	/* Categories button */
 	g_signal_connect((priv->categories_btn), "clicked",


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