~mterry/ubuntu/natty/gnome-shell/wip

« back to all changes in this revision

Viewing changes to tests/interactive/inline-style.js

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-10-12 22:44:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012224400-k91p42yvou07i525
Tags: 2.28.0-0ubuntu1
* New upstream version
* debian/control:
  - updated build requirement
* debian/patches/80_git_change_fix_alt_tab_ressource_usage.patch:
  - git change to fix ressources not being freed on alt-tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
 
2
 
 
3
const Clutter = imports.gi.Clutter;
 
4
const St = imports.gi.St;
 
5
 
 
6
const UI = imports.testcommon.ui;
 
7
 
 
8
UI.init();
 
9
let stage = Clutter.Stage.get_default();
 
10
 
 
11
let vbox = new St.BoxLayout({ vertical: true,
 
12
                              width: stage.width,
 
13
                              height: stage.height });
 
14
stage.add_actor(vbox);
 
15
 
 
16
let hbox = new St.BoxLayout({ style: 'spacing: 12px;' });
 
17
vbox.add(hbox);
 
18
 
 
19
let text = new St.Label({ text: "Styled Text" });
 
20
vbox.add (text);
 
21
 
 
22
let size = 24;
 
23
function update_size() {
 
24
    text.style = 'font-size: ' + size + 'pt';
 
25
}
 
26
update_size();
 
27
 
 
28
let button;
 
29
 
 
30
button = new St.Button ({ label: 'Smaller', style_class: 'push-button' });
 
31
hbox.add (button);
 
32
button.connect('clicked', function() {
 
33
                   size /= 1.2;
 
34
                   update_size ();
 
35
               });
 
36
 
 
37
button = new St.Button ({ label: 'Bigger', style_class: 'push-button' });
 
38
hbox.add (button);
 
39
button.connect('clicked', function() {
 
40
                   size *= 1.2;
 
41
                   update_size ();
 
42
               });
 
43
 
 
44
stage.show();
 
45
Clutter.main();
 
46
stage.destroy();
 
47