aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
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/gui
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/gui')
-rw-r--r--calendar/gui/gncal-full-day.c31
-rw-r--r--calendar/gui/gncal-full-day.h14
-rw-r--r--calendar/gui/gnome-cal.c1
3 files changed, 34 insertions, 12 deletions
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index a9265ae7c6..949d890e4c 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/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)
{
diff --git a/calendar/gui/gncal-full-day.h b/calendar/gui/gncal-full-day.h
index 97d4d9482d..0d50243dc2 100644
--- a/calendar/gui/gncal-full-day.h
+++ b/calendar/gui/gncal-full-day.h
@@ -49,20 +49,22 @@ struct _GncalFullDayClass {
};
-guint gncal_full_day_get_type (void);
-GtkWidget *gncal_full_day_new (GnomeCalendar *calendar, time_t lower, time_t upper);
+guint gncal_full_day_get_type (void);
+GtkWidget *gncal_full_day_new (GnomeCalendar *calendar, time_t lower, time_t upper);
-void gncal_full_day_update (GncalFullDay *fullday, iCalObject *ico, int flags);
-void gncal_full_day_set_bounds (GncalFullDay *fullday, time_t lower, time_t upper);
+void gncal_full_day_update (GncalFullDay *fullday, iCalObject *ico, int flags);
+void gncal_full_day_set_bounds (GncalFullDay *fullday, time_t lower, time_t upper);
/* Returns the selected range in lower and upper. If nothing is
* selected, return value is FALSE, otherwise it is TRUE.
* The lower and upper values are always set to proper values, regardless of
* the selection value
*/
-int gncal_full_day_selection_range (GncalFullDay *fullday, time_t *lower, time_t *upper);
+int gncal_full_day_selection_range (GncalFullDay *fullday, time_t *lower, time_t *upper);
-void gncal_full_day_focus_child (GncalFullDay *fullday, iCalObject *ico);
+void gncal_full_day_focus_child (GncalFullDay *fullday, iCalObject *ico);
+
+int gncal_full_day_get_day_start_yoffset (GncalFullDay *fullday);
END_GNOME_DECLS
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index a7b5402e0d..bc26be5c92 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -102,6 +102,7 @@ setup_day_view (GnomeCalendar *gcal, time_t now)
GTK_FILL | GTK_EXPAND | GTK_SHRINK,
0, 0);
gtk_container_add (GTK_CONTAINER (sw), gcal->day_view);
+
gtk_widget_show_all (GTK_WIDGET (t));
}