[bijiben] Get note view focus
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] Get note view focus
- Date: Sat, 15 Feb 2014 21:20:45 +0000 (UTC)
commit d1e87dd5cdbc13b9ed8a4706984620d00784c194
Author: Pierre-Yves Luyten <py luyten fr>
Date: Fri Feb 14 22:09:30 2014 +0100
Get note view focus
src/bjb-note-view.c | 17 +++++++++++++----
src/bjb-note-view.h | 2 ++
src/bjb-window-base.c | 1 +
3 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/bjb-note-view.c b/src/bjb-note-view.c
index 954f6af..443f9c0 100644
--- a/src/bjb-note-view.c
+++ b/src/bjb-note-view.c
@@ -300,10 +300,10 @@ bjb_note_view_constructed (GObject *obj)
gtk_widget_set_hexpand (scroll, TRUE);
gtk_widget_set_vexpand (scroll, TRUE);
-
+
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
GTK_SHADOW_IN);
-
+
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
@@ -374,7 +374,7 @@ static void
bjb_note_view_class_init (BjbNoteViewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
object_class->finalize = bjb_note_view_finalize;
object_class->constructed = bjb_note_view_constructed;
object_class->get_property = bjb_note_view_get_property;
@@ -389,7 +389,7 @@ bjb_note_view_class_init (BjbNoteViewClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS);
-
+
g_object_class_install_property (object_class,PROP_WINDOW,properties[PROP_WINDOW]);
properties[PROP_PARENT] = g_param_spec_object ("parent",
@@ -418,3 +418,12 @@ bjb_note_view_get_base_window (BjbNoteView *v)
{
return v->priv->window;
}
+
+
+
+void
+bjb_note_view_grab_focus (BjbNoteView *view)
+{
+ gtk_widget_set_can_focus (view->priv->view, TRUE);
+ gtk_widget_grab_focus (view->priv->view);
+}
diff --git a/src/bjb-note-view.h b/src/bjb-note-view.h
index 8da95f6..8304cd0 100644
--- a/src/bjb-note-view.h
+++ b/src/bjb-note-view.h
@@ -59,6 +59,8 @@ BjbNoteView * bjb_note_view_new (GtkWidget *win, GtkWidget *parent, BijiNoteObj*
GtkWidget * bjb_note_view_get_base_window (BjbNoteView *v);
+void bjb_note_view_grab_focus (BjbNoteView *view);
+
G_END_DECLS
#endif /* _NOTE_VIEW_H */
diff --git a/src/bjb-window-base.c b/src/bjb-window-base.c
index 433a7da..afed953 100644
--- a/src/bjb-window-base.c
+++ b/src/bjb-window-base.c
@@ -552,6 +552,7 @@ bjb_window_base_switch_to_item (BjbWindowBase *bwb, BijiItem *item)
bjb_window_base_switch_to (bwb, BJB_WINDOW_BASE_NOTE_VIEW);
gtk_widget_show_all (w);
+ bjb_note_view_grab_focus (priv->note_view);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]