Merge lp:~flscogna/ubuntu-terminal-app/ubuntu-terminal-app into lp:ubuntu-terminal-app
- ubuntu-terminal-app
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 119 |
Merged at revision: | 128 |
Proposed branch: | lp:~flscogna/ubuntu-terminal-app/ubuntu-terminal-app |
Merge into: | lp:ubuntu-terminal-app |
Diff against target: |
1196 lines (+871/-78) 10 files modified
apparmor.json (+1/-1) po/com.ubuntu.terminal.pot (+73/-32) src/app/qml/ColorDialog.qml (+166/-0) src/app/qml/Configs.qml (+205/-4) src/app/qml/GraphicalTerminal.qml (+130/-0) src/app/qml/ShaderTerminal.qml (+143/-0) src/app/qml/Terminal.qml (+58/-25) src/app/qml/config/JsConfig.qml (+86/-11) src/app/qml/ubuntu-terminal-app.qml (+7/-3) src/plugin/konsole/TerminalDisplay.cpp (+2/-2) |
To merge this branch: | bzr merge lp:~flscogna/ubuntu-terminal-app/ubuntu-terminal-app |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Review via email: mp+232215@code.launchpad.net |
Commit message
Porting of some of the effects of cool-old-term into terminal-app.
Description of the change
Porting of some of the effects of cool-old-term into terminal-app.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Filippo Scognamiglio (flscogna) wrote : | # |
> Looks like you had a merge conflict that needs resolving.
Ok I didn't see the update upstream. Is everything fine now?
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Tested this out on the desktop and device and it works great! Thanks Filippo!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:119
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:119
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'apparmor.json' | |||
2 | --- apparmor.json 2014-07-02 12:30:36 +0000 | |||
3 | +++ apparmor.json 2014-08-26 15:24:15 +0000 | |||
4 | @@ -2,4 +2,4 @@ | |||
5 | 2 | "policy_groups": [], | 2 | "policy_groups": [], |
6 | 3 | "policy_version": 1.2, | 3 | "policy_version": 1.2, |
7 | 4 | "template": "unconfined" | 4 | "template": "unconfined" |
9 | 5 | } | 5 | } |
10 | 6 | \ No newline at end of file | 6 | \ No newline at end of file |
11 | 7 | 7 | ||
12 | === modified file 'po/com.ubuntu.terminal.pot' | |||
13 | --- po/com.ubuntu.terminal.pot 2014-08-25 12:56:56 +0000 | |||
14 | +++ po/com.ubuntu.terminal.pot 2014-08-26 15:24:15 +0000 | |||
15 | @@ -8,7 +8,7 @@ | |||
16 | 8 | msgstr "" | 8 | msgstr "" |
17 | 9 | "Project-Id-Version: \n" | 9 | "Project-Id-Version: \n" |
18 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
20 | 11 | "POT-Creation-Date: 2014-08-25 13:55+0100\n" | 11 | "POT-Creation-Date: 2014-08-26 17:06+0200\n" |
21 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
22 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
23 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
24 | @@ -17,95 +17,139 @@ | |||
25 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
26 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
27 | 19 | 19 | ||
29 | 20 | #: ../src/app/qml/Configs.qml:48 | 20 | #: ../src/app/qml/ColorDialog.qml:25 |
30 | 21 | msgid "Pick a color" | ||
31 | 22 | msgstr "" | ||
32 | 23 | |||
33 | 24 | #: ../src/app/qml/ColorDialog.qml:129 | ||
34 | 25 | msgid "OK" | ||
35 | 26 | msgstr "" | ||
36 | 27 | |||
37 | 28 | #: ../src/app/qml/ColorDialog.qml:149 | ||
38 | 29 | msgid "Cancel" | ||
39 | 30 | msgstr "" | ||
40 | 31 | |||
41 | 32 | #: ../src/app/qml/Configs.qml:64 | ||
42 | 21 | msgid "Color scheme" | 33 | msgid "Color scheme" |
43 | 22 | msgstr "" | 34 | msgstr "" |
44 | 23 | 35 | ||
46 | 24 | #: ../src/app/qml/Configs.qml:64 | 36 | #: ../src/app/qml/Configs.qml:80 |
47 | 25 | msgid "Font size" | 37 | msgid "Font size" |
48 | 26 | msgstr "" | 38 | msgstr "" |
49 | 27 | 39 | ||
51 | 28 | #: ../src/app/qml/Terminal.qml:344 | 40 | #: ../src/app/qml/Configs.qml:103 |
52 | 41 | msgid "Enable effects:" | ||
53 | 42 | msgstr "" | ||
54 | 43 | |||
55 | 44 | #: ../src/app/qml/Configs.qml:115 | ||
56 | 45 | msgid "Screen color" | ||
57 | 46 | msgstr "" | ||
58 | 47 | |||
59 | 48 | #: ../src/app/qml/Configs.qml:128 | ||
60 | 49 | msgid "Color intensity" | ||
61 | 50 | msgstr "" | ||
62 | 51 | |||
63 | 52 | #: ../src/app/qml/Configs.qml:156 | ||
64 | 53 | msgid "Bloom" | ||
65 | 54 | msgstr "" | ||
66 | 55 | |||
67 | 56 | #: ../src/app/qml/Configs.qml:184 | ||
68 | 57 | msgid "Curvature" | ||
69 | 58 | msgstr "" | ||
70 | 59 | |||
71 | 60 | #: ../src/app/qml/Configs.qml:212 | ||
72 | 61 | msgid "Noise" | ||
73 | 62 | msgstr "" | ||
74 | 63 | |||
75 | 64 | #: ../src/app/qml/Configs.qml:240 | ||
76 | 65 | msgid "Jitter" | ||
77 | 66 | msgstr "" | ||
78 | 67 | |||
79 | 68 | #: ../src/app/qml/Configs.qml:268 | ||
80 | 69 | msgid "Brightness flickering" | ||
81 | 70 | msgstr "" | ||
82 | 71 | |||
83 | 72 | #: ../src/app/qml/Terminal.qml:377 | ||
84 | 29 | msgid "Upload Crash Reports" | 73 | msgid "Upload Crash Reports" |
85 | 30 | msgstr "" | 74 | msgstr "" |
86 | 31 | 75 | ||
88 | 32 | #: ../src/app/qml/Terminal.qml:345 | 76 | #: ../src/app/qml/Terminal.qml:378 |
89 | 33 | msgid "Whoopsie;Apport;Debugging;Bugs" | 77 | msgid "Whoopsie;Apport;Debugging;Bugs" |
90 | 34 | msgstr "" | 78 | msgstr "" |
91 | 35 | 79 | ||
93 | 36 | #: ../src/app/qml/Terminal.qml:349 | 80 | #: ../src/app/qml/Terminal.qml:382 |
94 | 37 | msgid "Make Image Writable" | 81 | msgid "Make Image Writable" |
95 | 38 | msgstr "" | 82 | msgstr "" |
96 | 39 | 83 | ||
98 | 40 | #: ../src/app/qml/Terminal.qml:350 | 84 | #: ../src/app/qml/Terminal.qml:383 |
99 | 41 | msgid "System Image;Install Deb" | 85 | msgid "System Image;Install Deb" |
100 | 42 | msgstr "" | 86 | msgstr "" |
101 | 43 | 87 | ||
103 | 44 | #: ../src/app/qml/Terminal.qml:354 | 88 | #: ../src/app/qml/Terminal.qml:387 |
104 | 45 | msgid "List Running Applications" | 89 | msgid "List Running Applications" |
105 | 46 | msgstr "" | 90 | msgstr "" |
106 | 47 | 91 | ||
108 | 48 | #: ../src/app/qml/Terminal.qml:355 | 92 | #: ../src/app/qml/Terminal.qml:388 |
109 | 49 | msgid "Apps" | 93 | msgid "Apps" |
110 | 50 | msgstr "" | 94 | msgstr "" |
111 | 51 | 95 | ||
113 | 52 | #: ../src/app/qml/Terminal.qml:359 | 96 | #: ../src/app/qml/Terminal.qml:392 |
114 | 53 | msgid "Installed Click Packages" | 97 | msgid "Installed Click Packages" |
115 | 54 | msgstr "" | 98 | msgstr "" |
116 | 55 | 99 | ||
118 | 56 | #: ../src/app/qml/Terminal.qml:360 | 100 | #: ../src/app/qml/Terminal.qml:393 |
119 | 57 | msgid "Packages;Applications;Utilities" | 101 | msgid "Packages;Applications;Utilities" |
120 | 58 | msgstr "" | 102 | msgstr "" |
121 | 59 | 103 | ||
123 | 60 | #: ../src/app/qml/Terminal.qml:364 | 104 | #: ../src/app/qml/Terminal.qml:397 |
124 | 61 | msgid "System Image Information" | 105 | msgid "System Image Information" |
125 | 62 | msgstr "" | 106 | msgstr "" |
126 | 63 | 107 | ||
128 | 64 | #: ../src/app/qml/Terminal.qml:365 | 108 | #: ../src/app/qml/Terminal.qml:398 |
129 | 65 | msgid "Image;Version;Channel" | 109 | msgid "Image;Version;Channel" |
130 | 66 | msgstr "" | 110 | msgstr "" |
131 | 67 | 111 | ||
133 | 68 | #: ../src/app/qml/Terminal.qml:369 | 112 | #: ../src/app/qml/Terminal.qml:402 |
134 | 69 | msgid "System Kernel Version" | 113 | msgid "System Kernel Version" |
135 | 70 | msgstr "" | 114 | msgstr "" |
136 | 71 | 115 | ||
138 | 72 | #: ../src/app/qml/Terminal.qml:373 | 116 | #: ../src/app/qml/Terminal.qml:406 |
139 | 73 | msgid "Upstart Job Status" | 117 | msgid "Upstart Job Status" |
140 | 74 | msgstr "" | 118 | msgstr "" |
141 | 75 | 119 | ||
143 | 76 | #: ../src/app/qml/Terminal.qml:374 | 120 | #: ../src/app/qml/Terminal.qml:407 |
144 | 77 | msgid "Init;Session;User Job" | 121 | msgid "Init;Session;User Job" |
145 | 78 | msgstr "" | 122 | msgstr "" |
146 | 79 | 123 | ||
148 | 80 | #: ../src/app/qml/Terminal.qml:378 | 124 | #: ../src/app/qml/Terminal.qml:411 |
149 | 81 | msgid "Hack into the NSA" | 125 | msgid "Hack into the NSA" |
150 | 82 | msgstr "" | 126 | msgstr "" |
151 | 83 | 127 | ||
153 | 84 | #: ../src/app/qml/Terminal.qml:379 | 128 | #: ../src/app/qml/Terminal.qml:412 |
154 | 85 | msgid "Government;Secret;Cracking" | 129 | msgid "Government;Secret;Cracking" |
155 | 86 | msgstr "" | 130 | msgstr "" |
156 | 87 | 131 | ||
158 | 88 | #: ../src/app/qml/Terminal.qml:383 | 132 | #: ../src/app/qml/Terminal.qml:416 |
159 | 89 | msgid "Watch Running Processes" | 133 | msgid "Watch Running Processes" |
160 | 90 | msgstr "" | 134 | msgstr "" |
161 | 91 | 135 | ||
163 | 92 | #: ../src/app/qml/Terminal.qml:384 | 136 | #: ../src/app/qml/Terminal.qml:417 |
164 | 93 | msgid "Top;Memory;Usage" | 137 | msgid "Top;Memory;Usage" |
165 | 94 | msgstr "" | 138 | msgstr "" |
166 | 95 | 139 | ||
168 | 96 | #: ../src/app/qml/Terminal.qml:388 | 140 | #: ../src/app/qml/Terminal.qml:421 |
169 | 97 | msgid "Networking Status" | 141 | msgid "Networking Status" |
170 | 98 | msgstr "" | 142 | msgstr "" |
171 | 99 | 143 | ||
173 | 100 | #: ../src/app/qml/Terminal.qml:389 | 144 | #: ../src/app/qml/Terminal.qml:422 |
174 | 101 | msgid "Wireless;Ethernet;Access Points" | 145 | msgid "Wireless;Ethernet;Access Points" |
175 | 102 | msgstr "" | 146 | msgstr "" |
176 | 103 | 147 | ||
178 | 104 | #: ../src/app/qml/Terminal.qml:393 | 148 | #: ../src/app/qml/Terminal.qml:426 |
179 | 105 | msgid "Watch Star Wars Episode IV" | 149 | msgid "Watch Star Wars Episode IV" |
180 | 106 | msgstr "" | 150 | msgstr "" |
181 | 107 | 151 | ||
183 | 108 | #: ../src/app/qml/Terminal.qml:394 | 152 | #: ../src/app/qml/Terminal.qml:427 |
184 | 109 | msgid "Death Star;Skywalker;Leia;Darth Vader" | 153 | msgid "Death Star;Skywalker;Leia;Darth Vader" |
185 | 110 | msgstr "" | 154 | msgstr "" |
186 | 111 | 155 | ||
187 | @@ -133,33 +177,30 @@ | |||
188 | 133 | msgid "END" | 177 | msgid "END" |
189 | 134 | msgstr "" | 178 | msgstr "" |
190 | 135 | 179 | ||
191 | 136 | #: ../src/app/qml/ubuntu-terminal-app.qml:29 | ||
192 | 137 | #: com.ubuntu.terminal.desktop.in.in.h:1 | 180 | #: com.ubuntu.terminal.desktop.in.in.h:1 |
193 | 138 | msgid "Terminal" | 181 | msgid "Terminal" |
194 | 139 | msgstr "" | 182 | msgstr "" |
195 | 140 | 183 | ||
198 | 141 | #: ../src/app/qml/ubuntu-terminal-app.qml:48 | 184 | #: ../src/app/qml/ubuntu-terminal-app.qml:86 |
197 | 142 | #: ../src/app/qml/ubuntu-terminal-app.qml:85 | ||
199 | 143 | msgid "Settings" | 185 | msgid "Settings" |
200 | 144 | msgstr "" | 186 | msgstr "" |
201 | 145 | 187 | ||
203 | 146 | #: ../src/app/qml/ubuntu-terminal-app.qml:54 | 188 | #: ../src/app/qml/ubuntu-terminal-app.qml:55 |
204 | 147 | msgid "Hide all key panels" | 189 | msgid "Hide all key panels" |
205 | 148 | msgstr "" | 190 | msgstr "" |
206 | 149 | 191 | ||
208 | 150 | #: ../src/app/qml/ubuntu-terminal-app.qml:61 | 192 | #: ../src/app/qml/ubuntu-terminal-app.qml:62 |
209 | 151 | msgid "Control keys" | 193 | msgid "Control keys" |
210 | 152 | msgstr "" | 194 | msgstr "" |
211 | 153 | 195 | ||
213 | 154 | #: ../src/app/qml/ubuntu-terminal-app.qml:68 | 196 | #: ../src/app/qml/ubuntu-terminal-app.qml:69 |
214 | 155 | msgid "Function keys" | 197 | msgid "Function keys" |
215 | 156 | msgstr "" | 198 | msgstr "" |
216 | 157 | 199 | ||
218 | 158 | #: ../src/app/qml/ubuntu-terminal-app.qml:75 | 200 | #: ../src/app/qml/ubuntu-terminal-app.qml:76 |
219 | 159 | msgid "Arrow keys" | 201 | msgid "Arrow keys" |
220 | 160 | msgstr "" | 202 | msgstr "" |
221 | 161 | 203 | ||
222 | 162 | #: ../src/plugin/konsole/ColorScheme.cpp:276 | ||
223 | 163 | #: ../src/plugin/konsole/ColorScheme.cpp:291 | 204 | #: ../src/plugin/konsole/ColorScheme.cpp:291 |
224 | 164 | msgid "Un-named Color Scheme" | 205 | msgid "Un-named Color Scheme" |
225 | 165 | msgstr "" | 206 | msgstr "" |
226 | 166 | 207 | ||
227 | === added file 'src/app/qml/ColorDialog.qml' | |||
228 | --- src/app/qml/ColorDialog.qml 1970-01-01 00:00:00 +0000 | |||
229 | +++ src/app/qml/ColorDialog.qml 2014-08-26 15:24:15 +0000 | |||
230 | @@ -0,0 +1,166 @@ | |||
231 | 1 | /* | ||
232 | 2 | This file is part of quick-memo | ||
233 | 3 | Copyright (C) 2014 Stefano Verzegnassi | ||
234 | 4 | |||
235 | 5 | This program is free software: you can redistribute it and/or modify | ||
236 | 6 | it under the terms of the GNU General Public License 3 as published by | ||
237 | 7 | the Free Software Foundation. | ||
238 | 8 | |||
239 | 9 | This program is distributed in the hope that it will be useful, | ||
240 | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
241 | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
242 | 12 | GNU General Public License for more details. | ||
243 | 13 | |||
244 | 14 | You should have received a copy of the GNU General Public License | ||
245 | 15 | along with this program. If not, see http://www.gnu.org/licenses/. | ||
246 | 16 | */ | ||
247 | 17 | |||
248 | 18 | import QtQuick 2.0 | ||
249 | 19 | import Ubuntu.Components 1.1 | ||
250 | 20 | import Ubuntu.Components.Popups 1.0 | ||
251 | 21 | |||
252 | 22 | Dialog { | ||
253 | 23 | id: rootItem | ||
254 | 24 | |||
255 | 25 | title: i18n.tr("Pick a color") | ||
256 | 26 | |||
257 | 27 | property var colors: ["#0CCC68", "#ffffff", "#61E4FF", "#FFB361", "#FF61E3"] | ||
258 | 28 | property color selectedColor: colors[0] | ||
259 | 29 | |||
260 | 30 | property bool showTick: true | ||
261 | 31 | property bool askConfirmation: false | ||
262 | 32 | |||
263 | 33 | signal colorPicked(bool isChanged) | ||
264 | 34 | |||
265 | 35 | onSelectedColorChanged: view.setCurrentColor() | ||
266 | 36 | Component.onCompleted: internal.oldColor = rootItem.selectedColor | ||
267 | 37 | |||
268 | 38 | QtObject { | ||
269 | 39 | id: internal | ||
270 | 40 | |||
271 | 41 | property color oldColor | ||
272 | 42 | } | ||
273 | 43 | |||
274 | 44 | Grid { | ||
275 | 45 | id: grid | ||
276 | 46 | width: parent.width | ||
277 | 47 | |||
278 | 48 | columns: (width / cellWidth).toFixed(0) | ||
279 | 49 | |||
280 | 50 | property int cellHeight: units.gu(5) | ||
281 | 51 | property int cellWidth: units.gu(5) | ||
282 | 52 | |||
283 | 53 | Repeater { | ||
284 | 54 | id: view | ||
285 | 55 | |||
286 | 56 | width: parent.width | ||
287 | 57 | |||
288 | 58 | Component.onCompleted: setCurrentColor() | ||
289 | 59 | |||
290 | 60 | function setCurrentColor() { | ||
291 | 61 | if (rootItem.colors) { | ||
292 | 62 | for (var i=0; i<rootItem.colors.length; i++) { | ||
293 | 63 | if (rootItem.colors[i] == rootItem.selectedColor) { | ||
294 | 64 | view.currentIndex = i | ||
295 | 65 | } | ||
296 | 66 | } | ||
297 | 67 | } | ||
298 | 68 | } | ||
299 | 69 | |||
300 | 70 | model: rootItem.colors | ||
301 | 71 | |||
302 | 72 | property int currentIndex: 0 | ||
303 | 73 | |||
304 | 74 | delegate: AbstractButton { | ||
305 | 75 | id: delegate | ||
306 | 76 | |||
307 | 77 | height: grid.cellHeight | ||
308 | 78 | width: grid.cellWidth | ||
309 | 79 | |||
310 | 80 | onClicked: { | ||
311 | 81 | view.currentIndex = model.index | ||
312 | 82 | |||
313 | 83 | if (!rootItem.askConfirmation) { | ||
314 | 84 | rootItem.selectedColor = rootItem.colors[view.currentIndex] | ||
315 | 85 | |||
316 | 86 | if (internal.oldColor == rootItem.selectedColor) { | ||
317 | 87 | rootItem.colorPicked(false) | ||
318 | 88 | } else { | ||
319 | 89 | rootItem.colorPicked(true) | ||
320 | 90 | } | ||
321 | 91 | |||
322 | 92 | rootItem.hide() | ||
323 | 93 | } | ||
324 | 94 | } | ||
325 | 95 | |||
326 | 96 | UbuntuShape { | ||
327 | 97 | anchors { fill: parent; margins: units.gu(0.5)} | ||
328 | 98 | color: modelData | ||
329 | 99 | clip: true | ||
330 | 100 | |||
331 | 101 | Icon { | ||
332 | 102 | id: tick | ||
333 | 103 | anchors { fill: parent; margins: units.gu(0.5) } | ||
334 | 104 | name: "tick" | ||
335 | 105 | visible: view.currentIndex == model.index && rootItem.showTick | ||
336 | 106 | color: getColor() | ||
337 | 107 | |||
338 | 108 | function getColor() { | ||
339 | 109 | return Qt.rgba(1 - parseInt(modelData.substr(1,2), 16) / 255, 1 - parseInt(modelData.substr(3,2), 16) / 255, 1 - parseInt(modelData.substr(5,2), 16) / 255) | ||
340 | 110 | } | ||
341 | 111 | } | ||
342 | 112 | } | ||
343 | 113 | } | ||
344 | 114 | } | ||
345 | 115 | } | ||
346 | 116 | |||
347 | 117 | Column { | ||
348 | 118 | width: parent.width | ||
349 | 119 | spacing: units.gu(2) | ||
350 | 120 | |||
351 | 121 | Loader { | ||
352 | 122 | width: parent.width | ||
353 | 123 | sourceComponent: if (askConfirmation) return confirmationButtons | ||
354 | 124 | |||
355 | 125 | Component { | ||
356 | 126 | id: confirmationButtons | ||
357 | 127 | Button { | ||
358 | 128 | width: parent.width | ||
359 | 129 | text: i18n.tr("OK") | ||
360 | 130 | color: UbuntuColors.orange | ||
361 | 131 | |||
362 | 132 | onClicked: { | ||
363 | 133 | rootItem.selectedColor = rootItem.colors[view.currentIndex] | ||
364 | 134 | |||
365 | 135 | if (internal.oldColor == rootItem.selectedColor) { | ||
366 | 136 | rootItem.colorPicked(false) | ||
367 | 137 | } else { | ||
368 | 138 | rootItem.colorPicked(true) | ||
369 | 139 | } | ||
370 | 140 | |||
371 | 141 | rootItem.hide() | ||
372 | 142 | } | ||
373 | 143 | } | ||
374 | 144 | } | ||
375 | 145 | } | ||
376 | 146 | |||
377 | 147 | Button { | ||
378 | 148 | width: parent.width | ||
379 | 149 | text: i18n.tr("Cancel") | ||
380 | 150 | |||
381 | 151 | onClicked: { | ||
382 | 152 | rootItem.hide() | ||
383 | 153 | |||
384 | 154 | for (var i=0; i<rootItem.colors.length; i++) { | ||
385 | 155 | if (rootItem.colors[i] == internal.oldColor) { | ||
386 | 156 | view.currentIndex = i | ||
387 | 157 | } | ||
388 | 158 | } | ||
389 | 159 | rootItem.selectedColor = internal.oldColor | ||
390 | 160 | } | ||
391 | 161 | } | ||
392 | 162 | } | ||
393 | 163 | |||
394 | 164 | |||
395 | 165 | |||
396 | 166 | } | ||
397 | 0 | 167 | ||
398 | === modified file 'src/app/qml/Configs.qml' | |||
399 | --- src/app/qml/Configs.qml 2014-04-27 09:11:14 +0000 | |||
400 | +++ src/app/qml/Configs.qml 2014-08-26 15:24:15 +0000 | |||
401 | @@ -6,9 +6,18 @@ | |||
402 | 6 | Item { | 6 | Item { |
403 | 7 | id: mparent | 7 | id: mparent |
404 | 8 | JsConfig{id: jsConf } | 8 | JsConfig{id: jsConf } |
405 | 9 | ColorDialog{ | ||
406 | 10 | id: colorDialog | ||
407 | 11 | selectedColor: jsConf.getScreenColor(); | ||
408 | 12 | onSelectedColorChanged: { | ||
409 | 13 | jsConf.setScreenColor(selectedColor); | ||
410 | 14 | configChanged(true); | ||
411 | 15 | } | ||
412 | 16 | } | ||
413 | 9 | 17 | ||
414 | 10 | property var colorSchemes; | 18 | property var colorSchemes; |
416 | 11 | property bool colorSchemeLoaded: false; | 19 | property bool colorSchemeLoaded: false; |
417 | 20 | property bool effectsEnabled: true | ||
418 | 12 | //property int headerHeight: units.gu(10); | 21 | //property int headerHeight: units.gu(10); |
419 | 13 | 22 | ||
420 | 14 | signal configChanged (bool changed) | 23 | signal configChanged (bool changed) |
421 | @@ -17,6 +26,13 @@ | |||
422 | 17 | 26 | ||
423 | 18 | Component.onCompleted: { | 27 | Component.onCompleted: { |
424 | 19 | slFont.value = jsConf.getFontSize(); | 28 | slFont.value = jsConf.getFontSize(); |
425 | 29 | effectsEnabled = jsConf.getEffectsEnabled(); | ||
426 | 30 | slCurvature.value = jsConf.getScreenCurvature(); | ||
427 | 31 | slBloom.value = jsConf.getBloom(); | ||
428 | 32 | slNoise.value = jsConf.getNoiseStrenght(); | ||
429 | 33 | slBrightnessFlickering.value = jsConf.getBrightnessFlickering(); | ||
430 | 34 | slJitter.value = jsConf.getJitter(); | ||
431 | 35 | slColorIntensity.value = jsConf.getColorIntensity(); | ||
432 | 20 | } | 36 | } |
433 | 21 | 37 | ||
434 | 22 | onColorSchemesChanged: { | 38 | onColorSchemesChanged: { |
435 | @@ -47,7 +63,7 @@ | |||
436 | 47 | 63 | ||
437 | 48 | text: i18n.tr("Color scheme") + ":" | 64 | text: i18n.tr("Color scheme") + ":" |
438 | 49 | onSelectedIndexChanged: { | 65 | onSelectedIndexChanged: { |
440 | 50 | if(colorSchemeLoaded) { | 66 | if(colorSchemeLoaded) { |
441 | 51 | var val = model[selectedIndex]; | 67 | var val = model[selectedIndex]; |
442 | 52 | jsConf.setColorScheme(val); | 68 | jsConf.setColorScheme(val); |
443 | 53 | configChanged(true); | 69 | configChanged(true); |
444 | @@ -83,7 +99,192 @@ | |||
445 | 83 | 99 | ||
446 | 84 | ListItem.ThinDivider { } | 100 | ListItem.ThinDivider { } |
447 | 85 | 101 | ||
448 | 102 | ListItem.Standard { | ||
449 | 103 | text: i18n.tr("Enable effects:") | ||
450 | 104 | control: Switch { | ||
451 | 105 | checked: effectsEnabled | ||
452 | 106 | onCheckedChanged: { | ||
453 | 107 | effectsEnabled = checked; | ||
454 | 108 | jsConf.setEffectsEnabled(checked); | ||
455 | 109 | mparent.configChanged(true); | ||
456 | 110 | } | ||
457 | 111 | } | ||
458 | 112 | } | ||
459 | 113 | |||
460 | 114 | ListItem.Standard { | ||
461 | 115 | text: i18n.tr("Screen color") | ||
462 | 116 | control: Button{ | ||
463 | 117 | color: colorDialog.selectedColor | ||
464 | 118 | onClicked: colorDialog.show(); | ||
465 | 119 | } | ||
466 | 120 | } | ||
467 | 121 | |||
468 | 122 | Label { | ||
469 | 123 | anchors { | ||
470 | 124 | left: parent.left | ||
471 | 125 | leftMargin: units.gu(2) | ||
472 | 126 | } | ||
473 | 127 | |||
474 | 128 | text: i18n.tr("Color intensity") + ":" | ||
475 | 129 | } | ||
476 | 130 | |||
477 | 131 | Slider{ | ||
478 | 132 | id: slColorIntensity | ||
479 | 133 | objectName: "slColorIntensity" | ||
480 | 134 | anchors { | ||
481 | 135 | left: parent.left | ||
482 | 136 | leftMargin: units.gu(2) | ||
483 | 137 | right: parent.right | ||
484 | 138 | rightMargin: units.gu(2) | ||
485 | 139 | } | ||
486 | 140 | minimumValue: 0.0; | ||
487 | 141 | maximumValue: 1.0; | ||
488 | 142 | onValueChanged: { | ||
489 | 143 | jsConf.setColorIntensity(value); | ||
490 | 144 | mparent.configChanged(true); | ||
491 | 145 | } | ||
492 | 146 | enabled: effectsEnabled | ||
493 | 147 | function formatValue(v){return v.toFixed(2);} | ||
494 | 148 | } | ||
495 | 149 | |||
496 | 150 | Label { | ||
497 | 151 | anchors { | ||
498 | 152 | left: parent.left | ||
499 | 153 | leftMargin: units.gu(2) | ||
500 | 154 | } | ||
501 | 155 | |||
502 | 156 | text: i18n.tr("Bloom") + ":" | ||
503 | 157 | } | ||
504 | 158 | |||
505 | 159 | Slider{ | ||
506 | 160 | id: slBloom | ||
507 | 161 | objectName: "slBloom" | ||
508 | 162 | anchors { | ||
509 | 163 | left: parent.left | ||
510 | 164 | leftMargin: units.gu(2) | ||
511 | 165 | right: parent.right | ||
512 | 166 | rightMargin: units.gu(2) | ||
513 | 167 | } | ||
514 | 168 | minimumValue: 0.0; | ||
515 | 169 | maximumValue: 1.0; | ||
516 | 170 | onValueChanged: { | ||
517 | 171 | jsConf.setBloom(value); | ||
518 | 172 | mparent.configChanged(true); | ||
519 | 173 | } | ||
520 | 174 | enabled: effectsEnabled | ||
521 | 175 | function formatValue(v){return v.toFixed(2);} | ||
522 | 176 | } | ||
523 | 177 | |||
524 | 178 | Label { | ||
525 | 179 | anchors { | ||
526 | 180 | left: parent.left | ||
527 | 181 | leftMargin: units.gu(2) | ||
528 | 182 | } | ||
529 | 183 | |||
530 | 184 | text: i18n.tr("Curvature") + ":" | ||
531 | 185 | } | ||
532 | 186 | |||
533 | 187 | Slider{ | ||
534 | 188 | id: slCurvature | ||
535 | 189 | objectName: "slCurvature" | ||
536 | 190 | anchors { | ||
537 | 191 | left: parent.left | ||
538 | 192 | leftMargin: units.gu(2) | ||
539 | 193 | right: parent.right | ||
540 | 194 | rightMargin: units.gu(2) | ||
541 | 195 | } | ||
542 | 196 | minimumValue: 0.0; | ||
543 | 197 | maximumValue: 1.0; | ||
544 | 198 | onValueChanged: { | ||
545 | 199 | jsConf.setScreenCurvature(value); | ||
546 | 200 | mparent.configChanged(true); | ||
547 | 201 | } | ||
548 | 202 | enabled: effectsEnabled | ||
549 | 203 | function formatValue(v){return v.toFixed(2);} | ||
550 | 204 | } | ||
551 | 205 | |||
552 | 206 | Label { | ||
553 | 207 | anchors { | ||
554 | 208 | left: parent.left | ||
555 | 209 | leftMargin: units.gu(2) | ||
556 | 210 | } | ||
557 | 211 | |||
558 | 212 | text: i18n.tr("Noise") + ":" | ||
559 | 213 | } | ||
560 | 214 | |||
561 | 215 | Slider{ | ||
562 | 216 | id: slNoise | ||
563 | 217 | objectName: "slNoise" | ||
564 | 218 | anchors { | ||
565 | 219 | left: parent.left | ||
566 | 220 | leftMargin: units.gu(2) | ||
567 | 221 | right: parent.right | ||
568 | 222 | rightMargin: units.gu(2) | ||
569 | 223 | } | ||
570 | 224 | minimumValue: 0.0; | ||
571 | 225 | maximumValue: 1.0; | ||
572 | 226 | onValueChanged: { | ||
573 | 227 | jsConf.setNoiseStrength(value); | ||
574 | 228 | mparent.configChanged(true); | ||
575 | 229 | } | ||
576 | 230 | enabled: effectsEnabled | ||
577 | 231 | function formatValue(v){return v.toFixed(2);} | ||
578 | 232 | } | ||
579 | 233 | |||
580 | 234 | Label { | ||
581 | 235 | anchors { | ||
582 | 236 | left: parent.left | ||
583 | 237 | leftMargin: units.gu(2) | ||
584 | 238 | } | ||
585 | 239 | |||
586 | 240 | text: i18n.tr("Jitter") + ":" | ||
587 | 241 | } | ||
588 | 242 | |||
589 | 243 | Slider{ | ||
590 | 244 | id: slJitter | ||
591 | 245 | objectName: "slJitter" | ||
592 | 246 | anchors { | ||
593 | 247 | left: parent.left | ||
594 | 248 | leftMargin: units.gu(2) | ||
595 | 249 | right: parent.right | ||
596 | 250 | rightMargin: units.gu(2) | ||
597 | 251 | } | ||
598 | 252 | minimumValue: 0.0; | ||
599 | 253 | maximumValue: 1.0; | ||
600 | 254 | onValueChanged: { | ||
601 | 255 | jsConf.setJitter(value); | ||
602 | 256 | mparent.configChanged(true); | ||
603 | 257 | } | ||
604 | 258 | enabled: effectsEnabled | ||
605 | 259 | function formatValue(v){return v.toFixed(2);} | ||
606 | 260 | } | ||
607 | 261 | |||
608 | 262 | Label { | ||
609 | 263 | anchors { | ||
610 | 264 | left: parent.left | ||
611 | 265 | leftMargin: units.gu(2) | ||
612 | 266 | } | ||
613 | 267 | |||
614 | 268 | text: i18n.tr("Brightness flickering") + ":" | ||
615 | 269 | } | ||
616 | 270 | |||
617 | 271 | Slider{ | ||
618 | 272 | id: slBrightnessFlickering | ||
619 | 273 | objectName: "slBrightnessFlickering" | ||
620 | 274 | anchors { | ||
621 | 275 | left: parent.left | ||
622 | 276 | leftMargin: units.gu(2) | ||
623 | 277 | right: parent.right | ||
624 | 278 | rightMargin: units.gu(2) | ||
625 | 279 | } | ||
626 | 280 | minimumValue: 0.0; | ||
627 | 281 | maximumValue: 1.0; | ||
628 | 282 | onValueChanged: { | ||
629 | 283 | jsConf.setBrightnessFlickering(value); | ||
630 | 284 | mparent.configChanged(true); | ||
631 | 285 | } | ||
632 | 286 | enabled: effectsEnabled | ||
633 | 287 | function formatValue(v){return v.toFixed(2);} | ||
634 | 288 | } | ||
635 | 86 | } | 289 | } |
636 | 87 | |||
637 | 88 | |||
638 | 89 | } | 290 | } |
639 | 90 | 291 | ||
640 | === added file 'src/app/qml/GraphicalTerminal.qml' | |||
641 | --- src/app/qml/GraphicalTerminal.qml 1970-01-01 00:00:00 +0000 | |||
642 | +++ src/app/qml/GraphicalTerminal.qml 2014-08-26 15:24:15 +0000 | |||
643 | @@ -0,0 +1,130 @@ | |||
644 | 1 | import QtQuick 2.2 | ||
645 | 2 | import QtGraphicalEffects 1.0 | ||
646 | 3 | |||
647 | 4 | Item{ | ||
648 | 5 | property var mainSource | ||
649 | 6 | property alias color_intensity: shaderTerminal.color_intensity | ||
650 | 7 | property alias bloom: shaderTerminal.bloom | ||
651 | 8 | property alias noise_strength: shaderTerminal.noise_strength | ||
652 | 9 | property alias screen_curvature: shaderTerminal.screen_curvature | ||
653 | 10 | property alias jitter: shaderTerminal.jitter | ||
654 | 11 | property alias brightness_flickering: shaderTerminal.brightness_flickering | ||
655 | 12 | property alias screen_color: shaderTerminal.screen_color | ||
656 | 13 | |||
657 | 14 | anchors.fill: parent | ||
658 | 15 | |||
659 | 16 | ShaderTerminal { | ||
660 | 17 | id: shaderTerminal | ||
661 | 18 | z: 10 | ||
662 | 19 | anchors.fill: parent | ||
663 | 20 | source: pgTermShaderSource | ||
664 | 21 | bloomSource: bloomSourceLoader.item | ||
665 | 22 | noiseSource: staticNoiseSourceLoader.item | ||
666 | 23 | randomSource: randTextureSourceLoader.item | ||
667 | 24 | } | ||
668 | 25 | |||
669 | 26 | ShaderEffectSource { | ||
670 | 27 | id: pgTermShaderSource | ||
671 | 28 | sourceItem: mainSource | ||
672 | 29 | } | ||
673 | 30 | |||
674 | 31 | Loader{ | ||
675 | 32 | id: bloomEffectLoader | ||
676 | 33 | active: bloom != 0 | ||
677 | 34 | anchors.fill: parent | ||
678 | 35 | sourceComponent: FastBlur{ | ||
679 | 36 | radius: 48 | ||
680 | 37 | source: mainSource | ||
681 | 38 | transparentBorder: true | ||
682 | 39 | smooth: false | ||
683 | 40 | } | ||
684 | 41 | } | ||
685 | 42 | |||
686 | 43 | Loader{ | ||
687 | 44 | id: bloomSourceLoader | ||
688 | 45 | active: bloom != 0 | ||
689 | 46 | sourceComponent: ShaderEffectSource{ | ||
690 | 47 | sourceItem: bloomEffectLoader.item | ||
691 | 48 | hideSource: true | ||
692 | 49 | smooth: false | ||
693 | 50 | } | ||
694 | 51 | } | ||
695 | 52 | |||
696 | 53 | Loader{ | ||
697 | 54 | id: staticNoiseEffectLoader | ||
698 | 55 | active: noise_strength != 0 || jitter != 0 | ||
699 | 56 | anchors.fill: parent | ||
700 | 57 | sourceComponent: ShaderEffect { | ||
701 | 58 | anchors.fill: parent | ||
702 | 59 | property size virtual_resolution: Qt.size(width, height) | ||
703 | 60 | |||
704 | 61 | blending: false | ||
705 | 62 | |||
706 | 63 | fragmentShader: | ||
707 | 64 | "uniform lowp float qt_Opacity; | ||
708 | 65 | varying highp vec2 qt_TexCoord0; | ||
709 | 66 | uniform highp vec2 virtual_resolution;" + | ||
710 | 67 | |||
711 | 68 | "highp float noise(vec2 co) | ||
712 | 69 | { | ||
713 | 70 | highp float a = 12.9898; | ||
714 | 71 | highp float b = 78.233; | ||
715 | 72 | highp float c = 43758.5453; | ||
716 | 73 | highp float dt= dot(co.xy ,vec2(a,b)); | ||
717 | 74 | highp float sn= mod(dt,3.14); | ||
718 | 75 | return fract(sin(sn) * c); | ||
719 | 76 | } | ||
720 | 77 | |||
721 | 78 | vec2 sw(vec2 p) {return vec2( floor(p.x) , floor(p.y) );} | ||
722 | 79 | vec2 se(vec2 p) {return vec2( ceil(p.x) , floor(p.y) );} | ||
723 | 80 | vec2 nw(vec2 p) {return vec2( floor(p.x) , ceil(p.y) );} | ||
724 | 81 | vec2 ne(vec2 p) {return vec2( ceil(p.x) , ceil(p.y) );} | ||
725 | 82 | |||
726 | 83 | float smoothNoise(vec2 p) { | ||
727 | 84 | vec2 inter = smoothstep(0., 1., fract(p)); | ||
728 | 85 | float s = mix(noise(sw(p)), noise(se(p)), inter.x); | ||
729 | 86 | float n = mix(noise(nw(p)), noise(ne(p)), inter.x); | ||
730 | 87 | return mix(s, n, inter.y); | ||
731 | 88 | }" + | ||
732 | 89 | |||
733 | 90 | "void main() {" + | ||
734 | 91 | " gl_FragColor.a = smoothNoise(qt_TexCoord0 * virtual_resolution);" + | ||
735 | 92 | "}" | ||
736 | 93 | |||
737 | 94 | onStatusChanged: if (log) console.log(log) //Print warning messages | ||
738 | 95 | } | ||
739 | 96 | } | ||
740 | 97 | |||
741 | 98 | Loader{ | ||
742 | 99 | id: staticNoiseSourceLoader | ||
743 | 100 | active: noise_strength != 0 || jitter != 0 | ||
744 | 101 | sourceComponent: ShaderEffectSource{ | ||
745 | 102 | sourceItem: staticNoiseEffectLoader.item | ||
746 | 103 | wrapMode: ShaderEffectSource.Repeat | ||
747 | 104 | smooth: true | ||
748 | 105 | } | ||
749 | 106 | } | ||
750 | 107 | |||
751 | 108 | Loader{ | ||
752 | 109 | id: randTextureLoader | ||
753 | 110 | active: brightness_flickering !== 0 | ||
754 | 111 | width: 512 | ||
755 | 112 | height: 512 | ||
756 | 113 | sourceComponent: Image{ | ||
757 | 114 | source: "images/randfunction.png" | ||
758 | 115 | sourceSize.width: 512 | ||
759 | 116 | sourceSize.height: 256 | ||
760 | 117 | fillMode: Image.TileVertically | ||
761 | 118 | } | ||
762 | 119 | } | ||
763 | 120 | Loader{ | ||
764 | 121 | id: randTextureSourceLoader | ||
765 | 122 | active: brightness_flickering !== 0 | ||
766 | 123 | sourceComponent: ShaderEffectSource{ | ||
767 | 124 | sourceItem: randTextureLoader.item | ||
768 | 125 | live: false | ||
769 | 126 | hideSource: true | ||
770 | 127 | wrapMode: ShaderEffectSource.Repeat | ||
771 | 128 | } | ||
772 | 129 | } | ||
773 | 130 | } | ||
774 | 0 | 131 | ||
775 | === added file 'src/app/qml/ShaderTerminal.qml' | |||
776 | --- src/app/qml/ShaderTerminal.qml 1970-01-01 00:00:00 +0000 | |||
777 | +++ src/app/qml/ShaderTerminal.qml 2014-08-26 15:24:15 +0000 | |||
778 | @@ -0,0 +1,143 @@ | |||
779 | 1 | /******************************************************************************* | ||
780 | 2 | * Copyright (c) 2013 "Filippo Scognamiglio" | ||
781 | 3 | * https://github.com/Swordifish90/cool-old-term | ||
782 | 4 | * | ||
783 | 5 | * This file is part of cool-old-term. | ||
784 | 6 | * | ||
785 | 7 | * cool-old-term is free software: you can redistribute it and/or modify | ||
786 | 8 | * it under the terms of the GNU General Public License as published by | ||
787 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
788 | 10 | * (at your option) any later version. | ||
789 | 11 | * | ||
790 | 12 | * This program is distributed in the hope that it will be useful, | ||
791 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
792 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
793 | 15 | * GNU General Public License for more details. | ||
794 | 16 | * | ||
795 | 17 | * You should have received a copy of the GNU General Public License | ||
796 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
797 | 19 | *******************************************************************************/ | ||
798 | 20 | |||
799 | 21 | import QtQuick 2.2 | ||
800 | 22 | import QtGraphicalEffects 1.0 | ||
801 | 23 | |||
802 | 24 | ShaderEffect { | ||
803 | 25 | property color screen_color | ||
804 | 26 | property real color_intensity | ||
805 | 27 | |||
806 | 28 | property variant source | ||
807 | 29 | property variant bloomSource | ||
808 | 30 | property variant noiseSource | ||
809 | 31 | property variant randomSource | ||
810 | 32 | |||
811 | 33 | property real bloom | ||
812 | 34 | property real jitter | ||
813 | 35 | property real noise_strength | ||
814 | 36 | property real screen_curvature | ||
815 | 37 | property real brightness_flickering | ||
816 | 38 | |||
817 | 39 | property real brightness: 0.5 * 1.5 + 0.5 | ||
818 | 40 | |||
819 | 41 | property real time: 0 | ||
820 | 42 | NumberAnimation on time { | ||
821 | 43 | from: 0; | ||
822 | 44 | to: 10000; | ||
823 | 45 | duration: 10000; | ||
824 | 46 | loops: Animation.Infinite; | ||
825 | 47 | running: noise_strength !== 0 || jitter !== 0 || brightness_flickering !== 0 | ||
826 | 48 | } | ||
827 | 49 | |||
828 | 50 | blending: false | ||
829 | 51 | |||
830 | 52 | //Print the number with a reasonable precision for the shader. | ||
831 | 53 | function str(num){ | ||
832 | 54 | return num.toFixed(8); | ||
833 | 55 | } | ||
834 | 56 | |||
835 | 57 | vertexShader: " | ||
836 | 58 | uniform highp mat4 qt_Matrix; | ||
837 | 59 | uniform highp float time;" + | ||
838 | 60 | |||
839 | 61 | (brightness_flickering !== 0 ? | ||
840 | 62 | "uniform sampler2D randomSource;" : "") + " | ||
841 | 63 | |||
842 | 64 | attribute highp vec4 qt_Vertex; | ||
843 | 65 | attribute highp vec2 qt_MultiTexCoord0; | ||
844 | 66 | |||
845 | 67 | varying highp vec2 qt_TexCoord0; | ||
846 | 68 | varying lowp float brightness;" + | ||
847 | 69 | |||
848 | 70 | (brightness_flickering !== 0.0 ?" | ||
849 | 71 | uniform lowp float brightness_flickering;" : "") + | ||
850 | 72 | " | ||
851 | 73 | void main() { | ||
852 | 74 | qt_TexCoord0 = qt_MultiTexCoord0; | ||
853 | 75 | brightness = 1.0;" + | ||
854 | 76 | (brightness_flickering !== 0.0 ? " | ||
855 | 77 | vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0))); | ||
856 | 78 | brightness += (texture2D(randomSource, coords).g - 0.5) * brightness_flickering;" | ||
857 | 79 | : "") + | ||
858 | 80 | |||
859 | 81 | "gl_Position = qt_Matrix * qt_Vertex; | ||
860 | 82 | }" | ||
861 | 83 | |||
862 | 84 | fragmentShader: " | ||
863 | 85 | uniform sampler2D source; | ||
864 | 86 | uniform highp float qt_Opacity; | ||
865 | 87 | uniform highp float time; | ||
866 | 88 | varying highp vec2 qt_TexCoord0; | ||
867 | 89 | varying highp float brightness; | ||
868 | 90 | |||
869 | 91 | uniform highp vec4 screen_color;" + | ||
870 | 92 | |||
871 | 93 | (bloom !== 0 ? " | ||
872 | 94 | uniform highp sampler2D bloomSource;" : "") + | ||
873 | 95 | (noise_strength !== 0 ? " | ||
874 | 96 | uniform highp float noise_strength;" : "") + | ||
875 | 97 | (noise_strength !== 0 || jitter !== 0 ? " | ||
876 | 98 | uniform lowp sampler2D noiseSource;" : "") + | ||
877 | 99 | (screen_curvature !== 0 ? " | ||
878 | 100 | uniform highp float screen_curvature;" : "")+ | ||
879 | 101 | |||
880 | 102 | "float rgb2grey(vec3 v){ | ||
881 | 103 | return dot(v, vec3(0.21, 0.72, 0.04)); | ||
882 | 104 | }" + | ||
883 | 105 | |||
884 | 106 | "vec3 computeColor(vec3 color){ | ||
885 | 107 | return mix(rgb2grey(color) * screen_color.rgb, color, "+str(color_intensity)+"); | ||
886 | 108 | }" + | ||
887 | 109 | |||
888 | 110 | "void main() {" + | ||
889 | 111 | "vec2 cc = vec2(0.5) - qt_TexCoord0;" + | ||
890 | 112 | "float distance = length(cc);" + | ||
891 | 113 | |||
892 | 114 | (noise_strength ? " | ||
893 | 115 | float noise = noise_strength;" : "") + | ||
894 | 116 | |||
895 | 117 | (screen_curvature !== 0 ? " | ||
896 | 118 | float distortion = dot(cc, cc) * screen_curvature; | ||
897 | 119 | vec2 coords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);" | ||
898 | 120 | :" | ||
899 | 121 | vec2 coords = qt_TexCoord0;") + | ||
900 | 122 | |||
901 | 123 | (jitter !== 0 ? " | ||
902 | 124 | vec2 offset = vec2(texture2D(noiseSource, coords + fract(time / 57.0)).a, | ||
903 | 125 | texture2D(noiseSource, coords + fract(time / 251.0)).a) - 0.5; | ||
904 | 126 | coords = coords + offset * "+str(jitter * 0.01)+";" | ||
905 | 127 | : "") + | ||
906 | 128 | |||
907 | 129 | "vec3 color = computeColor(texture2D(source, coords).rgb);" + | ||
908 | 130 | |||
909 | 131 | (noise_strength !== 0 ? " | ||
910 | 132 | float noiseVal = texture2D(noiseSource, qt_TexCoord0 + vec2(fract(time / 51.0), fract(time / 237.0))).a; | ||
911 | 133 | color += computeColor(vec3(noiseVal * noise * (1.0 - distance * 1.3)));" : "") + | ||
912 | 134 | |||
913 | 135 | (bloom !== 0 ? " | ||
914 | 136 | vec4 bloomColor = texture2D(bloomSource, coords); | ||
915 | 137 | color += computeColor(bloomColor.rgb) * bloomColor.a * " + str(bloom * 2.8) + ";" : "") + | ||
916 | 138 | |||
917 | 139 | "gl_FragColor = vec4(color * brightness *"+str(brightness)+", qt_Opacity); | ||
918 | 140 | }" | ||
919 | 141 | |||
920 | 142 | onStatusChanged: if (log) console.log(log) //Print warning messages | ||
921 | 143 | } | ||
922 | 0 | 144 | ||
923 | === modified file 'src/app/qml/Terminal.qml' | |||
924 | --- src/app/qml/Terminal.qml 2014-08-10 12:51:08 +0000 | |||
925 | +++ src/app/qml/Terminal.qml 2014-08-26 15:24:15 +0000 | |||
926 | @@ -7,8 +7,7 @@ | |||
927 | 7 | 7 | ||
928 | 8 | Item { | 8 | Item { |
929 | 9 | id: mparent | 9 | id: mparent |
932 | 10 | height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height | 10 | anchors.fill: parent |
931 | 11 | width: parent.width | ||
933 | 12 | 11 | ||
934 | 13 | function hideFocus(){ | 12 | function hideFocus(){ |
935 | 14 | kterm.focus = false; | 13 | kterm.focus = false; |
936 | @@ -188,7 +187,8 @@ | |||
937 | 188 | objectName: "cmenu" | 187 | objectName: "cmenu" |
938 | 189 | z: 99 | 188 | z: 99 |
939 | 190 | visible: false | 189 | visible: false |
941 | 191 | anchors.centerIn: parent | 190 | x: parent.x + (parent.width - width) / 2 |
942 | 191 | y: parent.y + (kterm.height - height) / 2 | ||
943 | 192 | circleButtonLable: "CTRL +" | 192 | circleButtonLable: "CTRL +" |
944 | 193 | sideButtons: ["A", "C", "D", "S", "X", "Z"] | 193 | sideButtons: ["A", "C", "D", "S", "X", "Z"] |
945 | 194 | 194 | ||
946 | @@ -224,32 +224,65 @@ | |||
947 | 224 | } | 224 | } |
948 | 225 | } | 225 | } |
949 | 226 | 226 | ||
972 | 227 | KTerminal { | 227 | Item{ |
973 | 228 | id: kterm | 228 | id: ktermContainer |
974 | 229 | objectName: "kterm" | 229 | anchors.fill: parent |
975 | 230 | 230 | ||
976 | 231 | ////////////////////////////////////// | 231 | KTerminal { |
977 | 232 | /// FONT SIZE = 24 (FINE FOR GNEXUS) | 232 | id: kterm |
978 | 233 | /// FONT SIZE = 12 (FINE FOR DESKTOP) | 233 | objectName: "kterm" |
979 | 234 | ////////////////////////////////////// | 234 | |
980 | 235 | font.family: "Ubuntu Mono" | 235 | ////////////////////////////////////// |
981 | 236 | font.pointSize: jsConf.getFontSize() //units.gu(1.5) | 236 | /// FONT SIZE = 24 (FINE FOR GNEXUS) |
982 | 237 | 237 | /// FONT SIZE = 12 (FINE FOR DESKTOP) | |
983 | 238 | colorScheme: jsConf.getColorScheme() //"DarkPastels" | 238 | ////////////////////////////////////// |
984 | 239 | width: parent.width | 239 | font.family: "Ubuntu Mono" |
985 | 240 | height: parent.height | 240 | font.pointSize: jsConf.getFontSize() //units.gu(1.5) |
986 | 241 | 241 | ||
987 | 242 | session: KSession { | 242 | colorScheme: jsConf.getColorScheme() //"DarkPastels" |
988 | 243 | id: ksession | 243 | width: parent.width |
989 | 244 | objectName: "ksession" | 244 | height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height |
990 | 245 | kbScheme: "linux" | 245 | |
991 | 246 | 246 | session: KSession { | |
992 | 247 | onFinished: { | 247 | id: ksession |
993 | 248 | Qt.quit() | 248 | objectName: "ksession" |
994 | 249 | kbScheme: "linux" | ||
995 | 250 | |||
996 | 251 | onFinished: { | ||
997 | 252 | Qt.quit() | ||
998 | 253 | } | ||
999 | 249 | } | 254 | } |
1000 | 250 | } | 255 | } |
1001 | 251 | } | 256 | } |
1002 | 252 | 257 | ||
1003 | 258 | Loader{ | ||
1004 | 259 | id: graphicalTerminal | ||
1005 | 260 | z: 1.1 | ||
1006 | 261 | active: true | ||
1007 | 262 | anchors.fill: ktermContainer | ||
1008 | 263 | source: "GraphicalTerminal.qml" | ||
1009 | 264 | onLoaded: { | ||
1010 | 265 | item.mainSource = ktermContainer; | ||
1011 | 266 | updateGraphicalParams(); | ||
1012 | 267 | } | ||
1013 | 268 | |||
1014 | 269 | function updateGraphicalParams(){ | ||
1015 | 270 | active = jsConf.getEffectsEnabled(); | ||
1016 | 271 | item.bloom = jsConf.getBloom(); | ||
1017 | 272 | item.noise_strength = jsConf.getNoiseStrenght() * 0.8; | ||
1018 | 273 | item.screen_curvature = jsConf.getScreenCurvature() * 0.3; | ||
1019 | 274 | item.jitter = jsConf.getJitter(); | ||
1020 | 275 | item.brightness_flickering = jsConf.getBrightnessFlickering() * 0.5; | ||
1021 | 276 | item.color_intensity = jsConf.getColorIntensity(); | ||
1022 | 277 | item.screen_color = jsConf.getScreenColor(); | ||
1023 | 278 | } | ||
1024 | 279 | |||
1025 | 280 | Connections { | ||
1026 | 281 | target: pgConf | ||
1027 | 282 | onConfigChanged: graphicalTerminal.updateGraphicalParams(); | ||
1028 | 283 | } | ||
1029 | 284 | } | ||
1030 | 285 | |||
1031 | 253 | MouseArea { | 286 | MouseArea { |
1032 | 254 | anchors.fill: parent | 287 | anchors.fill: parent |
1033 | 255 | enabled: true | 288 | enabled: true |
1034 | 256 | 289 | ||
1035 | === modified file 'src/app/qml/config/JsConfig.qml' | |||
1036 | --- src/app/qml/config/JsConfig.qml 2014-03-02 01:20:35 +0000 | |||
1037 | +++ src/app/qml/config/JsConfig.qml 2014-08-26 15:24:15 +0000 | |||
1038 | @@ -4,12 +4,19 @@ | |||
1039 | 4 | Item{ | 4 | Item{ |
1040 | 5 | DbEngine{id: dbEngine} | 5 | DbEngine{id: dbEngine} |
1041 | 6 | 6 | ||
1042 | 7 | function setSetting(name, strVal){ | ||
1043 | 8 | dbEngine.setConfig(name, strVal); | ||
1044 | 9 | } | ||
1045 | 10 | |||
1046 | 11 | function getSetting(name, defaultVal){ | ||
1047 | 12 | dbEngine.initialize(); | ||
1048 | 13 | var res = dbEngine.getConfig(name); | ||
1049 | 14 | return (res === "UNKNOWN" || res === "NaN" ) ? defaultVal : res; | ||
1050 | 15 | } | ||
1051 | 16 | |||
1052 | 7 | //ColorSchemes | 17 | //ColorSchemes |
1053 | 8 | function getColorScheme(){ | 18 | function getColorScheme(){ |
1058 | 9 | dbEngine.initialize() | 19 | return getSetting("colorScheme", "DarkPastels"); |
1055 | 10 | var res = dbEngine.getConfig("colorScheme"); | ||
1056 | 11 | if( res === "UNKNOWN" ) return "DarkPastels"; | ||
1057 | 12 | return res; | ||
1059 | 13 | } | 20 | } |
1060 | 14 | 21 | ||
1061 | 15 | function setColorScheme(scheme){ | 22 | function setColorScheme(scheme){ |
1062 | @@ -19,14 +26,82 @@ | |||
1063 | 19 | 26 | ||
1064 | 20 | //FontSize | 27 | //FontSize |
1065 | 21 | function getFontSize(){ | 28 | function getFontSize(){ |
1070 | 22 | dbEngine.initialize() | 29 | return parseInt(getSetting("fontSize", "14")); |
1067 | 23 | var res = dbEngine.getConfig("fontSize"); | ||
1068 | 24 | if( res === "UNKNOWN" || res === "NaN" ) return 14; | ||
1069 | 25 | else return parseInt(res); | ||
1071 | 26 | } | 30 | } |
1072 | 27 | 31 | ||
1073 | 28 | function setFontSize(size){ | 32 | function setFontSize(size){ |
1077 | 29 | dbEngine.setConfig("fontSize", Math.round(size).toString() ); | 33 | setSetting("fontSize", Math.round(size).toString() ); |
1078 | 30 | } | 34 | } |
1079 | 31 | 35 | ||
1080 | 36 | //Effects global switch | ||
1081 | 37 | function getEffectsEnabled(){ | ||
1082 | 38 | return getSetting("effectsEnabled", "true") === "true"; | ||
1083 | 39 | } | ||
1084 | 40 | |||
1085 | 41 | function setEffectsEnabled(enabled){ | ||
1086 | 42 | setSetting("effectsEnabled", enabled.toString() ); | ||
1087 | 43 | } | ||
1088 | 44 | |||
1089 | 45 | //Screen color | ||
1090 | 46 | function getScreenColor(){ | ||
1091 | 47 | return getSetting("screenColor", "#FFFFFF"); | ||
1092 | 48 | } | ||
1093 | 49 | |||
1094 | 50 | function setScreenColor(color){ | ||
1095 | 51 | setSetting("screenColor", color.toString() ); | ||
1096 | 52 | } | ||
1097 | 53 | |||
1098 | 54 | //Color intensity | ||
1099 | 55 | function getColorIntensity(){ | ||
1100 | 56 | return parseFloat(getSetting("colorIntensity", "0.2")); | ||
1101 | 57 | } | ||
1102 | 58 | |||
1103 | 59 | function setColorIntensity(intensity){ | ||
1104 | 60 | setSetting("colorIntensity", intensity.toString() ); | ||
1105 | 61 | } | ||
1106 | 62 | |||
1107 | 63 | //Bloom effect | ||
1108 | 64 | function getBloom(){ | ||
1109 | 65 | return parseFloat(getSetting("bloom", "0.4")); | ||
1110 | 66 | } | ||
1111 | 67 | |||
1112 | 68 | function setBloom(bloom){ | ||
1113 | 69 | setSetting("bloom", bloom.toString()); | ||
1114 | 70 | } | ||
1115 | 71 | |||
1116 | 72 | //Noise strength | ||
1117 | 73 | function getNoiseStrenght(){ | ||
1118 | 74 | return parseFloat(getSetting("noiseStrength", "0.0")); | ||
1119 | 75 | } | ||
1120 | 76 | |||
1121 | 77 | function setNoiseStrength(noiseStrength){ | ||
1122 | 78 | setSetting("noiseStrength", noiseStrength.toString() ); | ||
1123 | 79 | } | ||
1124 | 80 | |||
1125 | 81 | //Screen curvature | ||
1126 | 82 | function getScreenCurvature(){ | ||
1127 | 83 | return parseFloat(getSetting("screenCurvature", "0.2")); | ||
1128 | 84 | } | ||
1129 | 85 | |||
1130 | 86 | function setScreenCurvature(screenCurvature){ | ||
1131 | 87 | setSetting("screenCurvature", screenCurvature.toString() ) | ||
1132 | 88 | } | ||
1133 | 89 | |||
1134 | 90 | //Jitter | ||
1135 | 91 | function getJitter(){ | ||
1136 | 92 | return parseFloat(getSetting("jitter", "0.0")); | ||
1137 | 93 | } | ||
1138 | 94 | |||
1139 | 95 | function setJitter(jitter){ | ||
1140 | 96 | setSetting("jitter", jitter.toString() ) | ||
1141 | 97 | } | ||
1142 | 98 | |||
1143 | 99 | //Brightness flickering | ||
1144 | 100 | function getBrightnessFlickering(){ | ||
1145 | 101 | return parseFloat(getSetting("brightness_flickering", "0.0")); | ||
1146 | 102 | } | ||
1147 | 103 | |||
1148 | 104 | function setBrightnessFlickering(brightness_flickering){ | ||
1149 | 105 | setSetting("brightness_flickering", brightness_flickering.toString() ); | ||
1150 | 106 | } | ||
1151 | 32 | } | 107 | } |
1152 | 33 | 108 | ||
1153 | === added directory 'src/app/qml/images' | |||
1154 | === added file 'src/app/qml/images/randfunction.png' | |||
1155 | 34 | Binary files src/app/qml/images/randfunction.png 1970-01-01 00:00:00 +0000 and src/app/qml/images/randfunction.png 2014-08-26 15:24:15 +0000 differ | 109 | Binary files src/app/qml/images/randfunction.png 1970-01-01 00:00:00 +0000 and src/app/qml/images/randfunction.png 2014-08-26 15:24:15 +0000 differ |
1156 | === modified file 'src/app/qml/ubuntu-terminal-app.qml' | |||
1157 | --- src/app/qml/ubuntu-terminal-app.qml 2014-08-10 12:55:23 +0000 | |||
1158 | +++ src/app/qml/ubuntu-terminal-app.qml 2014-08-26 15:24:15 +0000 | |||
1159 | @@ -1,4 +1,5 @@ | |||
1161 | 1 | import QtQuick 2.0 | 1 | import QtQuick 2.2 |
1162 | 2 | import QtGraphicalEffects 1.0 | ||
1163 | 2 | import Ubuntu.Components 1.1 | 3 | import Ubuntu.Components 1.1 |
1164 | 3 | import Ubuntu.Components.Popups 0.1 | 4 | import Ubuntu.Components.Popups 0.1 |
1165 | 4 | 5 | ||
1166 | @@ -83,8 +84,11 @@ | |||
1167 | 83 | id: settingsPage | 84 | id: settingsPage |
1168 | 84 | visible: false | 85 | visible: false |
1169 | 85 | title: i18n.tr("Settings") | 86 | title: i18n.tr("Settings") |
1171 | 86 | Configs { id: pgConf } | 87 | Flickable{ |
1172 | 88 | anchors.fill: parent | ||
1173 | 89 | contentHeight: units.gu(110) | ||
1174 | 90 | Configs { id: pgConf } | ||
1175 | 91 | } | ||
1176 | 87 | } | 92 | } |
1177 | 88 | } | 93 | } |
1178 | 89 | |||
1179 | 90 | } | 94 | } |
1180 | 91 | 95 | ||
1181 | === modified file 'src/plugin/konsole/TerminalDisplay.cpp' | |||
1182 | --- src/plugin/konsole/TerminalDisplay.cpp 2014-04-27 09:11:14 +0000 | |||
1183 | +++ src/plugin/konsole/TerminalDisplay.cpp 2014-08-26 15:24:15 +0000 | |||
1184 | @@ -1582,11 +1582,11 @@ | |||
1185 | 1582 | _contentHeight = height() - 2 * DEFAULT_TOP_MARGIN + /* mysterious */ 1; | 1582 | _contentHeight = height() - 2 * DEFAULT_TOP_MARGIN + /* mysterious */ 1; |
1186 | 1583 | 1583 | ||
1187 | 1584 | // ensure that display is always at least one column wide | 1584 | // ensure that display is always at least one column wide |
1189 | 1585 | _columns = qMax(1, qRound(_contentWidth / _fontWidth)); | 1585 | _columns = qMax(1, qFloor(_contentWidth / (double)_fontWidth)); |
1190 | 1586 | _usedColumns = qMin(_usedColumns,_columns); | 1586 | _usedColumns = qMin(_usedColumns,_columns); |
1191 | 1587 | 1587 | ||
1192 | 1588 | // ensure that display is always at least one line high | 1588 | // ensure that display is always at least one line high |
1194 | 1589 | _lines = qMax(1, qRound(_contentHeight / (double)_fontHeight)); | 1589 | _lines = qMax(1, qFloor(_contentHeight / (double)_fontHeight)); |
1195 | 1590 | _usedLines = qMin(_usedLines,_lines); | 1590 | _usedLines = qMin(_usedLines,_lines); |
1196 | 1591 | } | 1591 | } |
1197 | 1592 | 1592 |
Looks like you had a merge conflict that needs resolving.