forked from AuroraMiddleware/gtk
set clip of more widgets
This commit is contained in:
parent
3094b341ed
commit
2cd1a984cf
@ -625,6 +625,8 @@ gtk_application_window_real_size_allocate (GtkWidget *widget,
|
||||
else
|
||||
GTK_WIDGET_CLASS (gtk_application_window_parent_class)
|
||||
->size_allocate (widget, allocation);
|
||||
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -192,11 +192,14 @@ gtk_bin_size_allocate (GtkWidget *widget,
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
GtkAllocation clip = *allocation;
|
||||
|
||||
gtk_widget_size_allocate (priv->child, allocation);
|
||||
gtk_widget_get_clip (priv->child, &clip);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2119,6 +2119,8 @@ gtk_calendar_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
|
||||
|
@ -173,10 +173,12 @@ gtk_color_button_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkColorButton *button = GTK_COLOR_BUTTON (widget);
|
||||
GtkColorButtonPrivate *priv = gtk_color_button_get_instance_private (button);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_color_button_parent_class)->size_allocate (widget, allocation);
|
||||
GtkAllocation clip = *allocation;
|
||||
|
||||
gtk_widget_size_allocate (priv->button, allocation);
|
||||
gtk_widget_get_clip (priv->button, &clip);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -184,9 +184,8 @@ plane_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->size_allocate (widget, allocation);
|
||||
|
||||
create_surface (plane);
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -386,10 +386,12 @@ gtk_file_chooser_button_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
|
||||
GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->size_allocate (widget, allocation);
|
||||
GtkAllocation clip = *allocation;
|
||||
|
||||
gtk_widget_size_allocate (priv->child, allocation);
|
||||
gtk_widget_get_clip (priv->child, &clip);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -468,10 +468,12 @@ gtk_font_button_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkFontButton *button = GTK_FONT_BUTTON (widget);
|
||||
GtkFontButtonPrivate *priv = gtk_font_button_get_instance_private (button);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_font_button_parent_class)->size_allocate (widget, allocation);
|
||||
GtkAllocation clip = *allocation;
|
||||
|
||||
gtk_widget_size_allocate (priv->button, allocation);
|
||||
gtk_widget_get_clip (priv->button, &clip);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -897,7 +897,7 @@ gtk_header_bar_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (GTK_HEADER_BAR (widget));
|
||||
GtkAllocation clip;
|
||||
GtkAllocation clip = *allocation;
|
||||
GtkWidget *title_widget;
|
||||
GtkHeaderBar *bar = GTK_HEADER_BAR (widget);
|
||||
GtkRequestedSize *sizes;
|
||||
|
@ -1675,8 +1675,6 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
gtk_icon_view_layout (icon_view);
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
@ -1714,6 +1712,8 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
|
||||
/* Emit any pending signals now */
|
||||
g_object_thaw_notify (G_OBJECT (icon_view->priv->hadjustment));
|
||||
g_object_thaw_notify (G_OBJECT (icon_view->priv->vadjustment));
|
||||
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1275,7 +1275,7 @@ static void
|
||||
gtk_image_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkAllocation clip;
|
||||
GtkAllocation clip = *allocation;
|
||||
GdkRectangle extents;
|
||||
|
||||
_gtk_style_context_get_icon_extents (gtk_widget_get_style_context (widget),
|
||||
|
@ -662,7 +662,10 @@ gtk_progress_bar_size_allocate (GtkWidget *widget,
|
||||
gdk_rectangle_union (&clip, &child_clip, &clip);
|
||||
|
||||
if (!priv->show_text)
|
||||
return;
|
||||
{
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_measure (priv->label, GTK_ORIENTATION_HORIZONTAL, -1,
|
||||
&text_min, &text_nat,
|
||||
|
@ -441,15 +441,18 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
|
||||
int bin_x, bin_y;
|
||||
GtkRevealerTransitionType transition;
|
||||
GtkBorder padding;
|
||||
GtkAllocation clip = *allocation;
|
||||
|
||||
g_return_if_fail (allocation != NULL);
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
gtk_revealer_get_child_allocation (revealer, allocation, &child_allocation);
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (revealer));
|
||||
if (child != NULL && gtk_widget_get_visible (child))
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
{
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
gtk_widget_get_clip (child, &clip);
|
||||
}
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
{
|
||||
@ -501,6 +504,8 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
|
||||
bin_y + allocation->y,
|
||||
child_allocation.width, child_allocation.height);
|
||||
}
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4312,6 +4312,8 @@ gtk_text_view_size_allocate (GtkWidget *widget,
|
||||
*/
|
||||
if (size_changed)
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -7222,6 +7222,8 @@ gtk_window_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
|
||||
gtk_window_restack_popovers (window);
|
||||
|
||||
gtk_widget_set_clip (widget, allocation);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
Loading…
Reference in New Issue
Block a user