Commit 71eb9d12 authored by Cosimo Cecchi's avatar Cosimo Cecchi

tests: import the widget-factory test for theming

Courtesy of Andrea Cimitan <andrea.cimitan@canonical.com>.
parent 8f357bb8
......@@ -117,7 +117,8 @@ noinst_PROGRAMS = $(TEST_PROGS) \
testanimation \
testpixbuf-save \
testpixbuf-color \
testpixbuf-scale
testpixbuf-scale \
widget-factory
if USE_X11
noinst_PROGRAMS += testerrors
......@@ -224,6 +225,7 @@ testanimation_DEPENDENCIES = $(TEST_DEPS)
testpixbuf_save_DEPENDENCIES = $(TEST_DEPS)
testpixbuf_color_DEPENDENCIES = $(TEST_DEPS)
testpixbuf_scale_DEPENDENCIES = $(TEST_DEPS)
widget_factory_DEPENDENCIES = $(TEST_DEPS)
flicker_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
......@@ -317,6 +319,7 @@ testanimation_LDADD = $(LDADDS)
testpixbuf_save_LDADD = $(LDADDS)
testpixbuf_color_LDADD = $(LDADDS)
testpixbuf_scale_LDADD = $(LDADDS)
widget_factory_LDADD = $(LDADDS)
testboxcss_SOURCES = \
......@@ -479,6 +482,8 @@ testpixbuf_color_SOURCES = testpixbuf-color.c
testpixbuf_save_SOURCES = testpixbuf-save.c
widget_factory_SOURCES = widget-factory.c
EXTRA_DIST += \
gradient1.png \
......@@ -500,7 +505,8 @@ EXTRA_DIST += \
merge-2.ui \
merge-3.ui \
gnome-textfile.png \
makefile.msc
makefile.msc \
widget-factory.ui
-include $(top_srcdir)/git.mk
/* widget-factory: a collection of widgets in a single page, for easy
* theming
*
* Copyright (C) 2011 Canonical Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
*
*/
#include <gtk/gtk.h>
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
gtk_init (&argc, &argv);
if (argc > 1 &&
(g_strcmp0 (argv[1], "--dark") == 0))
g_object_set (gtk_settings_get_default (),
"gtk-application-prefer-dark-theme", TRUE,
NULL);
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "./widget-factory.ui", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
gtk_widget_show (window);
gtk_main ();
return 0;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment