2009-09-20 20:21:47 +00:00
|
|
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
|
|
|
|
|
|
const Clutter = imports.gi.Clutter;
|
|
|
|
const St = imports.gi.St;
|
|
|
|
|
|
|
|
const UI = imports.testcommon.ui;
|
|
|
|
|
|
|
|
UI.init();
|
|
|
|
let stage = Clutter.Stage.get_default();
|
2010-01-15 23:32:48 +00:00
|
|
|
stage.width = 640;
|
|
|
|
stage.height = 480;
|
2009-09-20 20:21:47 +00:00
|
|
|
|
|
|
|
let vbox = new St.BoxLayout({ vertical: true,
|
|
|
|
width: stage.width,
|
|
|
|
height: stage.height,
|
2009-09-30 03:03:41 +00:00
|
|
|
style: 'padding: 10px;'
|
|
|
|
+ 'spacing: 20px;'
|
|
|
|
+ 'background: #ffee88;' });
|
2010-01-15 23:32:48 +00:00
|
|
|
let scroll = new St.ScrollView();
|
|
|
|
scroll.add_actor(vbox);
|
|
|
|
stage.add_actor(scroll);
|
2009-09-20 20:21:47 +00:00
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Hello World",
|
|
|
|
style: 'border: 1px solid black; '
|
|
|
|
+ 'padding: 5px;' }));
|
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Hello Round World",
|
|
|
|
style: 'border: 3px solid green; '
|
|
|
|
+ 'border-radius: 8px; '
|
|
|
|
+ 'padding: 5px;' }));
|
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Hello Background",
|
|
|
|
style: 'border: 3px solid green; '
|
|
|
|
+ 'border-radius: 8px; '
|
|
|
|
+ 'background: white; '
|
|
|
|
+ 'padding: 5px;' }));
|
|
|
|
|
2010-01-15 23:32:48 +00:00
|
|
|
vbox.add(new St.Label({ text: "Hello Translucent Black Border",
|
|
|
|
style: 'border: 3px solid rgba(0, 0, 0, 0.4); '
|
|
|
|
+ 'background: white; ' }));
|
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Hello Translucent Background",
|
|
|
|
style: 'background: rgba(255, 255, 255, 0.3);' }));
|
|
|
|
|
2009-09-20 20:21:47 +00:00
|
|
|
vbox.add(new St.Label({ text: "Border, Padding, Content: 20px" }));
|
|
|
|
|
|
|
|
let b1 = new St.BoxLayout({ vertical: true,
|
|
|
|
style: 'border: 20px solid black; '
|
|
|
|
+ 'background: white; '
|
|
|
|
+ 'padding: 20px;' });
|
|
|
|
vbox.add(b1);
|
|
|
|
|
|
|
|
b1.add(new St.BoxLayout({ width: 20, height: 20,
|
|
|
|
style: 'background: black' }));
|
|
|
|
|
2010-01-15 23:32:48 +00:00
|
|
|
vbox.add(new St.Label({ text: "Translucent big blue border, with rounding",
|
2009-09-20 20:21:47 +00:00
|
|
|
style: 'border: 20px solid rgba(0, 0, 255, 0.2); '
|
2009-09-20 22:03:18 +00:00
|
|
|
+ 'border-radius: 10px; '
|
|
|
|
+ 'background: white; '
|
|
|
|
+ 'padding: 10px;' }));
|
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Transparent border",
|
|
|
|
style: 'border: 20px solid transparent; '
|
2009-09-20 20:21:47 +00:00
|
|
|
+ 'background: white; '
|
|
|
|
+ 'padding: 10px;' }));
|
|
|
|
|
|
|
|
vbox.add(new St.Label({ text: "Border Image",
|
|
|
|
style_class: "border-image",
|
|
|
|
style: "padding: 10px;" }));
|
|
|
|
|
|
|
|
stage.show();
|
|
|
|
Clutter.main();
|
|
|
|
stage.destroy();
|