Add a CSS style test for gradients

This mainly just tests that gradients are properly
reproduced by gtk_style_context_to_string.
This commit is contained in:
Matthias Clasen 2016-01-03 21:49:13 -05:00
parent fcea12f790
commit d9a70bc56a
4 changed files with 43 additions and 4 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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 */

View File

@ -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>