[gtk+/kill-size-request] Removed size_request from GtkMenuBar
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/kill-size-request] Removed size_request from GtkMenuBar
- Date: Wed, 27 Oct 2010 05:39:42 +0000 (UTC)
commit 2dca7ad91d943b74d6790e8a65dc5a70453c7683
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Oct 27 14:30:07 2010 +0900
Removed size_request from GtkMenuBar
gtk/gtkmenubar.c | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 8dab56b..a28622a 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -68,6 +68,12 @@ static void gtk_menu_bar_get_property (GObject *object,
GParamSpec *pspec);
static void gtk_menu_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition);
+static void gtk_menu_bar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void gtk_menu_bar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
static void gtk_menu_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_menu_bar_draw (GtkWidget *widget,
@@ -98,7 +104,8 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
gobject_class->get_property = gtk_menu_bar_get_property;
gobject_class->set_property = gtk_menu_bar_set_property;
- widget_class->size_request = gtk_menu_bar_size_request;
+ widget_class->get_preferred_width = gtk_menu_bar_get_preferred_width;
+ widget_class->get_preferred_height = gtk_menu_bar_get_preferred_height;
widget_class->size_allocate = gtk_menu_bar_size_allocate;
widget_class->draw = gtk_menu_bar_draw;
widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed;
@@ -348,6 +355,30 @@ gtk_menu_bar_size_request (GtkWidget *widget,
}
static void
+gtk_menu_bar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_menu_bar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+gtk_menu_bar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_menu_bar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+
+static void
gtk_menu_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]