Merge lp:~flscogna/ubuntu-terminal-app/ubuntu-terminal-app into lp:ubuntu-terminal-app

Proposed by Filippo Scognamiglio
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
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.

To post a comment you must log in.
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Looks like you had a merge conflict that needs resolving.

Revision history for this message
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?

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tested this out on the desktop and device and it works great! Thanks Filippo!

review: Approve
Revision history for this message
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://code.launchpad.net/~flscogna/ubuntu-terminal-app/ubuntu-terminal-app/+merge/232215/+edit-commit-message

http://91.189.93.70:8080/job/ubuntu-terminal-app-ci/80/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/generic-mediumtests-utopic/1706
        deb: http://91.189.93.70:8080/job/generic-mediumtests-utopic/1706/artifact/work/output/*zip*/output.zip
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-terminal-app-utopic-amd64-ci/24

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/ubuntu-terminal-app-ci/80/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

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

Subscribers

People subscribed via source and target branches