mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
gtk-demo: Deal with big images
We don't want to grow our window to huge size just because there is a big source image.
This commit is contained in:
parent
481ba13e8e
commit
4d3cdfae44
@ -592,6 +592,17 @@ add_data_tab (const gchar *demoname)
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
if (GTK_IS_IMAGE (widget))
|
||||
{
|
||||
GtkWidget *sw;
|
||||
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (sw), widget);
|
||||
widget = sw;
|
||||
}
|
||||
|
||||
label = gtk_label_new (resources[i]);
|
||||
gtk_widget_show (label);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||
|
Loading…
Reference in New Issue
Block a user