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
=== modified file 'apparmor.json'
--- apparmor.json 2014-07-02 12:30:36 +0000
+++ apparmor.json 2014-08-26 15:24:15 +0000
@@ -2,4 +2,4 @@
2 "policy_groups": [],2 "policy_groups": [],
3 "policy_version": 1.2,3 "policy_version": 1.2,
4 "template": "unconfined"4 "template": "unconfined"
5}5}
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'po/com.ubuntu.terminal.pot'
--- po/com.ubuntu.terminal.pot 2014-08-25 12:56:56 +0000
+++ po/com.ubuntu.terminal.pot 2014-08-26 15:24:15 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-08-25 13:55+0100\n"11"POT-Creation-Date: 2014-08-26 17:06+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,95 +17,139 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: ../src/app/qml/Configs.qml:4820#: ../src/app/qml/ColorDialog.qml:25
21msgid "Pick a color"
22msgstr ""
23
24#: ../src/app/qml/ColorDialog.qml:129
25msgid "OK"
26msgstr ""
27
28#: ../src/app/qml/ColorDialog.qml:149
29msgid "Cancel"
30msgstr ""
31
32#: ../src/app/qml/Configs.qml:64
21msgid "Color scheme"33msgid "Color scheme"
22msgstr ""34msgstr ""
2335
24#: ../src/app/qml/Configs.qml:6436#: ../src/app/qml/Configs.qml:80
25msgid "Font size"37msgid "Font size"
26msgstr ""38msgstr ""
2739
28#: ../src/app/qml/Terminal.qml:34440#: ../src/app/qml/Configs.qml:103
41msgid "Enable effects:"
42msgstr ""
43
44#: ../src/app/qml/Configs.qml:115
45msgid "Screen color"
46msgstr ""
47
48#: ../src/app/qml/Configs.qml:128
49msgid "Color intensity"
50msgstr ""
51
52#: ../src/app/qml/Configs.qml:156
53msgid "Bloom"
54msgstr ""
55
56#: ../src/app/qml/Configs.qml:184
57msgid "Curvature"
58msgstr ""
59
60#: ../src/app/qml/Configs.qml:212
61msgid "Noise"
62msgstr ""
63
64#: ../src/app/qml/Configs.qml:240
65msgid "Jitter"
66msgstr ""
67
68#: ../src/app/qml/Configs.qml:268
69msgid "Brightness flickering"
70msgstr ""
71
72#: ../src/app/qml/Terminal.qml:377
29msgid "Upload Crash Reports"73msgid "Upload Crash Reports"
30msgstr ""74msgstr ""
3175
32#: ../src/app/qml/Terminal.qml:34576#: ../src/app/qml/Terminal.qml:378
33msgid "Whoopsie;Apport;Debugging;Bugs"77msgid "Whoopsie;Apport;Debugging;Bugs"
34msgstr ""78msgstr ""
3579
36#: ../src/app/qml/Terminal.qml:34980#: ../src/app/qml/Terminal.qml:382
37msgid "Make Image Writable"81msgid "Make Image Writable"
38msgstr ""82msgstr ""
3983
40#: ../src/app/qml/Terminal.qml:35084#: ../src/app/qml/Terminal.qml:383
41msgid "System Image;Install Deb"85msgid "System Image;Install Deb"
42msgstr ""86msgstr ""
4387
44#: ../src/app/qml/Terminal.qml:35488#: ../src/app/qml/Terminal.qml:387
45msgid "List Running Applications"89msgid "List Running Applications"
46msgstr ""90msgstr ""
4791
48#: ../src/app/qml/Terminal.qml:35592#: ../src/app/qml/Terminal.qml:388
49msgid "Apps"93msgid "Apps"
50msgstr ""94msgstr ""
5195
52#: ../src/app/qml/Terminal.qml:35996#: ../src/app/qml/Terminal.qml:392
53msgid "Installed Click Packages"97msgid "Installed Click Packages"
54msgstr ""98msgstr ""
5599
56#: ../src/app/qml/Terminal.qml:360100#: ../src/app/qml/Terminal.qml:393
57msgid "Packages;Applications;Utilities"101msgid "Packages;Applications;Utilities"
58msgstr ""102msgstr ""
59103
60#: ../src/app/qml/Terminal.qml:364104#: ../src/app/qml/Terminal.qml:397
61msgid "System Image Information"105msgid "System Image Information"
62msgstr ""106msgstr ""
63107
64#: ../src/app/qml/Terminal.qml:365108#: ../src/app/qml/Terminal.qml:398
65msgid "Image;Version;Channel"109msgid "Image;Version;Channel"
66msgstr ""110msgstr ""
67111
68#: ../src/app/qml/Terminal.qml:369112#: ../src/app/qml/Terminal.qml:402
69msgid "System Kernel Version"113msgid "System Kernel Version"
70msgstr ""114msgstr ""
71115
72#: ../src/app/qml/Terminal.qml:373116#: ../src/app/qml/Terminal.qml:406
73msgid "Upstart Job Status"117msgid "Upstart Job Status"
74msgstr ""118msgstr ""
75119
76#: ../src/app/qml/Terminal.qml:374120#: ../src/app/qml/Terminal.qml:407
77msgid "Init;Session;User Job"121msgid "Init;Session;User Job"
78msgstr ""122msgstr ""
79123
80#: ../src/app/qml/Terminal.qml:378124#: ../src/app/qml/Terminal.qml:411
81msgid "Hack into the NSA"125msgid "Hack into the NSA"
82msgstr ""126msgstr ""
83127
84#: ../src/app/qml/Terminal.qml:379128#: ../src/app/qml/Terminal.qml:412
85msgid "Government;Secret;Cracking"129msgid "Government;Secret;Cracking"
86msgstr ""130msgstr ""
87131
88#: ../src/app/qml/Terminal.qml:383132#: ../src/app/qml/Terminal.qml:416
89msgid "Watch Running Processes"133msgid "Watch Running Processes"
90msgstr ""134msgstr ""
91135
92#: ../src/app/qml/Terminal.qml:384136#: ../src/app/qml/Terminal.qml:417
93msgid "Top;Memory;Usage"137msgid "Top;Memory;Usage"
94msgstr ""138msgstr ""
95139
96#: ../src/app/qml/Terminal.qml:388140#: ../src/app/qml/Terminal.qml:421
97msgid "Networking Status"141msgid "Networking Status"
98msgstr ""142msgstr ""
99143
100#: ../src/app/qml/Terminal.qml:389144#: ../src/app/qml/Terminal.qml:422
101msgid "Wireless;Ethernet;Access Points"145msgid "Wireless;Ethernet;Access Points"
102msgstr ""146msgstr ""
103147
104#: ../src/app/qml/Terminal.qml:393148#: ../src/app/qml/Terminal.qml:426
105msgid "Watch Star Wars Episode IV"149msgid "Watch Star Wars Episode IV"
106msgstr ""150msgstr ""
107151
108#: ../src/app/qml/Terminal.qml:394152#: ../src/app/qml/Terminal.qml:427
109msgid "Death Star;Skywalker;Leia;Darth Vader"153msgid "Death Star;Skywalker;Leia;Darth Vader"
110msgstr ""154msgstr ""
111155
@@ -133,33 +177,30 @@
133msgid "END"177msgid "END"
134msgstr ""178msgstr ""
135179
136#: ../src/app/qml/ubuntu-terminal-app.qml:29
137#: com.ubuntu.terminal.desktop.in.in.h:1180#: com.ubuntu.terminal.desktop.in.in.h:1
138msgid "Terminal"181msgid "Terminal"
139msgstr ""182msgstr ""
140183
141#: ../src/app/qml/ubuntu-terminal-app.qml:48184#: ../src/app/qml/ubuntu-terminal-app.qml:86
142#: ../src/app/qml/ubuntu-terminal-app.qml:85
143msgid "Settings"185msgid "Settings"
144msgstr ""186msgstr ""
145187
146#: ../src/app/qml/ubuntu-terminal-app.qml:54188#: ../src/app/qml/ubuntu-terminal-app.qml:55
147msgid "Hide all key panels"189msgid "Hide all key panels"
148msgstr ""190msgstr ""
149191
150#: ../src/app/qml/ubuntu-terminal-app.qml:61192#: ../src/app/qml/ubuntu-terminal-app.qml:62
151msgid "Control keys"193msgid "Control keys"
152msgstr ""194msgstr ""
153195
154#: ../src/app/qml/ubuntu-terminal-app.qml:68196#: ../src/app/qml/ubuntu-terminal-app.qml:69
155msgid "Function keys"197msgid "Function keys"
156msgstr ""198msgstr ""
157199
158#: ../src/app/qml/ubuntu-terminal-app.qml:75200#: ../src/app/qml/ubuntu-terminal-app.qml:76
159msgid "Arrow keys"201msgid "Arrow keys"
160msgstr ""202msgstr ""
161203
162#: ../src/plugin/konsole/ColorScheme.cpp:276
163#: ../src/plugin/konsole/ColorScheme.cpp:291204#: ../src/plugin/konsole/ColorScheme.cpp:291
164msgid "Un-named Color Scheme"205msgid "Un-named Color Scheme"
165msgstr ""206msgstr ""
166207
=== added file 'src/app/qml/ColorDialog.qml'
--- src/app/qml/ColorDialog.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/ColorDialog.qml 2014-08-26 15:24:15 +0000
@@ -0,0 +1,166 @@
1/*
2 This file is part of quick-memo
3 Copyright (C) 2014 Stefano Verzegnassi
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License 3 as published by
7 the Free Software Foundation.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see http://www.gnu.org/licenses/.
16*/
17
18import QtQuick 2.0
19import Ubuntu.Components 1.1
20import Ubuntu.Components.Popups 1.0
21
22Dialog {
23 id: rootItem
24
25 title: i18n.tr("Pick a color")
26
27 property var colors: ["#0CCC68", "#ffffff", "#61E4FF", "#FFB361", "#FF61E3"]
28 property color selectedColor: colors[0]
29
30 property bool showTick: true
31 property bool askConfirmation: false
32
33 signal colorPicked(bool isChanged)
34
35 onSelectedColorChanged: view.setCurrentColor()
36 Component.onCompleted: internal.oldColor = rootItem.selectedColor
37
38 QtObject {
39 id: internal
40
41 property color oldColor
42 }
43
44 Grid {
45 id: grid
46 width: parent.width
47
48 columns: (width / cellWidth).toFixed(0)
49
50 property int cellHeight: units.gu(5)
51 property int cellWidth: units.gu(5)
52
53 Repeater {
54 id: view
55
56 width: parent.width
57
58 Component.onCompleted: setCurrentColor()
59
60 function setCurrentColor() {
61 if (rootItem.colors) {
62 for (var i=0; i<rootItem.colors.length; i++) {
63 if (rootItem.colors[i] == rootItem.selectedColor) {
64 view.currentIndex = i
65 }
66 }
67 }
68 }
69
70 model: rootItem.colors
71
72 property int currentIndex: 0
73
74 delegate: AbstractButton {
75 id: delegate
76
77 height: grid.cellHeight
78 width: grid.cellWidth
79
80 onClicked: {
81 view.currentIndex = model.index
82
83 if (!rootItem.askConfirmation) {
84 rootItem.selectedColor = rootItem.colors[view.currentIndex]
85
86 if (internal.oldColor == rootItem.selectedColor) {
87 rootItem.colorPicked(false)
88 } else {
89 rootItem.colorPicked(true)
90 }
91
92 rootItem.hide()
93 }
94 }
95
96 UbuntuShape {
97 anchors { fill: parent; margins: units.gu(0.5)}
98 color: modelData
99 clip: true
100
101 Icon {
102 id: tick
103 anchors { fill: parent; margins: units.gu(0.5) }
104 name: "tick"
105 visible: view.currentIndex == model.index && rootItem.showTick
106 color: getColor()
107
108 function getColor() {
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)
110 }
111 }
112 }
113 }
114 }
115 }
116
117 Column {
118 width: parent.width
119 spacing: units.gu(2)
120
121 Loader {
122 width: parent.width
123 sourceComponent: if (askConfirmation) return confirmationButtons
124
125 Component {
126 id: confirmationButtons
127 Button {
128 width: parent.width
129 text: i18n.tr("OK")
130 color: UbuntuColors.orange
131
132 onClicked: {
133 rootItem.selectedColor = rootItem.colors[view.currentIndex]
134
135 if (internal.oldColor == rootItem.selectedColor) {
136 rootItem.colorPicked(false)
137 } else {
138 rootItem.colorPicked(true)
139 }
140
141 rootItem.hide()
142 }
143 }
144 }
145 }
146
147 Button {
148 width: parent.width
149 text: i18n.tr("Cancel")
150
151 onClicked: {
152 rootItem.hide()
153
154 for (var i=0; i<rootItem.colors.length; i++) {
155 if (rootItem.colors[i] == internal.oldColor) {
156 view.currentIndex = i
157 }
158 }
159 rootItem.selectedColor = internal.oldColor
160 }
161 }
162 }
163
164
165
166}
0167
=== modified file 'src/app/qml/Configs.qml'
--- src/app/qml/Configs.qml 2014-04-27 09:11:14 +0000
+++ src/app/qml/Configs.qml 2014-08-26 15:24:15 +0000
@@ -6,9 +6,18 @@
6Item {6Item {
7 id: mparent7 id: mparent
8 JsConfig{id: jsConf }8 JsConfig{id: jsConf }
9 ColorDialog{
10 id: colorDialog
11 selectedColor: jsConf.getScreenColor();
12 onSelectedColorChanged: {
13 jsConf.setScreenColor(selectedColor);
14 configChanged(true);
15 }
16 }
917
10 property var colorSchemes;18 property var colorSchemes;
11 property bool colorSchemeLoaded: false;19 property bool colorSchemeLoaded: false;
20 property bool effectsEnabled: true
12 //property int headerHeight: units.gu(10);21 //property int headerHeight: units.gu(10);
1322
14 signal configChanged (bool changed)23 signal configChanged (bool changed)
@@ -17,6 +26,13 @@
1726
18 Component.onCompleted: {27 Component.onCompleted: {
19 slFont.value = jsConf.getFontSize();28 slFont.value = jsConf.getFontSize();
29 effectsEnabled = jsConf.getEffectsEnabled();
30 slCurvature.value = jsConf.getScreenCurvature();
31 slBloom.value = jsConf.getBloom();
32 slNoise.value = jsConf.getNoiseStrenght();
33 slBrightnessFlickering.value = jsConf.getBrightnessFlickering();
34 slJitter.value = jsConf.getJitter();
35 slColorIntensity.value = jsConf.getColorIntensity();
20 }36 }
2137
22 onColorSchemesChanged: {38 onColorSchemesChanged: {
@@ -47,7 +63,7 @@
4763
48 text: i18n.tr("Color scheme") + ":"64 text: i18n.tr("Color scheme") + ":"
49 onSelectedIndexChanged: {65 onSelectedIndexChanged: {
50 if(colorSchemeLoaded) { 66 if(colorSchemeLoaded) {
51 var val = model[selectedIndex];67 var val = model[selectedIndex];
52 jsConf.setColorScheme(val);68 jsConf.setColorScheme(val);
53 configChanged(true);69 configChanged(true);
@@ -83,7 +99,192 @@
8399
84 ListItem.ThinDivider { }100 ListItem.ThinDivider { }
85101
102 ListItem.Standard {
103 text: i18n.tr("Enable effects:")
104 control: Switch {
105 checked: effectsEnabled
106 onCheckedChanged: {
107 effectsEnabled = checked;
108 jsConf.setEffectsEnabled(checked);
109 mparent.configChanged(true);
110 }
111 }
112 }
113
114 ListItem.Standard {
115 text: i18n.tr("Screen color")
116 control: Button{
117 color: colorDialog.selectedColor
118 onClicked: colorDialog.show();
119 }
120 }
121
122 Label {
123 anchors {
124 left: parent.left
125 leftMargin: units.gu(2)
126 }
127
128 text: i18n.tr("Color intensity") + ":"
129 }
130
131 Slider{
132 id: slColorIntensity
133 objectName: "slColorIntensity"
134 anchors {
135 left: parent.left
136 leftMargin: units.gu(2)
137 right: parent.right
138 rightMargin: units.gu(2)
139 }
140 minimumValue: 0.0;
141 maximumValue: 1.0;
142 onValueChanged: {
143 jsConf.setColorIntensity(value);
144 mparent.configChanged(true);
145 }
146 enabled: effectsEnabled
147 function formatValue(v){return v.toFixed(2);}
148 }
149
150 Label {
151 anchors {
152 left: parent.left
153 leftMargin: units.gu(2)
154 }
155
156 text: i18n.tr("Bloom") + ":"
157 }
158
159 Slider{
160 id: slBloom
161 objectName: "slBloom"
162 anchors {
163 left: parent.left
164 leftMargin: units.gu(2)
165 right: parent.right
166 rightMargin: units.gu(2)
167 }
168 minimumValue: 0.0;
169 maximumValue: 1.0;
170 onValueChanged: {
171 jsConf.setBloom(value);
172 mparent.configChanged(true);
173 }
174 enabled: effectsEnabled
175 function formatValue(v){return v.toFixed(2);}
176 }
177
178 Label {
179 anchors {
180 left: parent.left
181 leftMargin: units.gu(2)
182 }
183
184 text: i18n.tr("Curvature") + ":"
185 }
186
187 Slider{
188 id: slCurvature
189 objectName: "slCurvature"
190 anchors {
191 left: parent.left
192 leftMargin: units.gu(2)
193 right: parent.right
194 rightMargin: units.gu(2)
195 }
196 minimumValue: 0.0;
197 maximumValue: 1.0;
198 onValueChanged: {
199 jsConf.setScreenCurvature(value);
200 mparent.configChanged(true);
201 }
202 enabled: effectsEnabled
203 function formatValue(v){return v.toFixed(2);}
204 }
205
206 Label {
207 anchors {
208 left: parent.left
209 leftMargin: units.gu(2)
210 }
211
212 text: i18n.tr("Noise") + ":"
213 }
214
215 Slider{
216 id: slNoise
217 objectName: "slNoise"
218 anchors {
219 left: parent.left
220 leftMargin: units.gu(2)
221 right: parent.right
222 rightMargin: units.gu(2)
223 }
224 minimumValue: 0.0;
225 maximumValue: 1.0;
226 onValueChanged: {
227 jsConf.setNoiseStrength(value);
228 mparent.configChanged(true);
229 }
230 enabled: effectsEnabled
231 function formatValue(v){return v.toFixed(2);}
232 }
233
234 Label {
235 anchors {
236 left: parent.left
237 leftMargin: units.gu(2)
238 }
239
240 text: i18n.tr("Jitter") + ":"
241 }
242
243 Slider{
244 id: slJitter
245 objectName: "slJitter"
246 anchors {
247 left: parent.left
248 leftMargin: units.gu(2)
249 right: parent.right
250 rightMargin: units.gu(2)
251 }
252 minimumValue: 0.0;
253 maximumValue: 1.0;
254 onValueChanged: {
255 jsConf.setJitter(value);
256 mparent.configChanged(true);
257 }
258 enabled: effectsEnabled
259 function formatValue(v){return v.toFixed(2);}
260 }
261
262 Label {
263 anchors {
264 left: parent.left
265 leftMargin: units.gu(2)
266 }
267
268 text: i18n.tr("Brightness flickering") + ":"
269 }
270
271 Slider{
272 id: slBrightnessFlickering
273 objectName: "slBrightnessFlickering"
274 anchors {
275 left: parent.left
276 leftMargin: units.gu(2)
277 right: parent.right
278 rightMargin: units.gu(2)
279 }
280 minimumValue: 0.0;
281 maximumValue: 1.0;
282 onValueChanged: {
283 jsConf.setBrightnessFlickering(value);
284 mparent.configChanged(true);
285 }
286 enabled: effectsEnabled
287 function formatValue(v){return v.toFixed(2);}
288 }
86 }289 }
87
88
89}290}
90291
=== added file 'src/app/qml/GraphicalTerminal.qml'
--- src/app/qml/GraphicalTerminal.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/GraphicalTerminal.qml 2014-08-26 15:24:15 +0000
@@ -0,0 +1,130 @@
1import QtQuick 2.2
2import QtGraphicalEffects 1.0
3
4Item{
5 property var mainSource
6 property alias color_intensity: shaderTerminal.color_intensity
7 property alias bloom: shaderTerminal.bloom
8 property alias noise_strength: shaderTerminal.noise_strength
9 property alias screen_curvature: shaderTerminal.screen_curvature
10 property alias jitter: shaderTerminal.jitter
11 property alias brightness_flickering: shaderTerminal.brightness_flickering
12 property alias screen_color: shaderTerminal.screen_color
13
14 anchors.fill: parent
15
16 ShaderTerminal {
17 id: shaderTerminal
18 z: 10
19 anchors.fill: parent
20 source: pgTermShaderSource
21 bloomSource: bloomSourceLoader.item
22 noiseSource: staticNoiseSourceLoader.item
23 randomSource: randTextureSourceLoader.item
24 }
25
26 ShaderEffectSource {
27 id: pgTermShaderSource
28 sourceItem: mainSource
29 }
30
31 Loader{
32 id: bloomEffectLoader
33 active: bloom != 0
34 anchors.fill: parent
35 sourceComponent: FastBlur{
36 radius: 48
37 source: mainSource
38 transparentBorder: true
39 smooth: false
40 }
41 }
42
43 Loader{
44 id: bloomSourceLoader
45 active: bloom != 0
46 sourceComponent: ShaderEffectSource{
47 sourceItem: bloomEffectLoader.item
48 hideSource: true
49 smooth: false
50 }
51 }
52
53 Loader{
54 id: staticNoiseEffectLoader
55 active: noise_strength != 0 || jitter != 0
56 anchors.fill: parent
57 sourceComponent: ShaderEffect {
58 anchors.fill: parent
59 property size virtual_resolution: Qt.size(width, height)
60
61 blending: false
62
63 fragmentShader:
64 "uniform lowp float qt_Opacity;
65 varying highp vec2 qt_TexCoord0;
66 uniform highp vec2 virtual_resolution;" +
67
68 "highp float noise(vec2 co)
69 {
70 highp float a = 12.9898;
71 highp float b = 78.233;
72 highp float c = 43758.5453;
73 highp float dt= dot(co.xy ,vec2(a,b));
74 highp float sn= mod(dt,3.14);
75 return fract(sin(sn) * c);
76 }
77
78 vec2 sw(vec2 p) {return vec2( floor(p.x) , floor(p.y) );}
79 vec2 se(vec2 p) {return vec2( ceil(p.x) , floor(p.y) );}
80 vec2 nw(vec2 p) {return vec2( floor(p.x) , ceil(p.y) );}
81 vec2 ne(vec2 p) {return vec2( ceil(p.x) , ceil(p.y) );}
82
83 float smoothNoise(vec2 p) {
84 vec2 inter = smoothstep(0., 1., fract(p));
85 float s = mix(noise(sw(p)), noise(se(p)), inter.x);
86 float n = mix(noise(nw(p)), noise(ne(p)), inter.x);
87 return mix(s, n, inter.y);
88 }" +
89
90 "void main() {" +
91 " gl_FragColor.a = smoothNoise(qt_TexCoord0 * virtual_resolution);" +
92 "}"
93
94 onStatusChanged: if (log) console.log(log) //Print warning messages
95 }
96 }
97
98 Loader{
99 id: staticNoiseSourceLoader
100 active: noise_strength != 0 || jitter != 0
101 sourceComponent: ShaderEffectSource{
102 sourceItem: staticNoiseEffectLoader.item
103 wrapMode: ShaderEffectSource.Repeat
104 smooth: true
105 }
106 }
107
108 Loader{
109 id: randTextureLoader
110 active: brightness_flickering !== 0
111 width: 512
112 height: 512
113 sourceComponent: Image{
114 source: "images/randfunction.png"
115 sourceSize.width: 512
116 sourceSize.height: 256
117 fillMode: Image.TileVertically
118 }
119 }
120 Loader{
121 id: randTextureSourceLoader
122 active: brightness_flickering !== 0
123 sourceComponent: ShaderEffectSource{
124 sourceItem: randTextureLoader.item
125 live: false
126 hideSource: true
127 wrapMode: ShaderEffectSource.Repeat
128 }
129 }
130}
0131
=== added file 'src/app/qml/ShaderTerminal.qml'
--- src/app/qml/ShaderTerminal.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/ShaderTerminal.qml 2014-08-26 15:24:15 +0000
@@ -0,0 +1,143 @@
1/*******************************************************************************
2* Copyright (c) 2013 "Filippo Scognamiglio"
3* https://github.com/Swordifish90/cool-old-term
4*
5* This file is part of cool-old-term.
6*
7* cool-old-term is free software: you can redistribute it and/or modify
8* it under the terms of the GNU General Public License as published by
9* the Free Software Foundation, either version 3 of the License, or
10* (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*******************************************************************************/
20
21import QtQuick 2.2
22import QtGraphicalEffects 1.0
23
24ShaderEffect {
25 property color screen_color
26 property real color_intensity
27
28 property variant source
29 property variant bloomSource
30 property variant noiseSource
31 property variant randomSource
32
33 property real bloom
34 property real jitter
35 property real noise_strength
36 property real screen_curvature
37 property real brightness_flickering
38
39 property real brightness: 0.5 * 1.5 + 0.5
40
41 property real time: 0
42 NumberAnimation on time {
43 from: 0;
44 to: 10000;
45 duration: 10000;
46 loops: Animation.Infinite;
47 running: noise_strength !== 0 || jitter !== 0 || brightness_flickering !== 0
48 }
49
50 blending: false
51
52 //Print the number with a reasonable precision for the shader.
53 function str(num){
54 return num.toFixed(8);
55 }
56
57 vertexShader: "
58 uniform highp mat4 qt_Matrix;
59 uniform highp float time;" +
60
61 (brightness_flickering !== 0 ?
62 "uniform sampler2D randomSource;" : "") + "
63
64 attribute highp vec4 qt_Vertex;
65 attribute highp vec2 qt_MultiTexCoord0;
66
67 varying highp vec2 qt_TexCoord0;
68 varying lowp float brightness;" +
69
70 (brightness_flickering !== 0.0 ?"
71 uniform lowp float brightness_flickering;" : "") +
72 "
73 void main() {
74 qt_TexCoord0 = qt_MultiTexCoord0;
75 brightness = 1.0;" +
76 (brightness_flickering !== 0.0 ? "
77 vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
78 brightness += (texture2D(randomSource, coords).g - 0.5) * brightness_flickering;"
79 : "") +
80
81 "gl_Position = qt_Matrix * qt_Vertex;
82 }"
83
84 fragmentShader: "
85 uniform sampler2D source;
86 uniform highp float qt_Opacity;
87 uniform highp float time;
88 varying highp vec2 qt_TexCoord0;
89 varying highp float brightness;
90
91 uniform highp vec4 screen_color;" +
92
93 (bloom !== 0 ? "
94 uniform highp sampler2D bloomSource;" : "") +
95 (noise_strength !== 0 ? "
96 uniform highp float noise_strength;" : "") +
97 (noise_strength !== 0 || jitter !== 0 ? "
98 uniform lowp sampler2D noiseSource;" : "") +
99 (screen_curvature !== 0 ? "
100 uniform highp float screen_curvature;" : "")+
101
102 "float rgb2grey(vec3 v){
103 return dot(v, vec3(0.21, 0.72, 0.04));
104 }" +
105
106 "vec3 computeColor(vec3 color){
107 return mix(rgb2grey(color) * screen_color.rgb, color, "+str(color_intensity)+");
108 }" +
109
110 "void main() {" +
111 "vec2 cc = vec2(0.5) - qt_TexCoord0;" +
112 "float distance = length(cc);" +
113
114 (noise_strength ? "
115 float noise = noise_strength;" : "") +
116
117 (screen_curvature !== 0 ? "
118 float distortion = dot(cc, cc) * screen_curvature;
119 vec2 coords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);"
120 :"
121 vec2 coords = qt_TexCoord0;") +
122
123 (jitter !== 0 ? "
124 vec2 offset = vec2(texture2D(noiseSource, coords + fract(time / 57.0)).a,
125 texture2D(noiseSource, coords + fract(time / 251.0)).a) - 0.5;
126 coords = coords + offset * "+str(jitter * 0.01)+";"
127 : "") +
128
129 "vec3 color = computeColor(texture2D(source, coords).rgb);" +
130
131 (noise_strength !== 0 ? "
132 float noiseVal = texture2D(noiseSource, qt_TexCoord0 + vec2(fract(time / 51.0), fract(time / 237.0))).a;
133 color += computeColor(vec3(noiseVal * noise * (1.0 - distance * 1.3)));" : "") +
134
135 (bloom !== 0 ? "
136 vec4 bloomColor = texture2D(bloomSource, coords);
137 color += computeColor(bloomColor.rgb) * bloomColor.a * " + str(bloom * 2.8) + ";" : "") +
138
139 "gl_FragColor = vec4(color * brightness *"+str(brightness)+", qt_Opacity);
140 }"
141
142 onStatusChanged: if (log) console.log(log) //Print warning messages
143}
0144
=== modified file 'src/app/qml/Terminal.qml'
--- src/app/qml/Terminal.qml 2014-08-10 12:51:08 +0000
+++ src/app/qml/Terminal.qml 2014-08-26 15:24:15 +0000
@@ -7,8 +7,7 @@
77
8Item {8Item {
9 id: mparent9 id: mparent
10 height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height10 anchors.fill: parent
11 width: parent.width
1211
13 function hideFocus(){12 function hideFocus(){
14 kterm.focus = false;13 kterm.focus = false;
@@ -188,7 +187,8 @@
188 objectName: "cmenu"187 objectName: "cmenu"
189 z: 99188 z: 99
190 visible: false189 visible: false
191 anchors.centerIn: parent190 x: parent.x + (parent.width - width) / 2
191 y: parent.y + (kterm.height - height) / 2
192 circleButtonLable: "CTRL +"192 circleButtonLable: "CTRL +"
193 sideButtons: ["A", "C", "D", "S", "X", "Z"]193 sideButtons: ["A", "C", "D", "S", "X", "Z"]
194194
@@ -224,32 +224,65 @@
224 }224 }
225 }225 }
226226
227 KTerminal {227 Item{
228 id: kterm228 id: ktermContainer
229 objectName: "kterm"229 anchors.fill: parent
230230
231 //////////////////////////////////////231 KTerminal {
232 /// FONT SIZE = 24 (FINE FOR GNEXUS)232 id: kterm
233 /// FONT SIZE = 12 (FINE FOR DESKTOP)233 objectName: "kterm"
234 //////////////////////////////////////234
235 font.family: "Ubuntu Mono"235 //////////////////////////////////////
236 font.pointSize: jsConf.getFontSize() //units.gu(1.5)236 /// FONT SIZE = 24 (FINE FOR GNEXUS)
237237 /// FONT SIZE = 12 (FINE FOR DESKTOP)
238 colorScheme: jsConf.getColorScheme() //"DarkPastels"238 //////////////////////////////////////
239 width: parent.width239 font.family: "Ubuntu Mono"
240 height: parent.height240 font.pointSize: jsConf.getFontSize() //units.gu(1.5)
241241
242 session: KSession {242 colorScheme: jsConf.getColorScheme() //"DarkPastels"
243 id: ksession243 width: parent.width
244 objectName: "ksession"244 height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height
245 kbScheme: "linux"245
246246 session: KSession {
247 onFinished: {247 id: ksession
248 Qt.quit()248 objectName: "ksession"
249 kbScheme: "linux"
250
251 onFinished: {
252 Qt.quit()
253 }
249 }254 }
250 }255 }
251 }256 }
252257
258 Loader{
259 id: graphicalTerminal
260 z: 1.1
261 active: true
262 anchors.fill: ktermContainer
263 source: "GraphicalTerminal.qml"
264 onLoaded: {
265 item.mainSource = ktermContainer;
266 updateGraphicalParams();
267 }
268
269 function updateGraphicalParams(){
270 active = jsConf.getEffectsEnabled();
271 item.bloom = jsConf.getBloom();
272 item.noise_strength = jsConf.getNoiseStrenght() * 0.8;
273 item.screen_curvature = jsConf.getScreenCurvature() * 0.3;
274 item.jitter = jsConf.getJitter();
275 item.brightness_flickering = jsConf.getBrightnessFlickering() * 0.5;
276 item.color_intensity = jsConf.getColorIntensity();
277 item.screen_color = jsConf.getScreenColor();
278 }
279
280 Connections {
281 target: pgConf
282 onConfigChanged: graphicalTerminal.updateGraphicalParams();
283 }
284 }
285
253 MouseArea {286 MouseArea {
254 anchors.fill: parent287 anchors.fill: parent
255 enabled: true288 enabled: true
256289
=== modified file 'src/app/qml/config/JsConfig.qml'
--- src/app/qml/config/JsConfig.qml 2014-03-02 01:20:35 +0000
+++ src/app/qml/config/JsConfig.qml 2014-08-26 15:24:15 +0000
@@ -4,12 +4,19 @@
4Item{4Item{
5 DbEngine{id: dbEngine}5 DbEngine{id: dbEngine}
66
7 function setSetting(name, strVal){
8 dbEngine.setConfig(name, strVal);
9 }
10
11 function getSetting(name, defaultVal){
12 dbEngine.initialize();
13 var res = dbEngine.getConfig(name);
14 return (res === "UNKNOWN" || res === "NaN" ) ? defaultVal : res;
15 }
16
7 //ColorSchemes17 //ColorSchemes
8 function getColorScheme(){18 function getColorScheme(){
9 dbEngine.initialize()19 return getSetting("colorScheme", "DarkPastels");
10 var res = dbEngine.getConfig("colorScheme");
11 if( res === "UNKNOWN" ) return "DarkPastels";
12 return res;
13 }20 }
1421
15 function setColorScheme(scheme){22 function setColorScheme(scheme){
@@ -19,14 +26,82 @@
1926
20 //FontSize27 //FontSize
21 function getFontSize(){28 function getFontSize(){
22 dbEngine.initialize()29 return parseInt(getSetting("fontSize", "14"));
23 var res = dbEngine.getConfig("fontSize");
24 if( res === "UNKNOWN" || res === "NaN" ) return 14;
25 else return parseInt(res);
26 }30 }
2731
28 function setFontSize(size){32 function setFontSize(size){
29 dbEngine.setConfig("fontSize", Math.round(size).toString() );33 setSetting("fontSize", Math.round(size).toString() );
30 }34 }
3135
36 //Effects global switch
37 function getEffectsEnabled(){
38 return getSetting("effectsEnabled", "true") === "true";
39 }
40
41 function setEffectsEnabled(enabled){
42 setSetting("effectsEnabled", enabled.toString() );
43 }
44
45 //Screen color
46 function getScreenColor(){
47 return getSetting("screenColor", "#FFFFFF");
48 }
49
50 function setScreenColor(color){
51 setSetting("screenColor", color.toString() );
52 }
53
54 //Color intensity
55 function getColorIntensity(){
56 return parseFloat(getSetting("colorIntensity", "0.2"));
57 }
58
59 function setColorIntensity(intensity){
60 setSetting("colorIntensity", intensity.toString() );
61 }
62
63 //Bloom effect
64 function getBloom(){
65 return parseFloat(getSetting("bloom", "0.4"));
66 }
67
68 function setBloom(bloom){
69 setSetting("bloom", bloom.toString());
70 }
71
72 //Noise strength
73 function getNoiseStrenght(){
74 return parseFloat(getSetting("noiseStrength", "0.0"));
75 }
76
77 function setNoiseStrength(noiseStrength){
78 setSetting("noiseStrength", noiseStrength.toString() );
79 }
80
81 //Screen curvature
82 function getScreenCurvature(){
83 return parseFloat(getSetting("screenCurvature", "0.2"));
84 }
85
86 function setScreenCurvature(screenCurvature){
87 setSetting("screenCurvature", screenCurvature.toString() )
88 }
89
90 //Jitter
91 function getJitter(){
92 return parseFloat(getSetting("jitter", "0.0"));
93 }
94
95 function setJitter(jitter){
96 setSetting("jitter", jitter.toString() )
97 }
98
99 //Brightness flickering
100 function getBrightnessFlickering(){
101 return parseFloat(getSetting("brightness_flickering", "0.0"));
102 }
103
104 function setBrightnessFlickering(brightness_flickering){
105 setSetting("brightness_flickering", brightness_flickering.toString() );
106 }
32}107}
33108
=== added directory 'src/app/qml/images'
=== added file 'src/app/qml/images/randfunction.png'
34Binary 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 differ109Binary 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
=== modified file 'src/app/qml/ubuntu-terminal-app.qml'
--- src/app/qml/ubuntu-terminal-app.qml 2014-08-10 12:55:23 +0000
+++ src/app/qml/ubuntu-terminal-app.qml 2014-08-26 15:24:15 +0000
@@ -1,4 +1,5 @@
1import QtQuick 2.01import QtQuick 2.2
2import QtGraphicalEffects 1.0
2import Ubuntu.Components 1.13import Ubuntu.Components 1.1
3import Ubuntu.Components.Popups 0.14import Ubuntu.Components.Popups 0.1
45
@@ -83,8 +84,11 @@
83 id: settingsPage84 id: settingsPage
84 visible: false85 visible: false
85 title: i18n.tr("Settings")86 title: i18n.tr("Settings")
86 Configs { id: pgConf }87 Flickable{
88 anchors.fill: parent
89 contentHeight: units.gu(110)
90 Configs { id: pgConf }
91 }
87 }92 }
88 }93 }
89
90}94}
9195
=== modified file 'src/plugin/konsole/TerminalDisplay.cpp'
--- src/plugin/konsole/TerminalDisplay.cpp 2014-04-27 09:11:14 +0000
+++ src/plugin/konsole/TerminalDisplay.cpp 2014-08-26 15:24:15 +0000
@@ -1582,11 +1582,11 @@
1582 _contentHeight = height() - 2 * DEFAULT_TOP_MARGIN + /* mysterious */ 1;1582 _contentHeight = height() - 2 * DEFAULT_TOP_MARGIN + /* mysterious */ 1;
15831583
1584 // ensure that display is always at least one column wide1584 // ensure that display is always at least one column wide
1585 _columns = qMax(1, qRound(_contentWidth / _fontWidth));1585 _columns = qMax(1, qFloor(_contentWidth / (double)_fontWidth));
1586 _usedColumns = qMin(_usedColumns,_columns);1586 _usedColumns = qMin(_usedColumns,_columns);
15871587
1588 // ensure that display is always at least one line high1588 // ensure that display is always at least one line high
1589 _lines = qMax(1, qRound(_contentHeight / (double)_fontHeight));1589 _lines = qMax(1, qFloor(_contentHeight / (double)_fontHeight));
1590 _usedLines = qMin(_usedLines,_lines);1590 _usedLines = qMin(_usedLines,_lines);
1591}1591}
15921592

Subscribers

People subscribed via source and target branches