From 6cfb720ab72935fc7110a9955b6e5204788e5621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <mail@baedert.org> Date: Fri, 16 Mar 2018 17:58:14 +0100 Subject: [PATCH] Fix a few get_allocated_width/height usages --- gtk/gtkcoloreditor.c | 6 +++--- gtk/gtklabel.c | 2 +- gtk/gtklistbox.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcoloreditor.c b/gtk/gtkcoloreditor.c index 9bf2108efc..38251efc0c 100644 --- a/gtk/gtkcoloreditor.c +++ b/gtk/gtkcoloreditor.c @@ -269,7 +269,7 @@ get_child_position (GtkOverlay *overlay, if (gtk_widget_get_direction (GTK_WIDGET (overlay)) == GTK_TEXT_DIR_RTL) allocation->x = 0; else - allocation->x = gtk_widget_get_allocated_width (GTK_WIDGET (overlay)) - req.width; + allocation->x = gtk_widget_get_width (GTK_WIDGET (overlay)) - req.width; } else if (widget == editor->priv->h_popup) { @@ -300,8 +300,8 @@ get_child_position (GtkOverlay *overlay, else return FALSE; - allocation->x = CLAMP (allocation->x, 0, gtk_widget_get_allocated_width (GTK_WIDGET (overlay)) - req.width); - allocation->y = CLAMP (allocation->y, 0, gtk_widget_get_allocated_height (GTK_WIDGET (overlay)) - req.height); + allocation->x = CLAMP (allocation->x, 0, gtk_widget_get_width (GTK_WIDGET (overlay)) - req.width); + allocation->y = CLAMP (allocation->y, 0, gtk_widget_get_height (GTK_WIDGET (overlay)) - req.height); return TRUE; } diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 0695f7eff7..ba41f68f81 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -3243,7 +3243,7 @@ gtk_label_get_measuring_layout (GtkLabel * label, * because we don't need it to be properly setup at that point. * This way we can make use of caching upon the label's creation. */ - if (gtk_widget_get_allocated_width (GTK_WIDGET (label)) <= 1) + if (gtk_widget_get_width (GTK_WIDGET (label)) <= 1) { g_object_ref (priv->layout); pango_layout_set_width (priv->layout, width); diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 77dcaf9a56..f0778b9b72 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2810,7 +2810,7 @@ gtk_list_box_move_cursor (GtkListBox *box, if (priv->cursor_row != NULL) { start_y = ROW_PRIV (priv->cursor_row)->y; - height = gtk_widget_get_allocated_height (GTK_WIDGET (box)); + height = gtk_widget_get_height (GTK_WIDGET (box)); end_y = CLAMP (start_y + page_size * count, 0, height - 1); row = gtk_list_box_get_row_at_y (box, end_y);