(icon: Clutter.Actor, textLabel: string)
| 34 | private _spinner: any; |
| 35 | |
| 36 | constructor(icon: Clutter.Actor, textLabel: string) { |
| 37 | super({ |
| 38 | x_align: Clutter.ActorAlign.FILL, |
| 39 | y_align: Clutter.ActorAlign.FILL, |
| 40 | layout_manager: new Clutter.BinLayout(), |
| 41 | reactive: true, |
| 42 | }); |
| 43 | |
| 44 | this.iconContainer.set_child(icon); |
| 45 | this.spinnerContainer = new Clutter.Actor({}); |
| 46 | this.spinnerContainer.set_opacity(0); |
| 47 | this.appTitle = new St.Label({ |
| 48 | text: textLabel, |
| 49 | style_class: 'headline-4 text-high-emphasis', |
| 50 | }); |
| 51 | |
| 52 | this.callToAction = new St.Label({ |
| 53 | text: 'Click anywhere to launch', |
| 54 | style_class: 'headline-5 text-medium-emphasis', |
| 55 | style: 'margin-top:32px;', |
| 56 | }); |
| 57 | |
| 58 | this.identityContainer = new St.BoxLayout({ |
| 59 | vertical: true, |
| 60 | x_align: Clutter.ActorAlign.START, |
| 61 | y_align: Clutter.ActorAlign.CENTER, |
| 62 | x_expand: true, |
| 63 | y_expand: true, |
| 64 | style: 'padding:24px; text-align:start;', |
| 65 | }); |
| 66 | |
| 67 | [this.appTitle, this.callToAction, this.spinnerContainer].forEach( |
| 68 | (actor) => this.identityContainer.add_child(actor) |
| 69 | ); |
| 70 | |
| 71 | this.box = new St.BoxLayout({ |
| 72 | vertical: false, |
| 73 | x_align: Clutter.ActorAlign.CENTER, |
| 74 | y_align: Clutter.ActorAlign.CENTER, |
| 75 | style: 'padding:48px; border-radius:48px', |
| 76 | }); |
| 77 | |
| 78 | this.box.add_child(this.iconContainer); |
| 79 | this.box.add_child(this.identityContainer); |
| 80 | |
| 81 | this.add_style_class_name('surface-darker'); |
| 82 | this.add_child(this.box); |
| 83 | this.clickableContainer = new RippleBackground(this); |
| 84 | this.clickableContainer.x_expand = true; |
| 85 | this.clickableContainer.y_expand = true; |
| 86 | this.add_child(this.clickableContainer); |
| 87 | this.connect('event', (actor, event) => { |
| 88 | switch (event.type()) { |
| 89 | case Clutter.EventType.BUTTON_PRESS: |
| 90 | case Clutter.EventType.TOUCH_BEGIN: |
| 91 | this.pressed = true; |
| 92 | break; |
| 93 | case Clutter.EventType.BUTTON_RELEASE: |
nothing calls this directly
no test coverage detected