[PATCH 2/3] Add layout indicator to the BaseWindow

Chris Lumens clumens at redhat.com
Tue Apr 30 15:42:24 UTC 2013


> Also make Done button use two cells in the grid because BaseWindow's navigation
> area has now three rows instead of two (layout indicator added) and the "Done"
> button should be centered between the second and the third rows.

That's fine, but can you move the Done button to appear at either the
top of one cell or the bottom of another?  Its new layout has kind of a
strange amount of whitespace around it.

> @@ -267,7 +270,7 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
>  
>      /* Create the beta label. */
>      win->priv->beta_label = gtk_label_new(NULL);
> -    markup = g_markup_printf_escaped("<span foreground='red' weight='bold' size='large'>%s</span>", _(DEFAULT_BETA));
> +    markup = g_markup_printf_escaped("<span foreground='red' weight='bold' size='medium'>%s</span>", _(DEFAULT_BETA));
>      gtk_label_set_markup(GTK_LABEL(win->priv->beta_label), markup);
>      g_free(markup);
>      gtk_misc_set_alignment(GTK_MISC(win->priv->beta_label), 0, 0);

Remember to make this change in anaconda_base_window_retranslate as
well.  If you would prefer, you could move to using a format_ function
like I am doing in MountpointSelector.c and SpokeSelector.c  Just grep
for that.

> @@ -275,10 +278,20 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
>  
>      win->priv->orig_beta = g_strdup(DEFAULT_BETA);
>  
> +    /* Create the layout indicator */
> +    win->priv->layout_indicator = anaconda_layout_indicator_new();
> +    anaconda_layout_indicator_set_label_width(ANACONDA_LAYOUT_INDICATOR(win->priv->layout_indicator),
> +                                              LAYOUT_INDICATOR_LABEL_WIDTH);
> +    gtk_widget_set_halign(win->priv->layout_indicator, GTK_ALIGN_CENTER);
> +    gtk_widget_set_hexpand(win->priv->layout_indicator, FALSE);
> +    gtk_widget_set_margin_top(win->priv->layout_indicator, 6);
> +    gtk_widget_set_margin_bottom(win->priv->layout_indicator, 4);
> +
>      /* Add everything to the nav area. */
>      gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->name_label, 0, 0, 1, 1);
>      gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->distro_label, 1, 0, 1, 1);
>      gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->beta_label, 1, 1, 1, 1);
> +    gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->layout_indicator, 1, 2, 1, 1);
>  }

This is the other big problem I have.  I don't like the position here in
the header.  It might be a simple matter of changing the center
alignment to something else.  It just kind of feels out of place to me.

- Chris


More information about the anaconda-patches mailing list