[PATCH rhel7-branch] Grow the spoke gradient image to fit the nav_area (#1035772).
Vratislav Podzimek
vpodzime at redhat.com
Fri Jan 17 13:00:03 UTC 2014
On Thu, 2014-01-16 at 15:07 -0500, Chris Lumens wrote:
> The nav_area might be taller than we expect on certain languages, like Kannada.
> Because we were shrinking the nav_area to fit the size of the image, widgets
> in the nav_area looked like they were spilling over. Instead, we should force
> the image to fit in however big GTK decides to make the nav_area.
> ---
> widgets/src/SpokeWindow.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c
> index 1bba1e6..0863f6e 100644
> --- a/widgets/src/SpokeWindow.c
> +++ b/widgets/src/SpokeWindow.c
> @@ -160,6 +160,7 @@ static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
> }
>
> static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data) {
> + GtkWidget *nav_box;
> GtkAccelGroup *accel_group;
> GError *error;
> GdkPixbuf *pixbuf;
> @@ -174,14 +175,15 @@ static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data)
> * header without an image.
> */
> error = NULL;
> - pixbuf = gdk_pixbuf_new_from_file("/usr/share/anaconda/pixmaps/anaconda_spoke_header.png", &error);
> + nav_box = anaconda_base_window_get_nav_area_background_window(ANACONDA_BASE_WINDOW(window));
> + pixbuf = gdk_pixbuf_new_from_file_at_scale("/usr/share/anaconda/pixmaps/anaconda_spoke_header.png",
> + -1, gdk_window_get_height(gtk_widget_get_window(nav_box)),
> + FALSE, &error);
> +
> if (!pixbuf) {
> fprintf(stderr, "could not load header background: %s\n", error->message);
> g_error_free(error);
> } else {
> - GtkWidget *nav_box = anaconda_base_window_get_nav_area_background_window(ANACONDA_BASE_WINDOW(window));
> - gtk_widget_set_size_request(nav_box, -1, gdk_pixbuf_get_height (pixbuf));
> -
> surface = gdk_window_create_similar_surface(gtk_widget_get_window(nav_box), CAIRO_CONTENT_COLOR_ALPHA,
> gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
> cr = cairo_create(surface);
ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list