summaryrefslogtreecommitdiff
path: root/gtk/gtktreeviewcolumn.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-01 10:16:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-01 10:20:08 -0400
commita3cd0ee7d8a610feff39984254306cec4a6c9c73 (patch)
tree886b2b9958539737ef17e69925cd0759132edd63 /gtk/gtktreeviewcolumn.c
parent73ff6a8e0ff307b8d14986c64918022364ff10e7 (diff)
downloadgtk+-a3cd0ee7d8a610feff39984254306cec4a6c9c73.tar.gz
Revert "Use minimum/natural size semantics"
This reverts commit 6d53c2339f79baa0b295ecc614f41f9daab2e132. https://bugzilla.gnome.org/show_bug.cgi?id=731054 showed some major regressions caused by this commit.
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r--gtk/gtktreeviewcolumn.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 5001217fc0..487b44b849 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2094,48 +2094,48 @@ gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column)
return tree_column->priv->x_offset;
}
-void
-_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column,
- gint *minimum,
- gint *natural)
+gint
+_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column)
{
- GtkTreeViewColumnPrivate *priv = tree_column->priv;
- gint minimum_width = 1, natural_width = 1;
- gint button_minimum, button_natural;
+ GtkTreeViewColumnPrivate *priv;
+ gint real_requested_width;
- if (priv->column_type != GTK_TREE_VIEW_COLUMN_FIXED)
- {
- gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &minimum_width, &natural_width);
- minimum_width += priv->padding;
- natural_width += priv->padding;
+ priv = tree_column->priv;
- if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
- {
- gtk_widget_get_preferred_width (priv->button, &button_minimum, &button_natural);
- minimum_width = MAX (minimum_width, button_minimum);
- natural_width = MAX (natural_width, button_natural);
- }
+ if (priv->fixed_width != -1)
+ {
+ real_requested_width = priv->fixed_width;
}
+ else if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
+ {
+ gint button_request;
+ gint requested_width;
- if (priv->fixed_width != -1)
- natural_width = MAX (priv->fixed_width, minimum_width);
+ gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
+ requested_width += priv->padding;
- if (priv->min_width != -1)
+ gtk_widget_get_preferred_width (priv->button, &button_request, NULL);
+ real_requested_width = MAX (requested_width, button_request);
+ }
+ else
{
- minimum_width = MAX (minimum_width, priv->min_width);
- natural_width = MAX (natural_width, priv->min_width);
+ gint requested_width;
+
+ gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
+ requested_width += priv->padding;
+
+ real_requested_width = requested_width;
+ if (real_requested_width < 0)
+ real_requested_width = 0;
}
+ if (priv->min_width != -1)
+ real_requested_width = MAX (real_requested_width, priv->min_width);
+
if (priv->max_width != -1)
- {
- minimum_width = MIN (minimum_width, priv->max_width);
- natural_width = MIN (natural_width, priv->max_width);
- }
+ real_requested_width = MIN (real_requested_width, priv->max_width);
- if (minimum != NULL)
- *minimum = minimum_width;
- if (natural != NULL)
- *natural = natural_width;
+ return real_requested_width;
}
void