~popey/+junk/stallboard

« back to all changes in this revision

Viewing changes to stallboard.qml

  • Committer: Alan Pope
  • Date: 2015-08-19 18:54:58 UTC
  • Revision ID: popey@ubuntu.com-20150819185458-yzozc16bngtdgo63
0.3b which is current version in the ubuntu store

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Robert Ancell <robert.ancell@gmail.com>
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU General Public License as published by the Free Software
 
6
 * Foundation, either version 3 of the License, or (at your option) any later
 
7
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 
8
 * license.
 
9
 */
 
10
 
 
11
import QtQuick 2.0
 
12
import Ubuntu.Components 0.1
 
13
 
 
14
MainView {
 
15
    applicationName: "com.popey.stallboard"
 
16
    automaticOrientation: false
 
17
    width: units.gu(100)
 
18
    height: units.gu(75)
 
19
 
 
20
    backgroundColor: "#741266"
 
21
    footerColor: "#bd0776"
 
22
 
 
23
    id: app;
 
24
 
 
25
    Page {
 
26
        title: i18n.tr("Stallboard")
 
27
 
 
28
 
 
29
    Item {
 
30
        anchors.fill: parent
 
31
 
 
32
        id: wrapper
 
33
        property int n_columns: height > width ? 3 : 5;
 
34
        property int n_rows: height > width ? 5 : 3;
 
35
        property int button_size: Math.min (width / n_columns, height / n_rows) * 0.9;
 
36
        property int button_radius: 10;
 
37
        property int button_xspacing: (width - button_size * n_columns) / (n_columns + 1);
 
38
        property int button_yspacing: (height - button_size * n_rows) / (n_rows + 1);
 
39
 
 
40
        Grid {
 
41
            x: wrapper.button_xspacing;
 
42
            y: wrapper.button_yspacing;
 
43
            columns: wrapper.n_columns;
 
44
            rows: wrapper.n_rows;
 
45
 
 
46
            columnSpacing: wrapper.button_xspacing;
 
47
            rowSpacing: wrapper.button_yspacing;
 
48
 
 
49
            SoundButton {
 
50
                width: wrapper.button_size;
 
51
                height: wrapper.button_size;
 
52
                radius: wrapper.button_radius;
 
53
                color: "#32222C"
 
54
                description: "Negative"
 
55
                imageSource: "stallboard.png";
 
56
                soundSource: "media/rmsandthevalueofthisisnegative.mp3";
 
57
            }
 
58
            SoundButton {
 
59
                width: wrapper.button_size;
 
60
                height: wrapper.button_size;
 
61
                radius: wrapper.button_radius;
 
62
                color: "#32222C"
 
63
                description: "Get out"
 
64
                imageSource: "stallboard.png";
 
65
                soundSource: "media/rmsgetitoutofhere.mp3";
 
66
            }
 
67
            SoundButton {
 
68
                width: wrapper.button_size;
 
69
                height: wrapper.button_size;
 
70
                radius: wrapper.button_radius;
 
71
                color: "#32222C"
 
72
                description: "Wasted"
 
73
                imageSource: "stallboard.png";
 
74
                soundSource: "media/rmsithinkitswastedeffort.mp3";
 
75
            }
 
76
            SoundButton {
 
77
                width: wrapper.button_size;
 
78
                height: wrapper.button_size;
 
79
                radius: wrapper.button_radius;
 
80
                color: "#32222C"
 
81
                description: "Mustn't"
 
82
                imageSource: "stallboard.png";
 
83
                soundSource: "media/rmsyoumustntdoititswrong.mp3";
 
84
            }
 
85
            SoundButton {
 
86
                width: wrapper.button_size;
 
87
                height: wrapper.button_size;
 
88
                radius: wrapper.button_radius;
 
89
                color: "#32222C"
 
90
                description: "Freedom"
 
91
                imageSource: "stallboard.png";
 
92
                soundSource: "media/rmsitsnegativeinthefreedomdimension.mp3";
 
93
            }
 
94
            SoundButton {
 
95
                width: wrapper.button_size;
 
96
                height: wrapper.button_size;
 
97
                radius: wrapper.button_radius;
 
98
                color: "#32222C"
 
99
                description: "Wrong"
 
100
                imageSource: "stallboard.png";
 
101
                soundSource: "media/rmswhatswrongwiththat.mp3";
 
102
            }
 
103
            SoundButton {
 
104
                width: wrapper.button_size;
 
105
                height: wrapper.button_size;
 
106
                radius: wrapper.button_radius;
 
107
                color: "#32222C"
 
108
                description: "Wait"
 
109
                imageSource: "stallboard.png";
 
110
                soundSource: "media/rmswaitwaitwaitwaitwaityousaidcommercialsoftware.mp3";
 
111
            }
 
112
            SoundButton {
 
113
                width: wrapper.button_size;
 
114
                height: wrapper.button_size;
 
115
                radius: wrapper.button_radius;
 
116
                color: "#32222C"
 
117
                description: "Moon"
 
118
                imageSource: "stallboard.png";
 
119
                soundSource: "media/rmslookupatthemoononeday.mp3";
 
120
            }
 
121
            SoundButton {
 
122
                width: wrapper.button_size;
 
123
                height: wrapper.button_size;
 
124
                radius: wrapper.button_radius;
 
125
                color: "#32222C"
 
126
                description: "Experienced"
 
127
                imageSource: "stallboard.png";
 
128
                soundSource: "media/rmsiexperiencedlifeinfreedom.mp3";
 
129
            }
 
130
            SoundButton {
 
131
                width: wrapper.button_size;
 
132
                height: wrapper.button_size;
 
133
                radius: wrapper.button_radius;
 
134
                color: "#32222C"
 
135
                description: "Spyware"
 
136
                imageSource: "stallboard.png";
 
137
                soundSource: "media/rmsitsapyware.mp3";
 
138
            }
 
139
            SoundButton {
 
140
                width: wrapper.button_size;
 
141
                height: wrapper.button_size;
 
142
                radius: wrapper.button_radius;
 
143
                color: "#32222C"
 
144
                description: "Malicious"
 
145
                imageSource: "stallboard.png";
 
146
                soundSource: "media/rmsmaliciousfunctionalities.mp3";
 
147
            }
 
148
            SoundButton {
 
149
                width: wrapper.button_size;
 
150
                height: wrapper.button_size;
 
151
                radius: wrapper.button_radius;
 
152
                color: "#32222C"
 
153
                description: "Egregious"
 
154
                imageSource: "stallboard.png";
 
155
                soundSource: "media/rmsthisisegregious.mp3";
 
156
            }
 
157
            SoundButton {
 
158
                width: wrapper.button_size;
 
159
                height: wrapper.button_size;
 
160
                radius: wrapper.button_radius;
 
161
                color: "#32222C"
 
162
                description: "Perverting"
 
163
                imageSource: "stallboard.png";
 
164
                soundSource: "media/rmspervertingfreesoftware.mp3";
 
165
            }
 
166
            SoundButton {
 
167
                width: wrapper.button_size;
 
168
                height: wrapper.button_size;
 
169
                radius: wrapper.button_radius;
 
170
                color: "#32222C"
 
171
                description: "Fail"
 
172
                imageSource: "stallboard.png";
 
173
                soundSource: "media/rmsmakethosebusinessesfail.mp3";
 
174
            }
 
175
            SoundButton {
 
176
                width: wrapper.button_size;
 
177
                height: wrapper.button_size;
 
178
                radius: wrapper.button_radius;
 
179
                color: "#32222C"
 
180
                description: "Trap"
 
181
                imageSource: "stallboard.png";
 
182
                soundSource: "media/rmsthatprogramisreallyatrap.mp3";
 
183
            }
 
184
        }
 
185
    }
 
186
 
 
187
    }
 
188
}
 
189