Merge lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-migration into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 153
Merged at revision: 154
Proposed branch: lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-migration
Merge into: lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 1040 lines (+225/-573)
22 files modified
manifest.json.in (+1/-1)
src/app/qml/AlternateActionPopover.qml (+2/-2)
src/app/qml/AuthenticationDialog.qml (+2/-2)
src/app/qml/AuthenticationService.qml (+2/-2)
src/app/qml/CircularTransparentButton.qml (+1/-1)
src/app/qml/ColorSchemePage.qml (+59/-0)
src/app/qml/ExpandableButton.qml (+1/-1)
src/app/qml/KeyboardBar.qml (+1/-1)
src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml (+1/-1)
src/app/qml/KeyboardRows/JsonTranslator.qml (+1/-1)
src/app/qml/KeyboardRows/KeyModel.qml (+1/-1)
src/app/qml/KeyboardRows/KeyboardButton.qml (+1/-1)
src/app/qml/KeyboardRows/KeyboardLayout.qml (+2/-2)
src/app/qml/KeyboardRows/KeyboardRow.qml (+1/-1)
src/app/qml/LayoutsPage.qml (+15/-11)
src/app/qml/ListItemWithActions.qml (+0/-454)
src/app/qml/SettingsPage.qml (+113/-84)
src/app/qml/TabsPage.qml (+1/-2)
src/app/qml/TerminalComponent.qml (+1/-1)
src/app/qml/TerminalPage.qml (+8/-2)
src/app/qml/ubuntu-terminal-app.qml (+10/-1)
terminal.apparmor (+1/-1)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-migration
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+282922@code.launchpad.net

Commit message

* Updated imports to Ubuntu.Components 1.3
* Use 'ubuntu-sdk-15.04.3' framework
* Migrated all the list items to ListItemLayout
* Added a Flickable in the settings page, so that the content can be scrolled on small screens
* Moved the 'color scheme' setting into a separate page, as per UITK 1.3 design specs (see section "List items", "Examples and best practice" for three slot layout)

Description of the change

* Updated imports to Ubuntu.Components 1.3
* Use 'ubuntu-sdk-15.04.3' framework
* Migrated all the list items to ListItemLayout
* Added a Flickable in the settings page, so that the content can be scrolled on small screens
* Moved the 'color scheme' setting into a separate page, as per UITK 1.3 design specs (see section "List items", "Examples and best practice" for three slot layout)

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Great work, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'manifest.json.in'
--- manifest.json.in 2015-08-02 12:49:18 +0000
+++ manifest.json.in 2016-01-22 18:37:42 +0000
@@ -1,6 +1,6 @@
1{1{
2 "description": "Terminal application",2 "description": "Terminal application",
3 "framework": "ubuntu-sdk-15.04",3 "framework": "ubuntu-sdk-15.04.3",
4 "architecture": "@CLICK_ARCH@",4 "architecture": "@CLICK_ARCH@",
5 "hooks": {5 "hooks": {
6 "terminal": {6 "terminal": {
77
=== modified file 'src/app/qml/AlternateActionPopover.qml'
--- src/app/qml/AlternateActionPopover.qml 2015-08-02 12:49:18 +0000
+++ src/app/qml/AlternateActionPopover.qml 2016-01-22 18:37:42 +0000
@@ -1,6 +1,6 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
3import Ubuntu.Components.Popups 1.03import Ubuntu.Components.Popups 1.3
44
5Component {5Component {
6 id: popoverComponent6 id: popoverComponent
77
=== modified file 'src/app/qml/AuthenticationDialog.qml'
--- src/app/qml/AuthenticationDialog.qml 2016-01-20 01:24:35 +0000
+++ src/app/qml/AuthenticationDialog.qml 2016-01-22 18:37:42 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Arto Jalkanen <ajalkane@gmail.com>16 * Authored by: Arto Jalkanen <ajalkane@gmail.com>
17 */17 */
18import QtQuick 2.418import QtQuick 2.4
19import Ubuntu.Components 1.219import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.3
2121
22Dialog {22Dialog {
23 id: root23 id: root
2424
=== modified file 'src/app/qml/AuthenticationService.qml'
--- src/app/qml/AuthenticationService.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/AuthenticationService.qml 2016-01-22 18:37:42 +0000
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
16import QtQuick 2.416import QtQuick 2.4
17import Ubuntu.Components 1.217import Ubuntu.Components 1.3
18import Ubuntu.Components.Popups 1.018import Ubuntu.Components.Popups 1.3
19import com.ubuntu.PamAuthentication 0.119import com.ubuntu.PamAuthentication 0.1
2020
21/**21/**
2222
=== modified file 'src/app/qml/CircularTransparentButton.qml'
--- src/app/qml/CircularTransparentButton.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/CircularTransparentButton.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4Rectangle {4Rectangle {
5 property color backgroundColor: "black"5 property color backgroundColor: "black"
66
=== added file 'src/app/qml/ColorSchemePage.qml'
--- src/app/qml/ColorSchemePage.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/ColorSchemePage.qml 2016-01-22 18:37:42 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2013, 2014, 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Filippo Scognamiglio <flscogna@gmail.com>
17 */
18
19import QtQuick 2.4
20import Ubuntu.Components 1.3
21
22Page {
23 id: rootItem
24 objectName: "colorSchemePage"
25
26 title: i18n.tr("Color Scheme")
27 property alias model: listView.model
28
29 ListView {
30 id: listView
31 anchors.fill: parent
32 model: settings.profilesList
33 delegate: ListItem {
34 ListItemLayout {
35 anchors.fill: parent
36 title.text: modelData
37
38 Icon {
39 SlotsLayout.position: SlotsLayout.Last
40 width: units.gu(2); height: units.gu(2)
41 color: UbuntuColors.green
42 name: "tick"
43
44 visible: model.index == listView.currentIndex
45 }
46 }
47
48 onClicked: listView.currentIndex = model.index
49 }
50
51 onCurrentIndexChanged: {
52 settings.colorScheme = model[currentIndex];
53 }
54
55 Component.onCompleted: {
56 currentIndex = model.indexOf(settings.colorScheme);
57 }
58 }
59}
060
=== modified file 'src/app/qml/ExpandableButton.qml'
--- src/app/qml/ExpandableButton.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/ExpandableButton.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4Item {4Item {
5 id: container5 id: container
66
=== modified file 'src/app/qml/KeyboardBar.qml'
--- src/app/qml/KeyboardBar.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardBar.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
3import "KeyboardRows"3import "KeyboardRows"
44
5import "KeyboardRows/jsonParser.js" as Parser5import "KeyboardRows/jsonParser.js" as Parser
66
=== modified file 'src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml'
--- src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4import ".."4import ".."
55
66
=== modified file 'src/app/qml/KeyboardRows/JsonTranslator.qml'
--- src/app/qml/KeyboardRows/JsonTranslator.qml 2015-08-09 14:05:38 +0000
+++ src/app/qml/KeyboardRows/JsonTranslator.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4Item {4Item {
55
66
=== modified file 'src/app/qml/KeyboardRows/KeyModel.qml'
--- src/app/qml/KeyboardRows/KeyModel.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardRows/KeyModel.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4QtObject {4QtObject {
5 property string text5 property string text
66
=== modified file 'src/app/qml/KeyboardRows/KeyboardButton.qml'
--- src/app/qml/KeyboardRows/KeyboardButton.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardRows/KeyboardButton.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4Rectangle {4Rectangle {
5 property alias text: mainLabel.text5 property alias text: mainLabel.text
66
=== modified file 'src/app/qml/KeyboardRows/KeyboardLayout.qml'
--- src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-08-09 14:25:36 +0000
+++ src/app/qml/KeyboardRows/KeyboardLayout.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4import "jsonParser.js" as Parser4import "jsonParser.js" as Parser
55
@@ -59,7 +59,7 @@
59 function createEntryString(text, actionString, otherActionsString) {59 function createEntryString(text, actionString, otherActionsString) {
60 var objectString = "60 var objectString = "
61 import QtQuick 2.461 import QtQuick 2.4
62 import Ubuntu.Components 1.262 import Ubuntu.Components 1.3
6363
64 KeyModel {64 KeyModel {
65 text: \"" + text + "\"65 text: \"" + text + "\"
6666
=== modified file 'src/app/qml/KeyboardRows/KeyboardRow.qml'
--- src/app/qml/KeyboardRows/KeyboardRow.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardRows/KeyboardRow.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
33
4Rectangle {4Rectangle {
5 id: container5 id: container
66
=== modified file 'src/app/qml/LayoutsPage.qml'
--- src/app/qml/LayoutsPage.qml 2015-08-07 12:31:58 +0000
+++ src/app/qml/LayoutsPage.qml 2016-01-22 18:37:42 +0000
@@ -17,8 +17,7 @@
17 */17 */
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.0 as ListItem
2221
23Page {22Page {
24 id: rootItem23 id: rootItem
@@ -34,18 +33,23 @@
34 ListView {33 ListView {
35 anchors.fill: parent34 anchors.fill: parent
36 model: settings.profilesList35 model: settings.profilesList
37 delegate: ListItem.Standard {36 delegate: ListItem {
38 text: name37 ListItemLayout {
3938 anchors.fill: parent
40 control: Switch {39 title.text: name
41 id: layoutSwitch40
42 checked: profileVisible41 Switch {
43 onCheckedChanged: {42 id: layoutSwitch
44 settings.profilesList.setProperty(index, "profileVisible", checked);43 SlotsLayout.position: SlotsLayout.Trailing
44
45 checked: profileVisible
46 onCheckedChanged: {
47 settings.profilesList.setProperty(index, "profileVisible", checked);
48 }
45 }49 }
46 }50 }
4751
48 onTriggered: layoutSwitch.trigger()52 onClicked: layoutSwitch.trigger()
49 }53 }
50 }54 }
51}55}
5256
=== removed file 'src/app/qml/ListItemWithActions.qml'
--- src/app/qml/ListItemWithActions.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/ListItemWithActions.qml 1970-01-01 00:00:00 +0000
@@ -1,454 +0,0 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2
19
20Item {
21 id: root
22
23 property Action leftSideAction: null
24 property list<Action> rightSideActions
25 property double defaultHeight: units.gu(8)
26 property bool locked: false
27 property Action activeAction: null
28 property var activeItem: null
29 property bool triggerActionOnMouseRelease: false
30 property color color: Theme.palette.normal.background
31 property color selectedColor: "#E6E6E6"
32 property bool selected: false
33 property bool selectionMode: false
34 property alias internalAnchors: mainContents.anchors
35 default property alias contents: mainContents.children
36
37 readonly property double actionWidth: units.gu(4)
38 readonly property double leftActionWidth: units.gu(10)
39 readonly property double actionThreshold: actionWidth * 0.4
40 readonly property double threshold: 0.4
41 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
42 readonly property alias swipping: mainItemMoving.running
43 readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
44
45 /* internal */
46 property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
47
48 signal itemClicked(var mouse)
49 signal itemPressAndHold(var mouse)
50
51 function returnToBoundsRTL(direction)
52 {
53 var actionFullWidth = actionWidth + units.gu(2)
54
55 // go back to normal state if swipping reverse
56 if (direction === "LTR") {
57 updatePosition(0)
58 return
59 } else if (!triggerActionOnMouseRelease) {
60 updatePosition(-rightActionsView.width + units.gu(2))
61 return
62 }
63
64 var xOffset = Math.abs(main.x)
65 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
66 var newX = 0
67 if (index === _visibleRightSideActions.length) {
68 newX = -(rightActionsView.width - units.gu(2))
69 } else if (index >= 1) {
70 newX = -(actionFullWidth * index)
71 }
72 updatePosition(newX)
73 }
74
75 function returnToBoundsLTR(direction)
76 {
77 var finalX = leftActionWidth
78 if ((direction === "RTL") || (main.x <= (finalX * root.threshold)))
79 finalX = 0
80 updatePosition(finalX)
81 }
82
83 function returnToBounds(direction)
84 {
85 if (main.x < 0) {
86 returnToBoundsRTL(direction)
87 } else if (main.x > 0) {
88 returnToBoundsLTR(direction)
89 } else {
90 updatePosition(0)
91 }
92 }
93
94 function contains(item, point, marginX)
95 {
96 var itemStartX = item.x - marginX
97 var itemEndX = item.x + item.width + marginX
98 return (point.x >= itemStartX) && (point.x <= itemEndX) &&
99 (point.y >= item.y) && (point.y <= (item.y + item.height));
100 }
101
102 function getActionAt(point)
103 {
104 if (contains(leftActionView, point, 0)) {
105 return leftSideAction
106 } else if (contains(rightActionsView, point, 0)) {
107 var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
108 for (var i = 0; i < rightActionsRepeater.count; i++) {
109 var child = rightActionsRepeater.itemAt(i)
110 if (contains(child, newPoint, units.gu(1))) {
111 return i
112 }
113 }
114 }
115 return -1
116 }
117
118 function updateActiveAction()
119 {
120 if (triggerActionOnMouseRelease &&
121 (main.x <= -(root.actionWidth + units.gu(2))) &&
122 (main.x > -(rightActionsView.width - units.gu(2)))) {
123 var actionFullWidth = actionWidth + units.gu(2)
124 var xOffset = Math.abs(main.x)
125 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
126 index = index - 1
127 if (index > -1) {
128 root.activeItem = rightActionsRepeater.itemAt(index)
129 root.activeAction = root._visibleRightSideActions[index]
130 }
131 } else {
132 root.activeAction = null
133 }
134 }
135
136 function resetSwipe()
137 {
138 updatePosition(0)
139 }
140
141 function filterVisibleActions(actions)
142 {
143 var visibleActions = []
144 for(var i = 0; i < actions.length; i++) {
145 var action = actions[i]
146 if (action.visible) {
147 visibleActions.push(action)
148 }
149 }
150 return visibleActions
151 }
152
153 function updatePosition(pos)
154 {
155 if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
156 mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
157 } else {
158 mouseArea.state = ""
159 }
160 main.x = pos
161 }
162
163 states: [
164 State {
165 name: "select"
166 when: selectionMode || selected
167 PropertyChanges {
168 target: selectionIcon
169 source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
170 anchors.leftMargin: units.gu(2)
171 }
172 PropertyChanges {
173 target: root
174 locked: true
175 }
176 PropertyChanges {
177 target: main
178 x: 0
179 }
180 }
181 ]
182
183 height: defaultHeight
184 clip: height !== defaultHeight
185
186 Rectangle {
187 id: leftActionView
188
189 anchors {
190 top: parent.top
191 bottom: parent.bottom
192 right: main.left
193 }
194 width: root.leftActionWidth + actionThreshold
195 visible: leftSideAction
196 color: UbuntuColors.red
197
198 Icon {
199 anchors {
200 centerIn: parent
201 horizontalCenterOffset: actionThreshold / 2
202 }
203 name: leftSideAction && _showActions ? leftSideAction.iconName : ""
204 color: Theme.palette.selected.field
205 height: units.gu(3)
206 width: units.gu(3)
207 }
208 }
209
210 Rectangle {
211 id: rightActionsView
212
213 anchors {
214 top: main.top
215 left: main.right
216 bottom: main.bottom
217 }
218 visible: _visibleRightSideActions.length > 0
219 width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
220 color: "white"
221 Row {
222 anchors{
223 top: parent.top
224 left: parent.left
225 leftMargin: units.gu(2)
226 right: parent.right
227 rightMargin: units.gu(2)
228 bottom: parent.bottom
229 }
230 spacing: units.gu(2)
231 Repeater {
232 id: rightActionsRepeater
233
234 model: _showActions ? _visibleRightSideActions : []
235 Item {
236 property alias image: img
237
238 height: rightActionsView.height
239 width: root.actionWidth
240
241 Icon {
242 id: img
243
244 anchors.centerIn: parent
245 width: units.gu(3)
246 height: units.gu(3)
247 name: modelData.iconName
248 color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey
249 }
250 }
251 }
252 }
253 }
254
255
256 Rectangle {
257 id: main
258 objectName: "mainItem"
259
260 anchors {
261 top: parent.top
262 bottom: parent.bottom
263 }
264
265 width: parent.width
266 color: root.selected ? root.selectedColor : root.color
267
268 Loader {
269 id: selectionIcon
270
271 anchors {
272 left: main.left
273 verticalCenter: main.verticalCenter
274 }
275 width: (status === Loader.Ready) ? item.implicitWidth : 0
276 visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
277 Behavior on width {
278 NumberAnimation {
279 duration: UbuntuAnimation.SnapDuration
280 }
281 }
282 }
283
284
285 Item {
286 id: mainContents
287
288 anchors {
289 left: selectionIcon.right
290 leftMargin: units.gu(2)
291 top: parent.top
292 topMargin: units.gu(1)
293 right: parent.right
294 rightMargin: units.gu(2)
295 bottom: parent.bottom
296 bottomMargin: units.gu(1)
297 }
298 }
299
300 Behavior on x {
301 UbuntuNumberAnimation {
302 id: mainItemMoving
303
304 easing.type: Easing.OutElastic
305 duration: UbuntuAnimation.SlowDuration
306 }
307 }
308 Behavior on color {
309 ColorAnimation {}
310 }
311 }
312
313 SequentialAnimation {
314 id: triggerAction
315
316 property var currentItem: root.activeItem ? root.activeItem.image : null
317
318 running: false
319 ParallelAnimation {
320 UbuntuNumberAnimation {
321 target: triggerAction.currentItem
322 property: "opacity"
323 from: 1.0
324 to: 0.0
325 duration: UbuntuAnimation.SlowDuration
326 easing {type: Easing.InOutBack; }
327 }
328 UbuntuNumberAnimation {
329 target: triggerAction.currentItem
330 properties: "width, height"
331 from: units.gu(3)
332 to: root.actionWidth
333 duration: UbuntuAnimation.SlowDuration
334 easing {type: Easing.InOutBack; }
335 }
336 }
337 PropertyAction {
338 target: triggerAction.currentItem
339 properties: "width, height"
340 value: units.gu(3)
341 }
342 PropertyAction {
343 target: triggerAction.currentItem
344 properties: "opacity"
345 value: 1.0
346 }
347 ScriptAction {
348 script: {
349 root.activeAction.triggered(root)
350 mouseArea.state = ""
351 }
352 }
353 PauseAnimation {
354 duration: 500
355 }
356 UbuntuNumberAnimation {
357 target: main
358 property: "x"
359 to: 0
360
361 }
362 }
363
364 MouseArea {
365 id: mouseArea
366
367 property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
368 property bool manual: false
369 property string direction: "None"
370 property real lastX: -1
371
372 anchors.fill: parent
373 drag {
374 target: locked ? null : main
375 axis: Drag.XAxis
376 minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
377 maximumX: leftActionView.visible ? leftActionView.width : 0
378 threshold: root.actionThreshold
379 }
380
381 states: [
382 State {
383 name: "LeftToRight"
384 PropertyChanges {
385 target: mouseArea
386 drag.maximumX: 0
387 }
388 },
389 State {
390 name: "RightToLeft"
391 PropertyChanges {
392 target: mouseArea
393 drag.minimumX: 0
394 }
395 }
396 ]
397
398 onMouseXChanged: {
399 var offset = (lastX - mouseX)
400 if (Math.abs(offset) <= root.actionThreshold) {
401 return
402 }
403 lastX = mouseX
404 direction = offset > 0 ? "RTL" : "LTR";
405 }
406
407 onPressed: {
408 lastX = mouse.x
409 }
410
411 onReleased: {
412 if (root.triggerActionOnMouseRelease && root.activeAction) {
413 triggerAction.start()
414 } else {
415 root.returnToBounds(direction)
416 root.activeAction = null
417 }
418 lastX = -1
419 direction = "None"
420 }
421 onClicked: {
422 if (main.x === 0) {
423 root.itemClicked(mouse)
424 } else if (main.x > 0) {
425 var action = getActionAt(Qt.point(mouse.x, mouse.y))
426 if (action && action !== -1) {
427 action.triggered(root)
428 }
429 } else {
430 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
431 if (actionIndex !== -1) {
432 root.activeItem = rightActionsRepeater.itemAt(actionIndex)
433 root.activeAction = root._visibleRightSideActions[actionIndex]
434 triggerAction.start()
435 return
436 }
437 }
438 root.resetSwipe()
439 }
440
441 onPositionChanged: {
442 if (mouseArea.pressed) {
443 updateActiveAction()
444 }
445 }
446 onPressAndHold: {
447 if (main.x === 0) {
448 root.itemPressAndHold(mouse)
449 }
450 }
451 z: -1
452 }
453}
454
4550
=== modified file 'src/app/qml/SettingsPage.qml'
--- src/app/qml/SettingsPage.qml 2015-12-19 05:14:39 +0000
+++ src/app/qml/SettingsPage.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013, 2014 Canonical Ltd2 * Copyright (C) 2013, 2014, 2016 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,96 +17,125 @@
17 */17 */
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.0 as ListItem
2221
23Page {22Page {
24 id: settingsPage23 id: settingsPage
25 objectName: "settingsPage"24 objectName: "settingsPage"
2625
27 title: i18n.tr("Settings")26 title: i18n.tr("Settings")
2827 flickable: null
29 Column {28
30 id: mainColumn29 Flickable {
31
32 spacing: units.gu(1)
33 anchors.fill: parent30 anchors.fill: parent
3431 interactive: contentHeight + units.gu(6) > height
35 ListItem.Standard {32 contentHeight: mainColumn.height
36 text: i18n.tr("Layouts")33
37 progression: true34 Column {
38 onClicked: pageStack.push(layoutsPage);35 id: mainColumn
39 }36 anchors { left: parent.left; right: parent.right }
4037 spacing: units.gu(1)
41 ListItem.Standard {38
42 text: i18n.tr("Show Keyboard Bar")39 ListItem {
43 control: Switch {40 ListItemLayout {
44 onCheckedChanged: settings.showKeyboardBar = checked;41 anchors.fill: parent
45 Component.onCompleted: checked = settings.showKeyboardBar;42 title.text: i18n.tr("Layouts")
46 }43
47 }44 Icon {
4845 SlotsLayout.position: SlotsLayout.Trailing
49 ListItem.Standard {46 width: units.gu(2); height: width
50 text: i18n.tr("Show Keyboard Button")47 name: "go-next"
51 control: Switch {48 }
52 onCheckedChanged: settings.showKeyboardButton = checked;49 }
53 Component.onCompleted: checked = settings.showKeyboardButton;50
54 }51 onClicked: pageStack.push(layoutsPage);
55 }52 }
5653
57 ListItem.Empty {54 ListItem {
58 height: units.gu(10)55 ListItemLayout {
59 Label {56 anchors.fill: parent
60 text: i18n.tr("Font Size:")57 title.text: i18n.tr("Show Keyboard Bar")
61 x: units.gu(2)58
62 }59 Switch {
63 Slider {60 id: keybBarSwitch
64 id: slFont61 SlotsLayout.position: SlotsLayout.Trailing
65 objectName: "slFont"62 onCheckedChanged: settings.showKeyboardBar = checked;
66 anchors {63 Component.onCompleted: checked = settings.showKeyboardBar;
67 left: parent.left64 }
68 right: parent.right65 }
69 bottom: parent.bottom66
70 margins: units.gu(2)67 onClicked: keybBarSwitch.trigger()
71 }68 }
72 minimumValue: settings.minFontSize;69
73 maximumValue: settings.maxFontSize;70 ListItem {
74 onValueChanged: {71 ListItemLayout {
75 settings.fontSize = value;72 anchors.fill: parent
76 }73 title.text: i18n.tr("Show Keyboard Button")
77 Component.onCompleted: {74
78 value = settings.fontSize;75 Switch {
79 }76 id: keybButtonSwitch
8077 SlotsLayout.position: SlotsLayout.Trailing
81 Connections {78 onCheckedChanged: settings.showKeyboardButton = checked;
82 target: settings79 Component.onCompleted: checked = settings.showKeyboardButton;
83 onFontSizeChanged: {80 }
84 slFont.value = settings.fontSize81 }
85 }82
86 }83 onClicked: keybButtonSwitch.trigger()
87 }84 }
88 }85
8986 ListItem {
90 OptionSelector {87 height: units.gu(12)
91 id: colorsSchemeSelector88
92 objectName: "colorsSchemeSelector"89 Label {
93 text: i18n.tr("Color Scheme")90 anchors { left: parent.left; margins: units.gu(2) }
94 width: parent.width - units.gu(4)91 text: i18n.tr("Font Size:")
95 x: units.gu(2)92 }
9693
97 // TODO Hackish, but works quite well.94 Slider {
98 containerHeight: parent.height - y - units.gu(6)95 id: slFont
9996 objectName: "slFont"
100 // TODO This is a workaround at the moment.97 anchors {
101 // The application should get them from the c++.98 left: parent.left
102 model: ["GreenOnBlack","WhiteOnBlack","BlackOnWhite","BlackOnRandomLight","Linux","cool-retro-term","DarkPastels","BlackOnLightYellow", "Ubuntu"]99 right: parent.right
103100 bottom: parent.bottom
104 onSelectedIndexChanged: {101 margins: units.gu(2)
105 settings.colorScheme = model[selectedIndex];102 }
106 }103 minimumValue: settings.minFontSize;
107104 maximumValue: settings.maxFontSize;
108 Component.onCompleted: {105 onValueChanged: {
109 selectedIndex = model.indexOf(settings.colorScheme);106 settings.fontSize = value;
107 }
108 Component.onCompleted: {
109 value = settings.fontSize;
110 }
111
112 Connections {
113 target: settings
114 onFontSizeChanged: {
115 slFont.value = settings.fontSize
116 }
117 }
118 }
119 }
120
121 ListItem {
122 ListItemLayout {
123 anchors.fill: parent
124 title.text: i18n.tr("Color Scheme")
125
126 Label {
127 SlotsLayout.position: SlotsLayout.Trailing
128 text: settings.colorScheme
129 }
130
131 Icon {
132 SlotsLayout.position: SlotsLayout.Last
133 width: units.gu(2); height: width
134 name: "go-next"
135 }
136 }
137
138 onClicked: pageStack.push(colorSchemePage);
110 }139 }
111 }140 }
112 }141 }
113142
=== modified file 'src/app/qml/TabsPage.qml'
--- src/app/qml/TabsPage.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/TabsPage.qml 2016-01-22 18:37:42 +0000
@@ -1,6 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
3import Ubuntu.Components.ListItems 1.0 as ListItem
43
5Page {4Page {
6 id: tabsPage5 id: tabsPage
76
=== modified file 'src/app/qml/TerminalComponent.qml'
--- src/app/qml/TerminalComponent.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/TerminalComponent.qml 2016-01-22 18:37:42 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
3import QMLTermWidget 1.03import QMLTermWidget 1.0
44
5Component {5Component {
66
=== modified file 'src/app/qml/TerminalPage.qml'
--- src/app/qml/TerminalPage.qml 2015-12-19 05:14:39 +0000
+++ src/app/qml/TerminalPage.qml 2016-01-22 18:37:42 +0000
@@ -1,6 +1,6 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.22import Ubuntu.Components 1.3
3import Ubuntu.Components.Popups 1.03import Ubuntu.Components.Popups 1.3
4import QMLTermWidget 1.04import QMLTermWidget 1.0
55
6Page {6Page {
@@ -10,6 +10,12 @@
1010
11 anchors.fill: parent11 anchors.fill: parent
1212
13 header: PageHeader {
14 // WORKAROUND: This way we disable the 'hide' animation when
15 // closing the settings page.
16 visible: false
17 }
18
13 AlternateActionPopover {19 AlternateActionPopover {
14 id: alternateActionPopover20 id: alternateActionPopover
15 }21 }
1622
=== modified file 'src/app/qml/ubuntu-terminal-app.qml'
--- src/app/qml/ubuntu-terminal-app.qml 2015-08-09 14:03:25 +0000
+++ src/app/qml/ubuntu-terminal-app.qml 2016-01-22 18:37:42 +0000
@@ -1,6 +1,6 @@
1import QtQuick 2.41import QtQuick 2.4
2import QtGraphicalEffects 1.02import QtGraphicalEffects 1.0
3import Ubuntu.Components 1.23import Ubuntu.Components 1.3
4import "KeyboardRows"4import "KeyboardRows"
55
6import QMLTermWidget 1.06import QMLTermWidget 1.0
@@ -115,6 +115,15 @@
115 id: layoutsPage115 id: layoutsPage
116 visible: false116 visible: false
117 }117 }
118
119 ColorSchemePage {
120 id: colorSchemePage
121 visible: false
122
123 // TODO This is a workaround at the moment.
124 // The application should get them from the c++.
125 model: ["GreenOnBlack","WhiteOnBlack","BlackOnWhite","BlackOnRandomLight","Linux","cool-retro-term","DarkPastels","BlackOnLightYellow", "Ubuntu"]
126 }
118 }127 }
119128
120 Component.onCompleted: {129 Component.onCompleted: {
121130
=== modified file 'terminal.apparmor'
--- terminal.apparmor 2015-08-02 13:04:57 +0000
+++ terminal.apparmor 2016-01-22 18:37:42 +0000
@@ -2,4 +2,4 @@
2 "policy_groups": [],2 "policy_groups": [],
3 "policy_version": 1.3,3 "policy_version": 1.3,
4 "template": "unconfined"4 "template": "unconfined"
5}5}
6\ No newline at end of file6\ No newline at end of file

Subscribers

People subscribed via source and target branches