[gtk+] Add a CSS style test for gradients
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add a CSS style test for gradients
- Date: Mon, 4 Jan 2016 19:01:24 +0000 (UTC)
commit d9a70bc56adff5b616d0f5a760507f9ad5b8c08f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 3 21:49:13 2016 -0500
Add a CSS style test for gradients
This mainly just tests that gradients are properly
reproduced by gtk_style_context_to_string.
testsuite/css/style/Makefile.am | 9 +++++----
testsuite/css/style/gradient.css | 11 +++++++++++
testsuite/css/style/gradient.nodes | 9 +++++++++
testsuite/css/style/gradient.ui | 18 ++++++++++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
---
diff --git a/testsuite/css/style/Makefile.am b/testsuite/css/style/Makefile.am
index 6ace191..04972af 100644
--- a/testsuite/css/style/Makefile.am
+++ b/testsuite/css/style/Makefile.am
@@ -29,10 +29,11 @@ test_css_style_SOURCES = \
$(NULL)
test_data = \
- currentcolor.ui currentcolor.css currentcolor.nodes \
- inherit.ui inherit.css inherit.nodes \
- label.ui label.css label.nodes \
- nth-child.ui nth-child.css nth-child.nodes \
+ currentcolor.ui currentcolor.css currentcolor.nodes \
+ gradient.ui gradient.css gradient.nodes \
+ inherit.ui inherit.css inherit.nodes \
+ label.ui label.css label.nodes \
+ nth-child.ui nth-child.css nth-child.nodes \
$(NULL)
BUILT_SOURCES = resources.c
diff --git a/testsuite/css/style/gradient.css b/testsuite/css/style/gradient.css
new file mode 100644
index 0000000..bfa4287
--- /dev/null
+++ b/testsuite/css/style/gradient.css
@@ -0,0 +1,11 @@
+window {
+ background-image: linear-gradient(75deg, red, green 20%, blue 40px);
+}
+
+box {
+ background-image: repeating-linear-gradient(to top right, rgba(255,100,60,0.5), magenta 100%);
+}
+
+label {
+ background-image: radial-gradient(farthest-corner at 50% 30px, yellow, red 30%, blue);
+}
diff --git a/testsuite/css/style/gradient.nodes b/testsuite/css/style/gradient.nodes
new file mode 100644
index 0000000..e71c0a7
--- /dev/null
+++ b/testsuite/css/style/gradient.nodes
@@ -0,0 +1,9 @@
+[window.background:dir(ltr)]
+ background-image: linear-gradient(75deg, rgb(255,0,0), rgb(0,128,0) 20%, rgb(0,0,255) 40px); /*
gradient.css:2:69 */
+
+ decoration:dir(ltr)
+ box.horizontal:dir(ltr)
+ background-image: repeating-linear-gradient(to top right, rgba(255,100,60,0.5), rgb(255,0,255) 100%); /*
gradient.css:6:95 */
+
+ label:dir(ltr)
+ background-image: radial-gradient(circle farthest-corner at center 30px, rgb(255,255,0), rgb(255,0,0)
30%, rgb(0,0,255)); /* gradient.css:10:87 */
diff --git a/testsuite/css/style/gradient.ui b/testsuite/css/style/gradient.ui
new file mode 100644
index 0000000..eb347c5
--- /dev/null
+++ b/testsuite/css/style/gradient.ui
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">1</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]