aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-day-panel.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-04-23 08:26:37 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-23 08:26:37 +0800
commit017a40b429a28c7b69abee005262794dde049e15 (patch)
tree5965707d649d9577ccb1d3b32b49c3923ccee9c8 /calendar/gncal-day-panel.c
parentcfa6fa95d6f841f23469cca197757bea2e983cf4 (diff)
downloadgsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.tar.gz
gsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.tar.zst
gsoc2013-evolution-017a40b429a28c7b69abee005262794dde049e15.zip
Made it use popup_menu().
1998-04-22 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-full-day.c: Made it use popup_menu(). * popup-menu.c: New file with utility functions for creating popup menus. Maybe such a thing would be useful in libgnomeui, a la gnome-app-helper? * Makefile.am (gnomecal_SOURCES): Added popup-menu.[ch] to the sources. 1998-04-21 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-todo.c: New widget for editing TODO lists. This will be worked on a lot. * Makefile.am (gnomecal_SOURCES): Added gncal-todo.[ch] to the sources. * gncal-day-panel.c: Make it use the new TODO widget. svn path=/trunk/; revision=189
Diffstat (limited to 'calendar/gncal-day-panel.c')
-rw-r--r--calendar/gncal-day-panel.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/calendar/gncal-day-panel.c b/calendar/gncal-day-panel.c
index 3cf2f57b24..26347428a6 100644
--- a/calendar/gncal-day-panel.c
+++ b/calendar/gncal-day-panel.c
@@ -47,13 +47,16 @@ day_view_range_activated (GncalFullDay *fullday, GncalDayPanel *dpanel)
}
static void
-full_day_mapped (GtkWidget *widget, GncalDayPanel *dpanel)
+full_day_size_allocated (GtkWidget *widget, GtkAllocation *allocation, GncalDayPanel *dpanel)
{
GtkAdjustment *adj;
+ int yoffset;
adj = gtk_scrolled_window_get_vadjustment (dpanel->fullday_sw);
- adj->value = gncal_full_day_get_day_start_yoffset (GNCAL_FULL_DAY (widget));
+ yoffset = gncal_full_day_get_day_start_yoffset (GNCAL_FULL_DAY (widget));
+
+ adj->value = adj->lower + (adj->upper - adj->lower) * (double) yoffset / allocation->height;
gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed");
}
@@ -110,7 +113,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 1, 3,
+ 0, 1, 1, 4,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
@@ -124,10 +127,10 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
gtk_container_add (GTK_CONTAINER (dpanel->fullday_sw), w);
gtk_widget_show (w);
- /* When the full day widget gets mapped, we'll scroll the list to the proper initial position */
+ /* We'll scroll the list to the proper initial position */
- gtk_signal_connect (GTK_OBJECT (dpanel->fullday), "map",
- (GtkSignalFunc) full_day_mapped,
+ gtk_signal_connect (GTK_OBJECT (dpanel->fullday), "size_allocate",
+ (GtkSignalFunc) full_day_size_allocated,
dpanel);
/* Gtk calendar */
@@ -146,13 +149,23 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
0, 0);
gtk_widget_show (w);
- /* To-do */
+ /* Separator */
- w = gtk_button_new_with_label ("TODO");
- dpanel->todo_list = w;
+ w = gtk_hseparator_new ();
gtk_table_attach (GTK_TABLE (dpanel), w,
1, 2, 2, 3,
GTK_FILL | GTK_SHRINK,
+ GTK_FILL | GTK_SHRINK,
+ 0, 0);
+ gtk_widget_show (w);
+
+ /* To-do */
+
+ w = gncal_todo_new (calendar);
+ dpanel->todo = GNCAL_TODO (w);
+ gtk_table_attach (GTK_TABLE (dpanel), w,
+ 1, 2, 3, 4,
+ GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
gtk_widget_show (w);
@@ -164,13 +177,22 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
return GTK_WIDGET (dpanel);
}
+static void
+update (GncalDayPanel *dpanel, int update_fullday, iCalObject *ico, int flags)
+{
+ if (update_fullday)
+ gncal_full_day_update (dpanel->fullday, ico, flags);
+
+ gncal_todo_update (dpanel->todo, ico, flags);
+}
+
void
gncal_day_panel_update (GncalDayPanel *dpanel, iCalObject *ico, int flags)
{
g_return_if_fail (dpanel != NULL);
g_return_if_fail (GNCAL_IS_DAY_PANEL (dpanel));
- gncal_full_day_update (dpanel->fullday, ico, flags);
+ update (dpanel, TRUE, ico, flags);
}
void
@@ -195,4 +217,6 @@ gncal_day_panel_set (GncalDayPanel *dpanel, time_t start_of_day)
gtk_signal_handler_block (GTK_OBJECT (dpanel->gtk_calendar), dpanel->day_selected_id);
gtk_calendar_select_day (dpanel->gtk_calendar, tm->tm_mday);
gtk_signal_handler_unblock (GTK_OBJECT (dpanel->gtk_calendar), dpanel->day_selected_id);
+
+ update (dpanel, FALSE, NULL, 0);
}