summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2008-06-30 00:23:41 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-06-30 00:23:41 +0000
commitbd0a531253028d13e5a5de3372eadfa61f44b512 (patch)
treed175e958cf70e2a429a99805e5bdee9141805141
parent7988361eab183e3b39379dc7b2ee324be58e7a91 (diff)
downloadmetacity-bd0a531253028d13e5a5de3372eadfa61f44b512.tar.gz
display the theme name in the title bar. Closes #430198.
2008-06-30 Thomas Thurman <tthurman@gnome.org> * src/ui/theme-viewer.c (main): display the theme name in the title bar. Closes #430198. svn path=/trunk/; revision=3776
-rw-r--r--ChangeLog5
-rw-r--r--src/ui/theme-viewer.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 90006da4..a4d0d773 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-30 Thomas Thurman <tthurman@gnome.org>
+
+ * src/ui/theme-viewer.c (main): display the theme name
+ in the title bar. Closes #430198.
+
2008-06-29 Thomas Thurman <tthurman@gnome.org>
Allow toggling of non-compositor effects (since there's a
diff --git a/src/ui/theme-viewer.c b/src/ui/theme-viewer.c
index 4b97de66..a5a94978 100644
--- a/src/ui/theme-viewer.c
+++ b/src/ui/theme-viewer.c
@@ -29,6 +29,7 @@
#include <gtk/gtk.h>
#include <time.h>
#include <stdlib.h>
+#include <string.h>
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
@@ -816,6 +817,24 @@ main (int argc, char **argv)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 350, 350);
+ if (strcmp (global_theme->name, global_theme->readable_name)==0)
+ gtk_window_set_title (GTK_WINDOW (window),
+ global_theme->readable_name);
+ else
+ {
+ /* The theme directory name is different from the name the theme
+ * gives itself within its file. Display both, directory name first.
+ */
+ gchar *title = g_strconcat (global_theme->name, " - ",
+ global_theme->readable_name,
+ NULL);
+
+ gtk_window_set_title (GTK_WINDOW (window),
+ title);
+
+ g_free (title);
+ }
+
g_signal_connect (G_OBJECT (window), "destroy",
G_CALLBACK (gtk_main_quit), NULL);