[gtk+/kill-size-request] Removing size_request from GtkToolPalette
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/kill-size-request] Removing size_request from GtkToolPalette
- Date: Wed, 27 Oct 2010 13:47:38 +0000 (UTC)
commit 7a85a31cc46401a1d96636053f145a07a6db7f64
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Oct 27 22:50:24 2010 +0900
Removing size_request from GtkToolPalette
Note GtkToolPalette is internally height-for-width, it needs to
be refactored to cooperate with GTK+'s height-for-width geometry
management properly.
gtk/gtktoolpalette.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index bc60c3d..1fb8aee 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -436,6 +436,31 @@ gtk_tool_palette_size_request (GtkWidget *widget,
}
static void
+gtk_tool_palette_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_tool_palette_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+gtk_tool_palette_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_tool_palette_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+
+
+static void
gtk_tool_palette_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
@@ -961,7 +986,8 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
oclass->dispose = gtk_tool_palette_dispose;
oclass->finalize = gtk_tool_palette_finalize;
- wclass->size_request = gtk_tool_palette_size_request;
+ wclass->get_preferred_width = gtk_tool_palette_get_preferred_width;
+ wclass->get_preferred_height= gtk_tool_palette_get_preferred_height;
wclass->size_allocate = gtk_tool_palette_size_allocate;
wclass->draw = gtk_tool_palette_draw;
wclass->realize = gtk_tool_palette_realize;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]