[gnome-games] aisleriot: Use get_preferred_{width, height} instead of size_request
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] aisleriot: Use get_preferred_{width, height} instead of size_request
- Date: Sat, 30 Oct 2010 17:03:02 +0000 (UTC)
commit d683140d8c07ed7467e1624b4a434e45e4158af6
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 30 19:01:06 2010 +0200
aisleriot: Use get_preferred_{width,height} instead of size_request
aisleriot/board-noclutter.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/aisleriot/board-noclutter.c b/aisleriot/board-noclutter.c
index 2a91e59..7ce01fa 100644
--- a/aisleriot/board-noclutter.c
+++ b/aisleriot/board-noclutter.c
@@ -2764,6 +2764,26 @@ aisleriot_board_size_allocate (GtkWidget *widget,
}
}
+#if GTK_CHECK_VERSION (2, 91, 0)
+
+static void
+aisleriot_board_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ *minimum = *natural = BOARD_MIN_WIDTH;
+}
+
+static void
+aisleriot_board_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ *minimum = *natural = BOARD_MIN_HEIGHT;
+}
+
+#else
+
static void
aisleriot_board_size_request (GtkWidget *widget,
GtkRequisition *requisition)
@@ -2772,6 +2792,8 @@ aisleriot_board_size_request (GtkWidget *widget,
requisition->height = BOARD_MIN_HEIGHT;
}
+#endif /* GTK 3.0 */
+
#ifdef ENABLE_KEYNAV
static gboolean
@@ -4072,7 +4094,12 @@ aisleriot_board_class_init (AisleriotBoardClass *klass)
widget_class->realize = aisleriot_board_realize;
widget_class->unrealize = aisleriot_board_unrealize;
widget_class->size_allocate = aisleriot_board_size_allocate;
+#if GTK_CHECK_VERSION (2, 91, 0)
+ widget_class->get_preferred_width = aisleriot_board_get_preferred_width;
+ widget_class->get_preferred_height = aisleriot_board_get_preferred_height;
+#else
widget_class->size_request = aisleriot_board_size_request;
+#endif
#ifdef ENABLE_KEYNAV
widget_class->focus = aisleriot_board_focus;
#endif /* ENABLE_KEYNAV */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]