aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/goto.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-09-04 08:43:06 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-09-04 08:43:06 +0800
commit84fa00e42a593a4e4e64866090df30c9d7c066b9 (patch)
tree2c5c5f1566aad424cdc537f55cf08d8c7e3bea1d /calendar/goto.c
parentde704a7b4576df4f84ed859c7d3337cce0f89e57 (diff)
downloadgsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar.gz
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar.bz2
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar.lz
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar.xz
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.tar.zst
gsoc2013-evolution-84fa00e42a593a4e4e64866090df30c9d7c066b9.zip
Finished with the properties dialog. You can jump to days from the year
Finished with the properties dialog. You can jump to days from the year view now. I'm off to rewrite gnome-popupmenu and friends. 1998-09-03 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-full-day.c (gncal_full_day_forall): Updated foreach -> forall from Gtk changes, bleah. * year-view.c (day_event): New function to handle events from days. Jumps to the day that is clicked. * main.c: Use a watch cursor while the previous/today/next functions are doing their job. * mark.c (month_item_prepare_prelight): New public utility function to prepare a month item for prelighting. It will store the proper prelight information and attach the appropriate signals. (mark_current_day): Make the current day bold as well (useful for color-blind people, I guess). * prop.c (set_current_day): Reset the date in the sample calendar and mark the current day. (fake_mark_days): Mark fake events in the sample calendar. * year-view.c (year_view_set): Use the general prelighting engine. * goto.c (day_event): Just process button presses, as prelighting is done behind the scenes now. (update): Use the general prelighting engine. * prop.c (create_colors_page): We can now configure the colors of svn path=/trunk/; revision=361
Diffstat (limited to 'calendar/goto.c')
-rw-r--r--calendar/goto.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/calendar/goto.c b/calendar/goto.c
index 16fada2f5b..7a4068fb85 100644
--- a/calendar/goto.c
+++ b/calendar/goto.c
@@ -17,7 +17,6 @@
static GtkWidget *goto_win; /* The goto dialog window */
static GnomeCanvasItem *month_item; /* The month item in the dialog */
static GnomeCalendar *gnome_calendar; /* The gnome calendar the dialog refers to */
-static gulong day_pixels[42]; /* Colors of the day backgrounds */
/* Updates the specified month item by marking it appropriately from the calendar the dialog refers
@@ -25,29 +24,9 @@ static gulong day_pixels[42]; /* Colors of the day backgrounds */
static void
update (void)
{
- int i;
- GnomeCanvasItem *item;
- GtkArg arg;
- GdkColor *c;
-
- /* First, mark the days */
-
unmark_month_item (GNOME_MONTH_ITEM (month_item));
mark_month_item (GNOME_MONTH_ITEM (month_item), gnome_calendar->cal);
-
- /* Now save the colors of the day backgrounds */
-
- for (i = 0; i < 42; i++) {
- arg.name = "fill_color_gdk";
-
- item = gnome_month_item_num2child (GNOME_MONTH_ITEM (month_item),
- GNOME_MONTH_ITEM_DAY_BOX + i);
- gtk_object_getv (GTK_OBJECT (item), 1, &arg);
-
- c = GTK_VALUE_BOXED (arg);
- day_pixels[i] = c->pixel;
- g_free (c);
- }
+ month_item_prepare_prelight (GNOME_MONTH_ITEM (month_item), default_prelight_func, NULL);
}
/* Callback used when the year adjustment is changed */
@@ -163,24 +142,16 @@ set_scroll_region (GtkWidget *widget, GtkAllocation *allocation)
}
/* Event handler for day groups in the month item. A button press makes the calendar jump to the
- * selected day and destroys the Go-to dialog box. Days are prelighted as appropriate on
- * enter_notify and leave_notify events.
+ * selected day and destroys the Go-to dialog box.
*/
static gint
day_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
{
- GnomeCanvasItem *box;
int child_num, day;
- GdkColor color;
child_num = gnome_month_item_child2num (GNOME_MONTH_ITEM (month_item), item);
day = gnome_month_item_num2day (GNOME_MONTH_ITEM (month_item), child_num);
- child_num -= GNOME_MONTH_ITEM_DAY_GROUP;
-
- if (day == 0)
- return FALSE;
-
switch (event->type) {
case GDK_BUTTON_PRESS:
if ((event->button.button == 1) && (day != 0)) {
@@ -191,23 +162,6 @@ day_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
}
break;
- case GDK_ENTER_NOTIFY:
- box = gnome_month_item_num2child (GNOME_MONTH_ITEM (month_item),
- child_num + GNOME_MONTH_ITEM_DAY_BOX);
- gnome_canvas_item_set (box,
- "fill_color", color_spec_from_prop (COLOR_PROP_PRELIGHT_DAY_BG),
- NULL);
- break;
-
- case GDK_LEAVE_NOTIFY:
- box = gnome_month_item_num2child (GNOME_MONTH_ITEM (month_item),
- child_num + GNOME_MONTH_ITEM_DAY_BOX);
- color.pixel = day_pixels[child_num];
- gnome_canvas_item_set (box,
- "fill_color_gdk", &color,
- NULL);
- break;
-
default:
break;
}