aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard-view-widget.c
diff options
context:
space:
mode:
authorHao Sheng <hao.sheng@sun.com>2004-04-06 17:15:51 +0800
committerYuedong Du <york@src.gnome.org>2004-04-06 17:15:51 +0800
commit056b964b59c8150cdb532a29d12179f0ac1b09f8 (patch)
tree4138b8465d8f5930f5ecfadb36276a4a2a502d18 /addressbook/gui/widgets/e-minicard-view-widget.c
parentf24ee0c5c97a394027b636d639be56dec7a01fb6 (diff)
downloadgsoc2013-evolution-056b964b59c8150cdb532a29d12179f0ac1b09f8.tar.gz
gsoc2013-evolution-056b964b59c8150cdb532a29d12179f0ac1b09f8.tar.zst
gsoc2013-evolution-056b964b59c8150cdb532a29d12179f0ac1b09f8.zip
: implement keyboard navigation(TAB/shift+TAB) (activaite_editor) : add a
2004-04-06 Hao Sheng <hao.sheng@sun.com> * gui/widgets/e-minicard.c : (e_minicard_event) : implement keyboard navigation(TAB/shift+TAB) (activaite_editor) : add a new function to activiate contact editor for support "Enter" key * gui/widgets/e-minicard-view-widget.c : (e_minicard_view_widget_class_init) : set the default focus at initialization (e_minicard_view_widget_real_focus_in_event) : set the first item be focused as default Fixes #55056 svn path=/trunk/; revision=25332
Diffstat (limited to 'addressbook/gui/widgets/e-minicard-view-widget.c')
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
index ff1bdc1f06..1d7b9f55fc 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -39,6 +39,8 @@ static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocati
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;
/* The arguments we take */
@@ -158,6 +160,7 @@ 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;
@@ -166,6 +169,25 @@ e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass)
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);
+ int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0);
+
+ canvas->focused_item = reflow->items [unsorted];
+ }
+
+ return GTK_WIDGET_CLASS(parent_class)->focus_in_event (widget, event);
+ }
+
static void
e_minicard_view_widget_init (EMinicardViewWidget *view)
{