[gtk/matthiasc/for-master: 2/7] columnview: Fix more issues with column resizing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 2/7] columnview: Fix more issues with column resizing
- Date: Mon, 19 Oct 2020 13:48:34 +0000 (UTC)
commit 39baf4fff4c5b14dc1af94b721569bc90ee4ddfe
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 19 08:27:35 2020 -0400
columnview: Fix more issues with column resizing
Make it so that for overlapping resize rectangles (with
very narrow columns), we prefer the narrow column, so you
can regrow a column after shrinking it all the way.
Related: #3274
gtk/gtkcolumnview.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index f983f7c03b..66ff4c4d96 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -906,7 +906,7 @@ header_drag_begin (GtkGestureDrag *gesture,
self->drag_pos = -1;
n = g_list_model_get_n_items (G_LIST_MODEL (self->columns));
- for (i = 0; !self->in_column_resize && i < n; i++)
+ for (i = n - 1; !self->in_column_resize && i >= 0; i--)
{
GtkColumnViewColumn *column = g_list_model_get_item (G_LIST_MODEL (self->columns), i);
@@ -936,6 +936,17 @@ header_drag_begin (GtkGestureDrag *gesture,
g_object_unref (column);
break;
}
+ }
+
+ for (i = 0; !self->in_column_resize && i < n; i++)
+ {
+ GtkColumnViewColumn *column = g_list_model_get_item (G_LIST_MODEL (self->columns), i);
+
+ if (!gtk_column_view_column_get_visible (column))
+ {
+ g_object_unref (column);
+ continue;
+ }
if (gtk_column_view_get_reorderable (self) &&
gtk_column_view_in_header (self, column, start_x, start_y))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]