[gnome-control-center] display: Show the resolution in the canvas area
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: Show the resolution in the canvas area
- Date: Wed, 6 Oct 2010 16:58:23 +0000 (UTC)
commit e22c847f196332150d4715c11a09a7230163252f
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 6 16:24:19 2010 +0100
display: Show the resolution in the canvas area
panels/display/xrandr-capplet.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/panels/display/xrandr-capplet.c b/panels/display/xrandr-capplet.c
index 4321300..36941bd 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;
+
+ 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 gtk_widget_create_pango_layout (
- GTK_WIDGET (app->area), text);
+ return layout;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]