diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-03-05 17:49:49 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-03-25 18:42:07 +0900 |
commit | 887142f1f5d364765bc84a46ddb187be08261710 (patch) | |
tree | 25591d2b4c6df43b2d1b443c5a94340f1bd69567 /gtk/gtkgrid.c | |
parent | 59440927d001e4d6400548a9e7f02dd43be6a4d0 (diff) | |
download | gtk+-887142f1f5d364765bc84a46ddb187be08261710.tar.gz |
Added GTK_SIZE_REQUEST_CONSTANT_SIZE to GtkSizeRequestMode
The constant size request mode defines a request mode where
height-for-width geometry is unneeded, thus optimizing GTK+
by reducing the overall amount of requests that need to be
performed and cached while resizing an interface.
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index bd305f6d46..4719857944 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -458,17 +458,6 @@ gtk_grid_child_type (GtkContainer *container) return GTK_TYPE_WIDGET; } -static GtkSizeRequestMode -gtk_grid_get_request_mode (GtkWidget *widget) -{ - GtkGridPrivate *priv = GTK_GRID (widget)->priv; - - if (priv->orientation == GTK_ORIENTATION_VERTICAL) - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH; - else - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT; -} - /* Calculates the min and max numbers for both orientations. */ static void @@ -1104,8 +1093,7 @@ gtk_grid_get_preferred_width (GtkWidget *widget, { GtkGrid *grid = GTK_GRID (widget); - if (gtk_grid_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT) - + if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT) gtk_grid_get_size_for_size (grid, GTK_ORIENTATION_HORIZONTAL, 0, minimum, natural); else gtk_grid_get_size (grid, GTK_ORIENTATION_HORIZONTAL, minimum, natural); @@ -1118,7 +1106,7 @@ gtk_grid_get_preferred_height (GtkWidget *widget, { GtkGrid *grid = GTK_GRID (widget); - if (gtk_grid_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) + if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) gtk_grid_get_size_for_size (grid, GTK_ORIENTATION_VERTICAL, 0, minimum, natural); else gtk_grid_get_size (grid, GTK_ORIENTATION_VERTICAL, minimum, natural); @@ -1132,7 +1120,7 @@ gtk_grid_get_preferred_width_for_height (GtkWidget *widget, { GtkGrid *grid = GTK_GRID (widget); - if (gtk_grid_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT) + if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT) gtk_grid_get_size_for_size (grid, GTK_ORIENTATION_HORIZONTAL, height, minimum, natural); else gtk_grid_get_size (grid, GTK_ORIENTATION_HORIZONTAL, minimum, natural); @@ -1146,7 +1134,7 @@ gtk_grid_get_preferred_height_for_width (GtkWidget *widget, { GtkGrid *grid = GTK_GRID (widget); - if (gtk_grid_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) + if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) gtk_grid_get_size_for_size (grid, GTK_ORIENTATION_VERTICAL, width, minimum, natural); else gtk_grid_get_size (grid, GTK_ORIENTATION_VERTICAL, minimum, natural); @@ -1258,7 +1246,6 @@ gtk_grid_class_init (GtkGridClass *class) widget_class->size_allocate = gtk_grid_size_allocate; widget_class->get_preferred_width = gtk_grid_get_preferred_width; widget_class->get_preferred_height = gtk_grid_get_preferred_height; - widget_class->get_request_mode = gtk_grid_get_request_mode; widget_class->get_preferred_width_for_height = gtk_grid_get_preferred_width_for_height; widget_class->get_preferred_height_for_width = gtk_grid_get_preferred_height_for_width; |