diff options
Diffstat (limited to '')
-rw-r--r-- | tests/testcommon/100-200.svg | 21 | ||||
-rw-r--r-- | tests/testcommon/200-100.svg | 21 | ||||
-rw-r--r-- | tests/testcommon/200-200.svg | 21 | ||||
-rw-r--r-- | tests/testcommon/border-image.png | bin | 0 -> 981 bytes | |||
-rw-r--r-- | tests/testcommon/face-plain.png | bin | 0 -> 4298 bytes | |||
-rw-r--r-- | tests/testcommon/test.css | 112 | ||||
-rw-r--r-- | tests/testcommon/ui.js | 28 |
7 files changed, 203 insertions, 0 deletions
diff --git a/tests/testcommon/100-200.svg b/tests/testcommon/100-200.svg new file mode 100644 index 0000000..59a5307 --- /dev/null +++ b/tests/testcommon/100-200.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 100 200" width="100" height="200"> + <path + d=" + M 2,2 h 96 v 196 h -96 v -196 + M 8,8 h 84 v 184 h -84 v -184 + " + fill="white" + stroke="blue" + stroke-width="2" + stroke-linecap="square" + /> + <path + d=" + M 10,10 h 20 v 20 h -20 v -20 + " + fill="green" + /> +</svg> diff --git a/tests/testcommon/200-100.svg b/tests/testcommon/200-100.svg new file mode 100644 index 0000000..e149b5f --- /dev/null +++ b/tests/testcommon/200-100.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 200 100" width="200" height="100"> + <path + d=" + M 2,2 h 196 v 96 h -196 v -96 + M 8,8 h 184 v 84 h -184 v -84 + " + fill="white" + stroke="blue" + stroke-width="2" + stroke-linecap="square" + /> + <path + d=" + M 10,10 h 20 v 20 h -20 v -20 + " + fill="green" + /> +</svg> diff --git a/tests/testcommon/200-200.svg b/tests/testcommon/200-200.svg new file mode 100644 index 0000000..9965a2a --- /dev/null +++ b/tests/testcommon/200-200.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 200 200" width="200" height="200"> + <path + d=" + M 2,2 h 196 v 196 h -196 v -196 + M 8,8 h 184 v 184 h -184 v -184 + " + fill="white" + stroke="blue" + stroke-width="2" + stroke-linecap="square" + /> + <path + d=" + M 10,10 h 20 v 20 h -20 v -20 + " + fill="green" + /> +</svg> diff --git a/tests/testcommon/border-image.png b/tests/testcommon/border-image.png Binary files differnew file mode 100644 index 0000000..e680020 --- /dev/null +++ b/tests/testcommon/border-image.png diff --git a/tests/testcommon/face-plain.png b/tests/testcommon/face-plain.png Binary files differnew file mode 100644 index 0000000..962d70f --- /dev/null +++ b/tests/testcommon/face-plain.png diff --git a/tests/testcommon/test.css b/tests/testcommon/test.css new file mode 100644 index 0000000..b82d230 --- /dev/null +++ b/tests/testcommon/test.css @@ -0,0 +1,112 @@ +@import url("resource:///org/gnome/shell/theme/gnome-shell.css"); + +stage { + font: 16pt serif; + color: black; +} + +.red { + background-color: red; +} + +.green { + background-color: green; +} + +.blue { + background-color: blue; +} + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +.big { + font-size: 150%; +} + +.monospace { + font-family: monospace; +} + +.border-image { + border: 15px; + border-image: url('border-image.png') 16; +} + +.background-image-200-200 { + background-image: url('200-200.svg'); +} + +.background-image-100-200 { + background-image: url('100-200.svg'); +} + +.background-image-200-100 { + background-image: url('200-100.svg'); +} + +.background-gradient { + background-gradient-start: rgba(127, 255, 127, .6); + background-gradient-end: rgba(127, 127, 255, .6); +} + +.border-image-with-background-gradient { + border: 15px black solid; + border-image: url('border-image.png') 16; + background-gradient-start: #88ff88; + background-gradient-end: #8888ff; +} + +.background-image { + background-image: url('face-plain.png'); + background-color: white; +} + +.background-repeat { + background-repeat: repeat; +} + +.push-button { + background: #eeddbb; + border: 1px solid black; + border-radius: 8px; + padding: 5px; +} + +.push-button:hover { + background: #ffeecc; +} + +.push-button:active { + background: #ccbb99; +} + +.vfade { + -st-fade-offset: 68px; +} + +#transition-container .transition-label { + color: white; + width: 1em; + height: 1em; + padding: 1em; + background-color: #333; + border: 2px solid black; + border-radius: 8px; + transition-duration: 1s; +} + +#transition-container:hover .transition-label { + background-color: blue; + border: 2px solid red; +} + +#transition-container .transition-label:hover { + background-color: green; + border: 2px solid blue; +} diff --git a/tests/testcommon/ui.js b/tests/testcommon/ui.js new file mode 100644 index 0000000..abacea5 --- /dev/null +++ b/tests/testcommon/ui.js @@ -0,0 +1,28 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Config = imports.misc.config; + +imports.gi.versions = { Clutter: Config.LIBMUTTER_API_VERSION, Gtk: '3.0' }; + +const { Clutter, Gio, GLib, St } = imports.gi; + +const Environment = imports.ui.environment; + +function init(stage) { + Environment.init(); + let themeResource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource'); + themeResource._register(); + + let context = St.ThemeContext.get_for_stage(stage); + let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css"; + let theme = new St.Theme({ application_stylesheet: Gio.File.new_for_path(stylesheetPath) }); + context.set_theme(theme); +} + +function main(stage) { + stage.show(); + stage.connect('destroy', () => { + Clutter.main_quit(); + }); + Clutter.main(); +} |