[gtk+] treeview: Don't make things way too high
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] treeview: Don't make things way too high
- Date: Thu, 25 Feb 2016 03:04:53 +0000 (UTC)
commit 760b540c8cb0bf0201eac3b59a698972d26ec59b
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 25 04:02:39 2016 +0100
treeview: Don't make things way too high
If the size-request is larger than the dedicated size, don't increase
the dedicated size by the size request, only increase it to the
size request.
gtk/gtktreeview.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 47ea9f7..e46737d 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2991,8 +2991,8 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
gtk_widget_get_preferred_width (GTK_WIDGET (child->widget), &size, NULL);
if (size > child_rect.width)
{
- child_rect.x -= size / 2;
- child_rect.width += size;
+ child_rect.x -= (size - child_rect.width) / 2;
+ child_rect.width = size;
}
gtk_widget_get_preferred_height_for_width (GTK_WIDGET (child->widget),
@@ -3000,8 +3000,8 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
&size, NULL);
if (size > child_rect.height)
{
- child_rect.y -= size / 2;
- child_rect.height += size;
+ child_rect.y -= (size - child_rect.height) / 2;
+ child_rect.height = size;
}
/* push the rect back in the visible area if needed, preferring the top left corner */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]