aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gncal-day-view.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-08 03:01:42 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-08 03:01:42 +0800
commitb5a61327da495147f0a45b4a9f6ee3a77687eeab (patch)
treec982108602c3bda5e204f1c4557a400cf96e00d0 /calendar/gui/gncal-day-view.c
parenteaba896a148c812a3744805bcfb56b09753bc896 (diff)
downloadgsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar.gz
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar.bz2
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar.lz
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar.xz
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.tar.zst
gsoc2013-evolution-b5a61327da495147f0a45b4a9f6ee3a77687eeab.zip
More work in progress, wheeeee - Federico
svn path=/trunk/; revision=109
Diffstat (limited to 'calendar/gui/gncal-day-view.c')
-rw-r--r--calendar/gui/gncal-day-view.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/calendar/gui/gncal-day-view.c b/calendar/gui/gncal-day-view.c
index 209b6be40a..951b0eb5ae 100644
--- a/calendar/gui/gncal-day-view.c
+++ b/calendar/gui/gncal-day-view.c
@@ -156,6 +156,7 @@ static void
gncal_day_view_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
GncalDayView *dview;
+ int str_width, width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GNCAL_IS_DAY_VIEW (widget));
@@ -165,7 +166,11 @@ gncal_day_view_size_request (GtkWidget *widget, GtkRequisition *requisition)
/* border and min width */
- requisition->width = 2 * (widget->style->klass->xthickness + TEXT_BORDER) + MIN_INFO_WIDTH;
+ str_width = gdk_string_width (widget->style->font, dview->day_str);
+
+ width = MAX (MIN_INFO_WIDTH, str_width);
+
+ requisition->width = 2 * (widget->style->klass->xthickness + TEXT_BORDER) + width;
requisition->height = 2 * (widget->style->klass->ythickness + TEXT_BORDER);
/* division line */
@@ -297,8 +302,6 @@ gncal_day_view_update (GncalDayView *dview)
strftime (buf, sizeof (buf)-1, "%A %d", &tm);
dview->day_str = g_strdup (buf);
- gtk_widget_draw (GTK_WIDGET (dview), NULL);
-
if (dview->events)
g_list_free (dview->events);
@@ -306,6 +309,8 @@ gncal_day_view_update (GncalDayView *dview)
dview->lower,
dview->upper,
calendar_compare_by_dtstart);
+
+ gtk_widget_draw (GTK_WIDGET (dview), NULL);
}
void