.settings
browser-plugin
data
docs
js
man
po
src
tests
interactive
background-repeat.js
background-size.js
border-radius.js
border-width.js
borders.js
box-layout.js
box-shadow-animated.js
box-shadows.js
calendar.js
css-fonts.js
entry.js
gapplication.js
icons.js
inline-style.js
scroll-view-sizing.js
scrolling.js
table.js
test-title.js
transitions.js
testcommon
unit
Makefile.am
run-test.sh.in
tools
.gitignore
.gitmodules
.project
AUTHORS
COPYING
HACKING
MAINTAINERS
Makefile.am
NEWS
README
autogen.sh
configure.ac
gnome-shell.doap

As the global object of a context is rooted, if we want the GC to act on these objects we need to take them out of the globals. https://bugzilla.gnome.org/show_bug.cgi?id=678737
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
|
|
const Clutter = imports.gi.Clutter;
|
|
const St = imports.gi.St;
|
|
|
|
const UI = imports.testcommon.ui;
|
|
|
|
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', function() {
|
|
size /= 1.2;
|
|
update_size ();
|
|
});
|
|
|
|
button = new St.Button ({ label: 'Bigger', style_class: 'push-button' });
|
|
hbox.add (button);
|
|
button.connect('clicked', function() {
|
|
size *= 1.2;
|
|
update_size ();
|
|
});
|
|
|
|
UI.main(stage);
|
|
}
|
|
test();
|