evolution r35654 - in trunk: filter mail
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r35654 - in trunk: filter mail
- Date: Thu, 19 Jun 2008 16:38:18 +0000 (UTC)
Author: mcrha
Date: Thu Jun 19 16:38:18 2008
New Revision: 35654
URL: http://svn.gnome.org/viewvc/evolution?rev=35654&view=rev
Log:
2008-06-19 Milan Crha <mcrha redhat com>
** Fix for bug #382783
* filter/filter-rule.c: (do_grab_focus_cb), (more_parts), (get_widget):
* mail/em-filter-rule.c: (do_grab_focus_cb), (more_parts), (get_widget):
Grab focus of new rule part on adding and scroll to the bottom too.
Modified:
trunk/filter/ChangeLog
trunk/filter/filter-rule.c
trunk/mail/ChangeLog
trunk/mail/em-filter-rule.c
Modified: trunk/filter/filter-rule.c
==============================================================================
--- trunk/filter/filter-rule.c (original)
+++ trunk/filter/filter-rule.c Thu Jun 19 16:38:18 2008
@@ -744,6 +744,20 @@
}
static void
+do_grab_focus_cb (GtkWidget *widget, gpointer data)
+{
+ gboolean *done = (gboolean *) data;
+
+ if (*done)
+ return;
+
+ if (widget && GTK_WIDGET_CAN_FOCUS (widget)) {
+ *done = TRUE;
+ gtk_widget_grab_focus (widget);
+ }
+}
+
+static void
more_parts (GtkWidget *button, struct _rule_data *data)
{
FilterPart *new;
@@ -772,6 +786,24 @@
rows = GTK_TABLE (data->parts)->nrows;
gtk_table_resize (GTK_TABLE (data->parts), rows + 1, 2);
attach_rule (w, data, new, rows);
+
+ if (GTK_IS_CONTAINER (w)) {
+ gboolean done = FALSE;
+
+ gtk_container_foreach (GTK_CONTAINER (w), do_grab_focus_cb, &done);
+ } else
+ gtk_widget_grab_focus (w);
+
+ /* also scroll down to see new part */
+ w = (GtkWidget*) g_object_get_data (G_OBJECT (button), "scrolled-window");
+ if (w) {
+ GtkAdjustment *adjustment;
+
+ adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (w));
+ if (adjustment)
+ gtk_adjustment_set_value (adjustment, adjustment->upper);
+
+ }
}
}
@@ -952,6 +984,8 @@
gtk_widget_show_all (vbox);
+ g_object_set_data (G_OBJECT (add), "scrolled-window", scrolledwindow);
+
return vbox;
}
Modified: trunk/mail/em-filter-rule.c
==============================================================================
--- trunk/mail/em-filter-rule.c (original)
+++ trunk/mail/em-filter-rule.c Thu Jun 19 16:38:18 2008
@@ -449,6 +449,20 @@
}
static void
+do_grab_focus_cb (GtkWidget *widget, gpointer data)
+{
+ gboolean *done = (gboolean *) data;
+
+ if (*done)
+ return;
+
+ if (widget && GTK_WIDGET_CAN_FOCUS (widget)) {
+ *done = TRUE;
+ gtk_widget_grab_focus (widget);
+ }
+}
+
+static void
more_parts(GtkWidget *button, struct _rule_data *data)
{
FilterPart *new;
@@ -466,6 +480,24 @@
rows = GTK_TABLE(data->parts)->nrows;
gtk_table_resize(GTK_TABLE(data->parts), rows + 1, 2);
attach_rule(w, data, new, rows);
+
+ if (GTK_IS_CONTAINER (w)) {
+ gboolean done = FALSE;
+
+ gtk_container_foreach (GTK_CONTAINER (w), do_grab_focus_cb, &done);
+ } else
+ gtk_widget_grab_focus (w);
+
+ /* also scroll down to see new part */
+ w = (GtkWidget*) g_object_get_data (G_OBJECT (button), "scrolled-window");
+ if (w) {
+ GtkAdjustment *adjustment;
+
+ adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (w));
+ if (adjustment)
+ gtk_adjustment_set_value (adjustment, adjustment->upper);
+
+ }
}
}
@@ -543,6 +575,8 @@
/*gtk_box_pack_start(GTK_BOX(inframe), parts, FALSE, FALSE, 3);*/
+ g_object_set_data (G_OBJECT (add), "scrolled-window", scrolledwindow);
+
gtk_widget_show_all(widget);
return widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]