Merge pull request 'Fixed window minimal size' (#12) from YanTheKaller/ubinstall-gtk:master into master

Reviewed-on: #12
pull/15/head v1.2
Dmitry Razumov 1 year ago
commit d4b1eda3a7

@ -234,8 +234,8 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled
int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target))));
int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target))));
int newImgWidthDef = (width <= 50) ? width : width - 50; int newImgWidthDef = (width <= 217) ? width : width - 30;
int newImgHeightDef = (height <= 50) ? height : height - 30; int newImgHeightDef = (height <= 120) ? height : height - 217;
GdkPixbuf *pixBuf = pixbuf_unscaled; GdkPixbuf *pixBuf = pixbuf_unscaled;
int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef));
if (newImgHeight > newImgHeightDef) { if (newImgHeight > newImgHeightDef) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save