diff options
author | Federico Mena Quintero <federico@nuclecu.unam.mx> | 1998-04-21 10:17:33 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-21 10:17:33 +0800 |
commit | d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c (patch) | |
tree | c11f28610193adbbc33b9c03d5d7bedbd263266b | |
parent | 65dbe3a3855c8419715f5c9cb898c3326878e97b (diff) | |
download | gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar.gz gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar.bz2 gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar.lz gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar.xz gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.tar.zst gsoc2013-evolution-d57e1662cf2a2beb21d9413d6a4a2cef25d7c05c.zip |
Now any printable keystroke (not just Return) will activate the selected
1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gncal-full-day.c (gncal_full_day_key_press): Now any printable
keystroke (not just Return) will activate the selected range.
svn path=/trunk/; revision=172
-rw-r--r-- | calendar/ChangeLog | 3 | ||||
-rw-r--r-- | calendar/gncal-full-day.c | 27 | ||||
-rw-r--r-- | calendar/gui/gncal-full-day.c | 27 |
3 files changed, 53 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c2c1472a0d..db529603fe 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,8 @@ 1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx> + * gncal-full-day.c (gncal_full_day_key_press): Now any printable + keystroke (not just Return) will activate the selected range. + * gncal-full-day.c (paint_back): Made it use the new paint_row function instead of painting everything directly. We calculate areas in a smarter way so there is even less flicker than before, diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c index 8db460e689..a9265ae7c6 100644 --- a/calendar/gncal-full-day.c +++ b/calendar/gncal-full-day.c @@ -1031,7 +1031,7 @@ paint_row (GncalFullDay *fullday, int row, struct paint_info *p) text_gc = p->widget->style->fg_gc[GTK_STATE_SELECTED]; } else if ((row < begin_row) || (row >= end_row)) { left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; - right_gc = left_gc; + right_gc = p->widget->style->bg_gc[GTK_STATE_ACTIVE]; text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; } else { left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; @@ -1810,6 +1810,8 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event) { GncalFullDay *fullday; struct drag_info *di; + GList *children; + Child *child; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GNCAL_IS_FULL_DAY (widget), FALSE); @@ -1823,10 +1825,31 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; if (event->keyval == GDK_Return) { - gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals [RANGE_ACTIVATED]); + gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals[RANGE_ACTIVATED]); return TRUE; } + if (event->length > 0) { + /* This means some printable key was pressed */ + + 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. + */ + + 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); + return TRUE; + } + } + + } + return FALSE; } diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c index 8db460e689..a9265ae7c6 100644 --- a/calendar/gui/gncal-full-day.c +++ b/calendar/gui/gncal-full-day.c @@ -1031,7 +1031,7 @@ paint_row (GncalFullDay *fullday, int row, struct paint_info *p) text_gc = p->widget->style->fg_gc[GTK_STATE_SELECTED]; } else if ((row < begin_row) || (row >= end_row)) { left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; - right_gc = left_gc; + right_gc = p->widget->style->bg_gc[GTK_STATE_ACTIVE]; text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; } else { left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; @@ -1810,6 +1810,8 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event) { GncalFullDay *fullday; struct drag_info *di; + GList *children; + Child *child; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GNCAL_IS_FULL_DAY (widget), FALSE); @@ -1823,10 +1825,31 @@ gncal_full_day_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; if (event->keyval == GDK_Return) { - gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals [RANGE_ACTIVATED]); + gtk_signal_emit (GTK_OBJECT (fullday), fullday_signals[RANGE_ACTIVATED]); return TRUE; } + if (event->length > 0) { + /* This means some printable key was pressed */ + + 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. + */ + + 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); + return TRUE; + } + } + + } + return FALSE; } |