[gtk/wip/otte/lottie: 7/86] listview: Use the correct scroll policy
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/lottie: 7/86] listview: Use the correct scroll policy
- Date: Thu, 24 Dec 2020 05:39:18 +0000 (UTC)
commit 71e616d17e4d265bba66cbe7dd818195c6934117
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 24 14:19:06 2020 +0100
listview: Use the correct scroll policy
Use the horizontal policy for horizontal decisions, not the vertical
one.
This broke in 0011ce949c3580e02c4b2c3d83584a6c6e82090c.
gtk/gtklistview.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c
index 6d1eb3413b..7a3fe101b3 100644
--- a/gtk/gtklistview.c
+++ b/gtk/gtklistview.c
@@ -587,11 +587,12 @@ gtk_list_view_size_allocate (GtkWidget *widget,
int min, nat, row_height;
int x, y;
GtkOrientation orientation, opposite_orientation;
- GtkScrollablePolicy scroll_policy;
+ GtkScrollablePolicy scroll_policy, opposite_scroll_policy;
orientation = gtk_list_base_get_orientation (GTK_LIST_BASE (self));
opposite_orientation = OPPOSITE_ORIENTATION (orientation);
scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), orientation);
+ opposite_scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), opposite_orientation);
/* step 0: exit early if list is empty */
if (gtk_list_item_manager_get_root (self->item_manager) == NULL)
@@ -602,7 +603,7 @@ gtk_list_view_size_allocate (GtkWidget *widget,
-1,
&min, &nat, NULL, NULL);
self->list_width = orientation == GTK_ORIENTATION_VERTICAL ? width : height;
- if (scroll_policy == GTK_SCROLL_MINIMUM)
+ if (opposite_scroll_policy == GTK_SCROLL_MINIMUM)
self->list_width = MAX (min, self->list_width);
else
self->list_width = MAX (nat, self->list_width);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]