From e22c847f196332150d4715c11a09a7230163252f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 6 Oct 2010 16:24:19 +0100 Subject: [PATCH] display: Show the resolution in the canvas area --- panels/display/xrandr-capplet.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/panels/display/xrandr-capplet.c b/panels/display/xrandr-capplet.c index 4321300ed..36941bdf7 100644 --- a/panels/display/xrandr-capplet.c +++ b/panels/display/xrandr-capplet.c @@ -1653,7 +1653,8 @@ static PangoLayout * get_display_name (App *app, GnomeOutputInfo *output) { - const char *text; + PangoLayout *layout; + char *text; if (app->current_configuration->clone) { /* Translators: this is the feature where what you see on your laptop's @@ -1661,12 +1662,20 @@ get_display_name (App *app, * used as an adjective, not as a verb. For example, the Spanish * translation could be "Pantallas en Espejo", *not* "Espejar Pantallas". */ - text = _("Mirror Screens"); - } else - text = output->display_name; + text = g_strdup(_("Mirror Screens")); + } else { + char *resolution; - return gtk_widget_create_pango_layout ( - GTK_WIDGET (app->area), text); + resolution = make_resolution_string (output->width, output->height); + text = g_strdup_printf ("%s\n%s", output->display_name, resolution); + g_free (resolution); + } + + layout = gtk_widget_create_pango_layout (GTK_WIDGET (app->area), text); + g_free (text); + pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); + + return layout; } static void