[gtk+/kill-size-request: 3/5] Remove size_request from GtkCalendar
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/kill-size-request: 3/5] Remove size_request from GtkCalendar
- Date: Wed, 27 Oct 2010 01:43:34 +0000 (UTC)
commit f85543af98632eca81125983580e4c79ac29734d
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 26 21:06:40 2010 -0400
Remove size_request from GtkCalendar
gtk/gtkcalendar.c | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index ec059ab..57a26d6 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -341,8 +341,12 @@ static void gtk_calendar_get_property (GObject *object,
static void gtk_calendar_realize (GtkWidget *widget);
static void gtk_calendar_unrealize (GtkWidget *widget);
-static void gtk_calendar_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void gtk_calendar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void gtk_calendar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
static void gtk_calendar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_calendar_draw (GtkWidget *widget,
@@ -438,7 +442,8 @@ gtk_calendar_class_init (GtkCalendarClass *class)
widget_class->realize = gtk_calendar_realize;
widget_class->unrealize = gtk_calendar_unrealize;
widget_class->draw = gtk_calendar_draw;
- widget_class->size_request = gtk_calendar_size_request;
+ widget_class->get_preferred_width = gtk_calendar_get_preferred_width;
+ widget_class->get_preferred_height = gtk_calendar_get_preferred_height;
widget_class->size_allocate = gtk_calendar_size_allocate;
widget_class->button_press_event = gtk_calendar_button_press;
widget_class->button_release_event = gtk_calendar_button_release;
@@ -2030,6 +2035,30 @@ gtk_calendar_size_request (GtkWidget *widget,
}
static void
+gtk_calendar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_calendar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+gtk_calendar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_calendar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+
+static void
gtk_calendar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]