forked from AuroraMiddleware/gtk
Fix a few get_allocated_width/height usages
This commit is contained in:
parent
3e6fea0550
commit
6cfb720ab7
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user