summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-03-24 20:10:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-03-24 20:17:21 -0400
commit206d43dcb4fc0cf56c2a1af294fc52fdfb3e1d58 (patch)
treeb40fd91937ef83b5fe90ddc1fc7159e664184d08 /tests
parent16858776353c0181d74a482878a584aac9e555a0 (diff)
downloadgtk+-206d43dcb4fc0cf56c2a1af294fc52fdfb3e1d58.tar.gz
Add a testcase for icons with emblems
This is a testcase for https://bugzilla.gnome.org/show_bug.cgi?id=726830
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/testemblems.c42
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bc479ccc00..7afc58b819 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -52,6 +52,7 @@ noinst_PROGRAMS = $(TEST_PROGS) \
testdialog \
testdnd \
testellipsise \
+ testemblems \
testentrycompletion \
testentryicons \
testfilechooser \
diff --git a/tests/testemblems.c b/tests/testemblems.c
new file mode 100644
index 0000000000..19f0aa1d41
--- /dev/null
+++ b/tests/testemblems.c
@@ -0,0 +1,42 @@
+#include <gtk/gtk.h>
+
+int main (int argc, char **argv)
+{
+ GtkWidget *window;
+ GtkWidget *button;
+ GtkWidget *grid;
+ GIcon *icon;
+ GIcon *icon2;
+
+ gtk_init (&argc, &argv);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ grid = gtk_grid_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+ gtk_container_add (GTK_CONTAINER (window), grid);
+
+ icon = g_themed_icon_new ("folder");
+ button = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ gtk_grid_attach (GTK_GRID (grid), button, 1, 1, 1, 1);
+
+ icon2 = g_themed_icon_new ("folder-symbolic");
+ button = gtk_image_new_from_gicon (icon2, GTK_ICON_SIZE_MENU);
+ gtk_grid_attach (GTK_GRID (grid), button, 2, 1, 1, 1);
+
+ icon = g_emblemed_icon_new (icon, g_emblem_new (g_themed_icon_new ("emblem-new")));
+ button = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ gtk_grid_attach (GTK_GRID (grid), button, 1, 2, 1, 1);
+
+ icon2 = g_emblemed_icon_new (icon2, g_emblem_new (g_themed_icon_new ("emblem-new")));
+ button = gtk_image_new_from_gicon (icon2, GTK_ICON_SIZE_MENU);
+ gtk_grid_attach (GTK_GRID (grid), button, 2, 2, 1, 1);
+
+ gtk_widget_show_all (window);
+
+ gtk_main ();
+
+ return 0;
+}