Merge lp:~gcollura/ubuntu-calculator-app/swipe-copy-button-improvements into lp:ubuntu-calculator-app

Proposed by Giulio Collura on 2015-01-22
Status: Merged
Approved by: Bartosz Kosiorek on 2015-01-23
Approved revision: 77
Merged at revision: 75
Proposed branch: lp:~gcollura/ubuntu-calculator-app/swipe-copy-button-improvements
Merge into: lp:ubuntu-calculator-app
Diff against target: 87 lines (+29/-8)
2 files modified
app/ubuntu-calculator-app.qml (+22/-7)
app/ui/KeyboardButton.qml (+7/-1)
To merge this branch: bzr merge lp:~gcollura/ubuntu-calculator-app/swipe-copy-button-improvements
Reviewer Review Type Date Requested Status
Bartosz Kosiorek 2015-01-22 Approve on 2015-01-23
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-01-23
Riccardo Padovani Approve on 2015-01-23
Review via email: mp+247357@code.launchpad.net

Commit Message

Add swipe to copy feature on single calculation. Add pressed button effect and fix button height on landscape mode.

Description of the Change

Various improvements. I've decided to put all of them in the same MP to save time :)
What I've done:
* Added swipe to copy on single calculation as Riccardo requested
* Added a small effect when a button gets pressed
* (REMOVED) Fix button height in landscape mode (see http://i.imgur.com/XyE1Ide.png)
Tell me what you think and if you see anything wrong.
Thank you!

Giulio

To post a comment you must log in.

On krillin it doesn't *quite* fit on screen.

http://popey.mooo.com/screenshots/device-2015-01-22-222330.png

I'm not sure if we should have the date fully off screen or on. My gut reaction is that the calculation and keys are the most important things, and you can pull down for the date. But I think this needs design input.

76. By Giulio Collura on 2015-01-22

make buttonRatio proportional to scrollableView ratio

Bartosz Kosiorek (gang65) wrote :

Nice work!

I like copy feature, and animation are really pretty.

I have one remark regarding copy feature: It is possible to select many calculations to copy, but I could copy only one.
Why we added confirm button to copy?
I think "copy" is not so dangerous as "delete". We could just swipe to add to clipboard (without confirmation)
Maybe it will be better to instanly copy whole selected calculation?

review: Needs Information
Bartosz Kosiorek (gang65) wrote :

I tested dynamic changing ratio of the buttons, and it is confusing for me.
I think we should keep fix ratio buttons, and find some different solution.

What do you think about adding one more column for horizontal mode?

Could you please split copy and keypad fix to two MR?

review: Needs Information
Riccardo Padovani (rpadovani) wrote :

> Nice work!
>
> I like copy feature, and animation are really pretty.
>
> I have one remark regarding copy feature: It is possible to select many
> calculations to copy, but I could copy only one.
> Why we added confirm button to copy?
> I think "copy" is not so dangerous as "delete". We could just swipe to add to
> clipboard (without confirmation)
> Maybe it will be better to instanly copy whole selected calculation?

This is how the swype from right to left is supposed to work, because you can have plus than one option on the right. So the first swipe is to evidence all options, and the second one to select the option

Thanks for your branch Giulio, I approve it, but address Bartosz comment, he will topapprove this when he think is ready :-)

review: Approve

This looks great! I like the swipe copy feature!

77. By Giulio Collura on 2015-01-23

remove change of button sizes in this mp

Giulio Collura (gcollura) wrote :

I'm moving the code to fix button height to another MP, since changing the ratio isn't the solution.

Bartosz Kosiorek (gang65) wrote :

Thanks Giulio.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ubuntu-calculator-app.qml'
2--- app/ubuntu-calculator-app.qml 2015-01-22 17:37:01 +0000
3+++ app/ubuntu-calculator-app.qml 2015-01-23 13:33:15 +0000
4@@ -221,6 +221,7 @@
5 visible: true
6 useDeprecatedToolbar: false
7 property color dividerColor: "#babbbc"
8+ property color panelColor: "white"
9 config: PageHeadConfiguration {
10 backAction: Action {
11 objectName: "cancelSelectionAction"
12@@ -230,13 +231,6 @@
13 }
14 actions: [
15 Action {
16- id: copySelectedAction
17- objectName: "copySelectedAction"
18- iconName: "edit-copy"
19- text: i18n.tr("Copy")
20- onTriggered: copySelectedCalculations()
21- },
22- Action {
23 id: selectAllAction
24 objectName: "selectAllAction"
25 iconName: "select"
26@@ -244,6 +238,13 @@
27 onTriggered: visualModel.selectAll()
28 },
29 Action {
30+ id: copySelectedAction
31+ objectName: "copySelectedAction"
32+ iconName: "edit-copy"
33+ text: i18n.tr("Copy")
34+ onTriggered: copySelectedCalculations()
35+ },
36+ Action {
37 id: multiDeleteAction
38 objectName: "multiDeleteAction"
39 iconName: "delete"
40@@ -300,9 +301,23 @@
41 visualModel.selectItem(visualDelegate);
42 }
43
44+ rightSideActions: [ screenDelegateCopyAction.item ]
45 leftSideAction: screenDelegateDeleteAction.item
46
47 Loader {
48+ id: screenDelegateCopyAction
49+ sourceComponent: Action {
50+ iconName: "edit-copy"
51+ text: i18n.tr("Copy")
52+ onTriggered: {
53+ var mimeData = Clipboard.newData();
54+ mimeData.text = model.formula + "=" + model.result;
55+ Clipboard.push(mimeData);
56+ }
57+ }
58+ }
59+
60+ Loader {
61 id: screenDelegateDeleteAction
62 sourceComponent: Action {
63 iconName: "delete"
64
65=== modified file 'app/ui/KeyboardButton.qml'
66--- app/ui/KeyboardButton.qml 2015-01-06 19:52:00 +0000
67+++ app/ui/KeyboardButton.qml 2015-01-23 13:33:15 +0000
68@@ -44,13 +44,19 @@
69 border.color: "#bdbec0"
70 border.width: units.dp(2)
71 color: buttonMA.pressed || buttonRect.kbdPressed ? pressedColor : buttonColor
72+
73+ Behavior on color {
74+ ColorAnimation {
75+ duration: UbuntuAnimation.SnapDuration
76+ }
77+ }
78 }
79
80 Text {
81 id: buttonText
82 anchors.centerIn: parent
83 color: "#5a5a5c"
84- font.pixelSize: 0.5 * parent.height
85+ font.pixelSize: 0.5 * parent.height
86 font.bold: true
87 }
88

Subscribers

People subscribed via source and target branches