Package: cdebconf-gtk-udeb Version: 0.189 Severity: important Tags: patch pending rootskel-gtk ships a 800px-wide banner, and that ought to be sufficient since the default mode is 800x600. Some systems are using a wider display though (seen with kfreebsd-amd64, or even with amd64 on some EFI-based systems), which leads to a bad display (centered banner, with a blank margin on both sides). One could think of various options, including: - ship banner in different sizes; - replicate a 1px-wide strip on the left and on the right to fill in the blanks; - stretch/scale the banner. I've decided to implement the last option. Before/after screenshots are attached. Easy to reproduce, replacing vga=788 with vga=791 on the kernel command line, at the syslinux prompt. Of course, scaling isn't looking too nice, but I feel it's better than the current situation. The patch I'm planning to commit is also attached. I note this also fixes the label's being unreadable (that happens in rescue mode for example). Mraw, KiBi.
--- a/src/modules/frontend/gtk/fe_data.h +++ b/src/modules/frontend/gtk/fe_data.h @@ -66,6 +66,8 @@ struct frontend_data */ int logo_width; int logo_height; + bool logo_adjusted; + GtkWidget * logo_widget; /** Internal data of the handler of progress commands. * --- a/src/modules/frontend/gtk/ui.c +++ b/src/modules/frontend/gtk/ui.c @@ -103,6 +103,30 @@ static gboolean handle_exposed_banner(GtkWidget * widget, gchar * message; char * text; + /* There's no way to get the window size before it's realized, so + * defer (possibly) adjusting the logo size until the first expose + * event. + */ + if (TRUE != fe_data->logo_adjusted) { + fprintf(stderr, "Checking the need for logo adjustment.\n"); + + /* If logo and window widths differ, scale. */ + GtkAllocation allocation; + gtk_widget_get_allocation(fe_data->window, &allocation); + if (fe_data->logo_width != allocation.width) { + fprintf(stderr, "Logo needs scaling: width from %d to %d pixels.\n", fe_data->logo_width, allocation.width); + GdkPixbuf * scaled_pixbuf = gdk_pixbuf_scale_simple(gtk_image_get_pixbuf(GTK_IMAGE(fe_data->logo_widget)), + allocation.width, + fe_data->logo_height, + GDK_INTERP_BILINEAR); + gtk_image_set_from_pixbuf(GTK_IMAGE(fe_data->logo_widget), scaled_pixbuf); + fe_data->logo_width = allocation.width; + } else { + fprintf(stderr, "Logo needs no scaling: width stays at %d pixels.\n", allocation.width); + } + fe_data->logo_adjusted = TRUE; + } + if (NULL != fe->info) { text = q_get_description(fe, fe->info); message = g_strdup_printf( @@ -189,6 +213,8 @@ static void create_banner(struct frontend * fe, GtkWidget * container) pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(logo)); fe_data->logo_width = gdk_pixbuf_get_width(pixbuf); fe_data->logo_height = gdk_pixbuf_get_height(pixbuf); + fe_data->logo_adjusted = FALSE; + fe_data->logo_widget = logo; g_signal_connect_after(G_OBJECT(banner), "expose_event", G_CALLBACK(handle_exposed_banner), fe);
Attachment:
before-cropped.png
Description: PNG image
Attachment:
after-cropped.png
Description: PNG image