aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Fang <gilbert.fang@sun.com>2003-06-26 01:11:47 +0800
committerChris Toshok <toshok@src.gnome.org>2003-06-26 01:11:47 +0800
commitb562aa8d232fbd460901ed9da46b0f34e73b6d18 (patch)
tree5aac6130dcd3badf8050c39ba8b730bd6a5a259f
parentb5c224b87d5e426737e3cf964bb723c6b41253bb (diff)
downloadgsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar.gz
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar.bz2
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar.lz
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar.xz
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.tar.zst
gsoc2013-evolution-b562aa8d232fbd460901ed9da46b0f34e73b6d18.zip
new function, override the event handler for focus_in_event, set the first
2003-06-25 Gilbert Fang <gilbert.fang@sun.com> * gui/widgets/e-minicard-view-widget.c (e_minicard_view_widget_real_focus_in_event): new function, override the event handler for focus_in_event, set the first item be focused if no focused item at all. Fixes bug 41826. svn path=/trunk/; revision=21547
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c25
2 files changed, 32 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 58f834dbb4..801f39ac6c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2003-06-25 Gilbert Fang <gilbert.fang@sun.com>
+
+ * gui/widgets/e-minicard-view-widget.c
+ (e_minicard_view_widget_real_focus_in_event): new function,
+ override the event handler for focus_in_event, set the first item
+ be focused if no focused item at all. Fixes bug 41826.
+
2003-06-18 Chris Toshok <toshok@ximian.com>
* gui/contact-editor/e-contact-editor.c (fill_in_field): in the
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
index b4681e1b4b..c90a581975 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -38,6 +38,7 @@ static void e_minicard_view_widget_reflow (ECanvas *canvas);
static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style);
static void e_minicard_view_widget_realize (GtkWidget *widget);
+static gboolean e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event);
static ECanvasClass *parent_class = NULL;
@@ -158,12 +159,36 @@ e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass)
widget_class->style_set = e_minicard_view_widget_style_set;
widget_class->realize = e_minicard_view_widget_realize;
widget_class->size_allocate = e_minicard_view_widget_size_allocate;
+ widget_class->focus_in_event = e_minicard_view_widget_real_focus_in_event;
canvas_class->reflow = e_minicard_view_widget_reflow;
klass->selection_change = NULL;
klass->column_width_changed = NULL;
klass->right_click = NULL;
+
+}
+
+static gboolean
+e_minicard_view_widget_real_focus_in_event(GtkWidget *widget, GdkEventFocus *event)
+{
+ GnomeCanvas *canvas;
+ EMinicardViewWidget *view;
+
+ canvas = GNOME_CANVAS (widget);
+ view = E_MINICARD_VIEW_WIDGET(widget);
+
+ if (!canvas->focused_item) {
+ EReflow *reflow = E_REFLOW (view->emv);
+ if (reflow->count) {
+ int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0);
+
+ if (unsorted != -1)
+ canvas->focused_item = reflow->items [unsorted];
+ }
+ }
+
+ return GTK_WIDGET_CLASS(parent_class)->focus_in_event (widget, event);
}
static void