From f9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 17:07:22 +0200 Subject: Adding upstream version 3.38.6. Signed-off-by: Daniel Baumann --- tests/testcommon/100-200.svg | 21 +++++++ tests/testcommon/200-100.svg | 21 +++++++ tests/testcommon/200-200.svg | 21 +++++++ tests/testcommon/border-image.png | Bin 0 -> 981 bytes tests/testcommon/face-plain.png | Bin 0 -> 4298 bytes tests/testcommon/test.css | 112 ++++++++++++++++++++++++++++++++++++++ tests/testcommon/ui.js | 28 ++++++++++ 7 files changed, 203 insertions(+) create mode 100644 tests/testcommon/100-200.svg create mode 100644 tests/testcommon/200-100.svg create mode 100644 tests/testcommon/200-200.svg create mode 100644 tests/testcommon/border-image.png create mode 100644 tests/testcommon/face-plain.png create mode 100644 tests/testcommon/test.css create mode 100644 tests/testcommon/ui.js (limited to 'tests/testcommon') 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 @@ + + + + + + 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 @@ + + + + + + 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 @@ + + + + + + diff --git a/tests/testcommon/border-image.png b/tests/testcommon/border-image.png new file mode 100644 index 0000000..e680020 Binary files /dev/null and b/tests/testcommon/border-image.png differ diff --git a/tests/testcommon/face-plain.png b/tests/testcommon/face-plain.png new file mode 100644 index 0000000..962d70f Binary files /dev/null and b/tests/testcommon/face-plain.png differ 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(); +} -- cgit v1.2.3