summaryrefslogtreecommitdiffstats
path: root/tests/interactive/inline-style.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 15:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 15:07:22 +0000
commitf9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7 (patch)
treece9e8db2d4e8799780fa72ae8f1953039373e2ee /tests/interactive/inline-style.js
parentInitial commit. (diff)
downloadgnome-shell-f9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7.tar.xz
gnome-shell-f9d480cfe50ca1d7a0f0b5a2b8bb9932962bfbe7.zip
Adding upstream version 3.38.6.upstream/3.38.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/interactive/inline-style.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/interactive/inline-style.js b/tests/interactive/inline-style.js
new file mode 100644
index 0000000..3952c3a
--- /dev/null
+++ b/tests/interactive/inline-style.js
@@ -0,0 +1,46 @@
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
+
+const UI = imports.testcommon.ui;
+
+const { Clutter, St } = imports.gi;
+
+function test() {
+ let stage = new Clutter.Stage();
+ UI.init(stage);
+
+ let vbox = new St.BoxLayout({ vertical: true,
+ width: stage.width,
+ height: stage.height });
+ stage.add_actor(vbox);
+
+ let hbox = new St.BoxLayout({ style: 'spacing: 12px;' });
+ vbox.add(hbox);
+
+ let text = new St.Label({ text: "Styled Text" });
+ vbox.add (text);
+
+ let size = 24;
+ function update_size() {
+ text.style = 'font-size: ' + size + 'pt';
+ }
+ update_size();
+
+ let button;
+
+ button = new St.Button ({ label: 'Smaller', style_class: 'push-button' });
+ hbox.add (button);
+ button.connect('clicked', () => {
+ size /= 1.2;
+ update_size ();
+ });
+
+ button = new St.Button ({ label: 'Bigger', style_class: 'push-button' });
+ hbox.add (button);
+ button.connect('clicked', () => {
+ size *= 1.2;
+ update_size ();
+ });
+
+ UI.main(stage);
+}
+test();