Fix a few get_allocated_width/height usages
authorTimm Bäder <mail@baedert.org>
Fri, 16 Mar 2018 16:58:14 +0000 (17:58 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 11:09:30 +0000 (12:09 +0100)
gtk/gtkcoloreditor.c
gtk/gtklabel.c
gtk/gtklistbox.c

index 9bf2108efc5abb47313f1deffd813d6393ba8d94..38251efc0c3390d69b164cc5fb313850738382b3 100644 (file)
@@ -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;
 }
index 0695f7eff7c21bbea5329d7d8c9d6069936fb836..ba41f68f8103ffff57afa5bcd8d34aedd605a8b6 100644 (file)
@@ -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);
index 77dcaf9a56ec2449f173e98ff8d93b1c9f574628..f0778b9b72e38e81ee94c25e6cb87d2da571f4d0 100644 (file)
@@ -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);