aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/year-view.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1999-05-26 03:28:28 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-05-26 03:28:28 +0800
commitede0790b5c953edf0a14dae1f75fa449d5c3286a (patch)
treec5ef3edf8a66a07a441bd7888fc4e955a8464c67 /calendar/gui/year-view.c
parentc150a409d44428073347bf5da033d0290cda4d4d (diff)
downloadgsoc2013-evolution-ede0790b5c953edf0a14dae1f75fa449d5c3286a.tar.gz
gsoc2013-evolution-ede0790b5c953edf0a14dae1f75fa449d5c3286a.tar.zst
gsoc2013-evolution-ede0790b5c953edf0a14dae1f75fa449d5c3286a.zip
Set the canvas scroll region here, not in size_allocate(). Also, use the
1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx> * year-view.c (idle_handler): Set the canvas scroll region here, not in size_allocate(). Also, use the correct width and height based on the allocation and the precomputed minimum width/height values. * gnome-cal.c (setup_widgets): Set the scrollbar policy of the scrolled window. * main.c (setup_appbar): Use the correct type for the appbar. * gncal-day-view.c: Removed unused function switch_to_day(). * gncal-day-panel.c (calendar_day_selected): Removed unused variable. 1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx> * configure.in: Added the gncal/doc/* Makefiles to AC_OUTPUT. svn path=/trunk/; revision=939
Diffstat (limited to 'calendar/gui/year-view.c')
-rw-r--r--calendar/gui/year-view.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c
index ebfc6d2e44..ac4313e6ed 100644
--- a/calendar/gui/year-view.c
+++ b/calendar/gui/year-view.c
@@ -76,8 +76,8 @@ year_view_class_init (YearViewClass *class)
widget_class->size_allocate = year_view_size_allocate;
}
-/* Resizes the year view's child items. This is done in the idle loop for performance (we avoid
- * resizing on every size allocation).
+/* Resizes the year view's child items. This is done in the idle loop for
+ * performance (we avoid resizing on every size allocation).
*/
static gint
idle_handler (gpointer data)
@@ -96,6 +96,16 @@ idle_handler (gpointer data)
yv = data;
+ /* Compute the size we can use */
+
+ width = MAX (GTK_WIDGET (yv)->allocation.width, yv->min_width);
+ height = MAX (GTK_WIDGET (yv)->allocation.height, yv->min_height);
+
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (yv), 0, 0, width, height);
+
+ width--;
+ height--;
+
/* Get the heights of the heading and the titles */
arg.name = "text_height";
@@ -106,14 +116,10 @@ idle_handler (gpointer data)
gtk_object_getv (GTK_OBJECT (yv->titles[0]), 1, &arg);
title_height = GTK_VALUE_DOUBLE (arg);
- /* Space for the titles and months */
- width = GTK_WIDGET (yv)->allocation.width;
- height = CALENDAR_HEIGHT;
-
/* Offsets */
xofs = (width + SPACING) / 3.0;
- yofs = (height + SPACING) / 4.0;
+ yofs = (height - head_height + SPACING) / 4.0;
/* Month item vertical offset */
@@ -603,7 +609,6 @@ year_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
(* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (yv), 0, 0, allocation->width, CALENDAR_HEIGHT);
need_resize (yv);
}