aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-full-day.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-21 11:11:42 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-21 11:11:42 +0800
commit5fda22d8393b161a6539b848bdd5d88db7e77bc5 (patch)
tree848f35fd3af743ae90cc708fdd4d907fc28c4bcd /calendar/gncal-full-day.c
parentd57e1662cf2a2beb21d9413d6a4a2cef25d7c05c (diff)
downloadgsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar.gz
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar.bz2
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar.lz
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar.xz
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.tar.zst
gsoc2013-evolution-5fda22d8393b161a6539b848bdd5d88db7e77bc5.zip
Make the any-key-creates-new-appointment-at-selection thing actually work - Federico
svn path=/trunk/; revision=173
Diffstat (limited to 'calendar/gncal-full-day.c')
-rw-r--r--calendar/gncal-full-day.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c
index a9265ae7c6..949d890e4c 100644
--- a/calendar/gncal-full-day.c
+++ b/calendar/gncal-full-day.c
@@ -1812,6 +1812,7 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event)
struct drag_info *di;
GList *children;
Child *child;
+ gint pos;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GNCAL_IS_FULL_DAY (widget), FALSE);
@@ -1834,20 +1835,22 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event)
gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals[RANGE_ACTIVATED]);
- /* This is sort of a hack. We find the focused child, if it exists, and
- * we re-send the keystroke to it.
- */
+ /* Find the new child, which should hopefully be focused, and insert the keypress */
for (children = fullday->children; children; children = children->next) {
child = children->data;
if (GTK_WIDGET_HAS_FOCUS (child->widget)) {
- event->window = GTK_TEXT (child->widget)->text_area;
- gtk_widget_event (widget, (GdkEvent *) event);
+ pos = gtk_text_get_length (GTK_TEXT (child->widget));
+
+ gtk_editable_insert_text (GTK_EDITABLE (child->widget),
+ event->string,
+ event->length,
+ &pos);
+
return TRUE;
}
}
-
}
return FALSE;
@@ -2072,6 +2075,22 @@ gncal_full_day_focus_child (GncalFullDay *fullday, iCalObject *ico)
}
}
+int
+gncal_full_day_get_day_start_yoffset (GncalFullDay *fullday)
+{
+ GtkWidget *widget;
+ int begin_row;
+
+ g_return_val_if_fail (fullday != NULL, 0);
+ g_return_val_if_fail (GNCAL_IS_FULL_DAY (fullday), 0);
+
+ widget = GTK_WIDGET (fullday);
+
+ begin_row = (day_begin * 60) / fullday->interval;
+
+ return widget->style->klass->ythickness + begin_row * calc_row_height (fullday);
+}
+
static void
range_activated (GncalFullDay *fullday)
{