user-accounts/crop-area: Enforce a minimum size
Otherwise, since the dialog is resizable, users could resize us so small that we'd crash inside gdk_pixbuf_scale() . https://bugzilla.gnome.org/show_bug.cgi?id=740986
This commit is contained in:
parent
a56693207d
commit
ca7421efa2
1 changed files with 12 additions and 0 deletions
|
@ -680,6 +680,14 @@ cc_crop_area_button_release_event (GtkWidget *widget,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cc_crop_area_set_size_request (CcCropArea *area)
|
||||||
|
{
|
||||||
|
gtk_widget_set_size_request (GTK_WIDGET (area),
|
||||||
|
area->priv->base_width,
|
||||||
|
area->priv->base_height);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cc_crop_area_finalize (GObject *object)
|
cc_crop_area_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
|
@ -733,6 +741,8 @@ cc_crop_area_init (CcCropArea *area)
|
||||||
area->priv->base_width = 48;
|
area->priv->base_width = 48;
|
||||||
area->priv->base_height = 48;
|
area->priv->base_height = 48;
|
||||||
area->priv->aspect = 1;
|
area->priv->aspect = 1;
|
||||||
|
|
||||||
|
cc_crop_area_set_size_request (area);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
|
@ -799,6 +809,8 @@ cc_crop_area_set_min_size (CcCropArea *area,
|
||||||
area->priv->base_width = width;
|
area->priv->base_width = width;
|
||||||
area->priv->base_height = height;
|
area->priv->base_height = height;
|
||||||
|
|
||||||
|
cc_crop_area_set_size_request (area);
|
||||||
|
|
||||||
if (area->priv->aspect > 0) {
|
if (area->priv->aspect > 0) {
|
||||||
area->priv->aspect = area->priv->base_width / (gdouble)area->priv->base_height;
|
area->priv->aspect = area->priv->base_width / (gdouble)area->priv->base_height;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue