Without setting "detail-width-chars" and "detail-height-rows"

properties not only the widget has to be redrawn on certain
conditions, but also its size must be recalculated. (#339540)

* gtk/gtkcalendar.c: Add calendar_queue_refresh and call
that function instead of gtk_widget_queue_draw.

svn path=/trunk/; revision=19262
This commit is contained in:
Mathias Hasselmann 2007-12-28 09:26:38 +00:00
parent d1e8ca6c4a
commit f35439bfac
2 changed files with 31 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2007-12-28 Mathias Hasselmann <mathias@openismus.com>
Without setting "detail-width-chars" and "detail-height-rows"
properties not only the widget has to be redrawn on certain
conditions, but also its size must be recalculated. (#339540)
* gtk/gtkcalendar.c: Add calendar_queue_refresh and call
that function instead of gtk_widget_queue_draw.
2007-12-28 Mathias Hasselmann <mathias@openismus.com>
Consider details for size-request and expose-event. (#339540)

View File

@ -772,6 +772,19 @@ gtk_calendar_init (GtkCalendar *calendar)
* Utility Functions *
****************************************/
static void
calendar_queue_refresh (GtkCalendar *calendar)
{
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
if (!priv->detail_func ||
priv->detail_width_chars ||
priv->detail_height_rows)
gtk_widget_queue_draw (GTK_WIDGET (calendar));
else
gtk_widget_queue_resize (GTK_WIDGET (calendar));
}
static void
calendar_set_month_next (GtkCalendar *calendar)
{
@ -809,7 +822,7 @@ calendar_set_month_next (GtkCalendar *calendar)
else
gtk_calendar_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
}
static void
@ -838,7 +851,7 @@ calendar_set_year_prev (GtkCalendar *calendar)
else
gtk_calendar_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
}
static void
@ -867,7 +880,7 @@ calendar_set_year_next (GtkCalendar *calendar)
else
gtk_calendar_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
}
static void
@ -1175,7 +1188,7 @@ calendar_set_month_prev (GtkCalendar *calendar)
gtk_calendar_select_day (calendar, calendar->selected_day);
}
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
}
@ -3172,10 +3185,10 @@ gtk_calendar_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
GtkCalendar *calendar = GTK_CALENDAR (widget);
gtk_widget_queue_draw (widget);
calendar_stop_spinning (GTK_CALENDAR (widget));
calendar_queue_refresh (calendar);
calendar_stop_spinning (calendar);
priv->in_drag = 0;
@ -3573,8 +3586,7 @@ gtk_calendar_select_month (GtkCalendar *calendar,
calendar->year = year;
calendar_compute_days (calendar);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
g_object_freeze_notify (G_OBJECT (calendar));
g_object_notify (G_OBJECT (calendar), "month");
@ -3648,8 +3660,7 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
}
calendar->num_marked_dates = 0;
gtk_widget_queue_draw (GTK_WIDGET (calendar));
calendar_queue_refresh (calendar);
}
/**