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

« back to all changes in this revision

Viewing changes to tests/interactive/table.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
stage.width = stage.height = 600;
 
11
 
 
12
let vbox = new St.BoxLayout({ vertical: true,
 
13
                              width: stage.width,
 
14
                              height: stage.height,
 
15
                              style: 'padding: 10px; '
 
16
                                     + 'spacing: 10px;'
 
17
                                     + 'font: 15px sans-serif;' });
 
18
stage.add_actor(vbox);
 
19
 
 
20
function L(text, color) {
 
21
    return new St.Label({ text: text,
 
22
                          style: "background: " + color + ";"
 
23
                                 + "border: 1px solid rgba(0,0,0,0.5);"
 
24
                                 + "padding: 1em;" });
 
25
}
 
26
 
 
27
////////////////////////////////////////////////////////////////////////////////
 
28
 
 
29
let table = new St.Table({ style: "border: 10px solid #888888;"
 
30
                                  + "padding: 10px;"
 
31
                                  + "spacing-rows: 5px;"
 
32
                                  + "spacing-columns: 15px;" });
 
33
vbox.add(table, { expand: true });
 
34
 
 
35
table.add(L("1", "#ff0000"),
 
36
          { row: 0, col: 0, col_span: 3 });
 
37
table.add(L("2", "#00ff00"),
 
38
          { row: 1, col: 0, row_span: 2 });
 
39
table.add(L("3", "#0000ff"),
 
40
          { row: 1, col: 1,
 
41
            x_expand: 0 });
 
42
table.add(L("4", "#ffff00"),
 
43
          { row: 1, col: 2,
 
44
            y_expand: 0, y_fill: 0
 
45
          });
 
46
table.add(L("5", "#ff00ff"),
 
47
          { row: 2, col: 1, x_expand: 0 });
 
48
table.add(L("6", "#00ffff"),
 
49
          { row: 2, col: 2,
 
50
            x_expand: 0, x_fill: 0, x_align: 1.0,
 
51
            y_expand: 0, y_fill: 0, y_align: 1.0 });
 
52
 
 
53
////////////////////////////////////////////////////////////////////////////////
 
54
 
 
55
stage.show();
 
56
Clutter.main();