[gtk/matthiasc/for-master] columview: Don't overdraw
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] columview: Don't overdraw
- Date: Thu, 24 Sep 2020 18:31:49 +0000 (UTC)
commit e70ed905d19acba7f93ffb9586d8166b4dc15984
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Sep 24 14:30:40 2020 -0400
columview: Don't overdraw
Just always tell the title and cell widgets to
clip their children to the right size. Otherwise
we risk things getting out of sync and unintended
overdraw.
Fixes: #3179
gtk/gtkcolumnviewcell.c | 1 +
gtk/gtkcolumnviewcolumn.c | 18 ------------------
gtk/gtkcolumnviewtitle.c | 2 ++
3 files changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkcolumnviewcell.c b/gtk/gtkcolumnviewcell.c
index 0881a6ccd3..0b94fe7bcd 100644
--- a/gtk/gtkcolumnviewcell.c
+++ b/gtk/gtkcolumnviewcell.c
@@ -221,6 +221,7 @@ gtk_column_view_cell_init (GtkColumnViewCell *self)
GtkWidget *widget = GTK_WIDGET (self);
gtk_widget_set_focusable (widget, FALSE);
+ gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
/* FIXME: Figure out if setting the manager class to INVALID should work */
gtk_widget_set_layout_manager (widget, NULL);
widget->priv->resize_func = gtk_column_view_cell_resize_func;
diff --git a/gtk/gtkcolumnviewcolumn.c b/gtk/gtkcolumnviewcolumn.c
index 4c738fd6fc..c1e7c18317 100644
--- a/gtk/gtkcolumnviewcolumn.c
+++ b/gtk/gtkcolumnviewcolumn.c
@@ -994,8 +994,6 @@ void
gtk_column_view_column_set_fixed_width (GtkColumnViewColumn *self,
int fixed_width)
{
- GtkOverflow overflow;
-
g_return_if_fail (GTK_IS_COLUMN_VIEW_COLUMN (self));
g_return_if_fail (fixed_width >= -1);
@@ -1004,22 +1002,6 @@ gtk_column_view_column_set_fixed_width (GtkColumnViewColumn *self,
self->fixed_width = fixed_width;
- if (fixed_width > -1)
- overflow = GTK_OVERFLOW_HIDDEN;
- else
- overflow = GTK_OVERFLOW_VISIBLE;
-
- if (self->header &&
- overflow != gtk_widget_get_overflow (GTK_WIDGET (self->header)))
- {
- GtkColumnViewCell *cell;
-
- gtk_widget_set_overflow (GTK_WIDGET (self->header), overflow);
-
- for (cell = self->first_cell; cell; cell = gtk_column_view_cell_get_next (cell))
- gtk_widget_set_overflow (GTK_WIDGET (cell), overflow);
- }
-
gtk_column_view_column_queue_resize (self);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FIXED_WIDTH]);
diff --git a/gtk/gtkcolumnviewtitle.c b/gtk/gtkcolumnviewtitle.c
index bc06da1670..9291bd01b6 100644
--- a/gtk/gtkcolumnviewtitle.c
+++ b/gtk/gtkcolumnviewtitle.c
@@ -256,6 +256,8 @@ gtk_column_view_title_init (GtkColumnViewTitle *self)
widget->priv->resize_func = gtk_column_view_title_resize_func;
+ gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
+
self->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_parent (self->box, widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]