Merge lp:~rpadovani/ubuntu-calculator-app/improveFavouriteTextfield into lp:ubuntu-calculator-app
- improveFavouriteTextfield
- Merge into trunk
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Bartosz Kosiorek | ||||||||||||
Approved revision: | 143 | ||||||||||||
Merged at revision: | 145 | ||||||||||||
Proposed branch: | lp:~rpadovani/ubuntu-calculator-app/improveFavouriteTextfield | ||||||||||||
Merge into: | lp:ubuntu-calculator-app | ||||||||||||
Diff against target: |
171 lines (+31/-46) 2 files modified
app/ubuntu-calculator-app.qml (+29/-45) app/ui/KeyboardButton.qml (+2/-1) |
||||||||||||
To merge this branch: | bzr merge lp:~rpadovani/ubuntu-calculator-app/improveFavouriteTextfield | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Bartosz Kosiorek | Approve | ||
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Review via email: mp+254001@code.launchpad.net |
Commit message
Improve favourite textfield management
Description of the change
Improve favourite textfield management
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
This is certainly an improvement.
Added bug 1436792 which is related.
After adding the favourite, the screen seems to get stuck like this for a couple of seconds.
http://
- 140. By Riccardo Padovani
-
Hide favourite tip
Riccardo Padovani (rpadovani) wrote : | # |
> Added bug 1436792 which is related.
I improved the behavior of the tip, let me know what do you think
> After adding the favourite, the screen seems to get stuck like this for a
> couple of seconds.
Uh, this is tricky, I have an idea on how to fix it, but I need to do some experiments
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:140
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Bartosz Kosiorek (gang65) wrote : | # |
Regarding to bug 1435881
The "enter key" icon should be displayed only on Desktop, because without OSK you don't have possibility to confirm Favourite caption.
Bartosz Kosiorek (gang65) wrote : | # |
The distinguish between Calculator and Webbrowser is already implemented in Browser.
There is formFactor == "Mobile", "Tablet" and "Desktop".
readonly property string _formFactor: (Screen.width >= units.gu(60)) ? "Tablet" : "Mobile"
Maybe we should do in similar way but we could distinguish between "Mobile" and "Desktop"?
Bartosz Kosiorek (gang65) wrote : | # |
Hi.
Checking formFactor is wrong idea.
We should check if OSK is enabled there:
1. If OSK is enabled, then do not display favourite's confirmation button,
2. If OSK is disabled, then display favourite's confirmation button
For now let's just delete confirmaation button. We will reintroduce it later.
- 141. By Riccardo Padovani
-
Fix wrong keyboard management
Riccardo Padovani (rpadovani) wrote : | # |
@popey: I think I fixed it, let me know
@gang65: since we want to land this asap and our focus isn't desktop, let's fix this in another branch :-)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:141
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 142. By Riccardo Padovani
-
Fix wrong position of a component
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:142
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Add a favourite, then go to Favourites and untap the star. Close favourites and then open it again.. you get this:-
http://
Which is confusing and wrong.
- 143. By Riccardo Padovani
-
Merge from trunk
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Seems I had some crap on my device. It's working fine now!
Bartosz Kosiorek (gang65) wrote : | # |
It is working correctly for me. Thanks.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:143
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'app/ubuntu-calculator-app.qml' | |||
2 | --- app/ubuntu-calculator-app.qml 2015-03-06 21:15:52 +0000 | |||
3 | +++ app/ubuntu-calculator-app.qml 2015-03-30 10:02:55 +0000 | |||
4 | @@ -73,6 +73,11 @@ | |||
5 | 73 | // If it is set to false, then editing will be invoked | 73 | // If it is set to false, then editing will be invoked |
6 | 74 | property bool deleteSelectedCalculation: true; | 74 | property bool deleteSelectedCalculation: true; |
7 | 75 | 75 | ||
8 | 76 | Connections { | ||
9 | 77 | id: oskKeyboard | ||
10 | 78 | target: Qt.inputMethod | ||
11 | 79 | } | ||
12 | 80 | |||
13 | 76 | /** | 81 | /** |
14 | 77 | * The function calls the Formula.deleteLastFormulaElement function and | 82 | * The function calls the Formula.deleteLastFormulaElement function and |
15 | 78 | * place the result in right vars | 83 | * place the result in right vars |
16 | @@ -204,7 +209,10 @@ | |||
17 | 204 | PageStack { | 209 | PageStack { |
18 | 205 | id: mainStack | 210 | id: mainStack |
19 | 206 | 211 | ||
21 | 207 | Component.onCompleted: push(calculatorPage) | 212 | Component.onCompleted: { |
22 | 213 | push(calculatorPage); | ||
23 | 214 | calculatorPage.forceActiveFocus(); | ||
24 | 215 | } | ||
25 | 208 | 216 | ||
26 | 209 | PageWithBottomEdge { | 217 | PageWithBottomEdge { |
27 | 210 | id: calculatorPage | 218 | id: calculatorPage |
28 | @@ -217,6 +225,8 @@ | |||
29 | 217 | title: i18n.tr("Favorite") | 225 | title: i18n.tr("Favorite") |
30 | 218 | } | 226 | } |
31 | 219 | 227 | ||
32 | 228 | bottomEdgeEnabled: textInputField.visible | ||
33 | 229 | |||
34 | 220 | state: visualModel.isInSelectionMode ? "selection" : "default" | 230 | state: visualModel.isInSelectionMode ? "selection" : "default" |
35 | 221 | states: [ | 231 | states: [ |
36 | 222 | State { | 232 | State { |
37 | @@ -348,8 +358,8 @@ | |||
38 | 348 | visualModel.selectItem(visualDelegate); | 358 | visualModel.selectItem(visualDelegate); |
39 | 349 | } | 359 | } |
40 | 350 | 360 | ||
43 | 351 | rightSideActions: [ screenDelegateCopyAction.item, | 361 | rightSideActions: [ screenDelegateCopyAction.item, |
44 | 352 | screenDelegateEditAction.item, | 362 | screenDelegateEditAction.item, |
45 | 353 | screenDelegateFavouriteAction.item ] | 363 | screenDelegateFavouriteAction.item ] |
46 | 354 | leftSideAction: screenDelegateDeleteAction.item | 364 | leftSideAction: screenDelegateDeleteAction.item |
47 | 355 | 365 | ||
48 | @@ -385,10 +395,10 @@ | |||
49 | 385 | id: screenDelegateFavouriteAction | 395 | id: screenDelegateFavouriteAction |
50 | 386 | sourceComponent: Action { | 396 | sourceComponent: Action { |
51 | 387 | iconName: (editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred" | 397 | iconName: (editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred" |
53 | 388 | 398 | ||
54 | 389 | text: i18n.tr("Add to favorites") | 399 | text: i18n.tr("Add to favorites") |
55 | 390 | onTriggered: { | 400 | onTriggered: { |
57 | 391 | 401 | ||
58 | 392 | if (model.isFavourite) { | 402 | if (model.isFavourite) { |
59 | 393 | calculationHistory.updateCalculationInDatabase(model.index, model.dbId, !model.isFavourite, ""); | 403 | calculationHistory.updateCalculationInDatabase(model.index, model.dbId, !model.isFavourite, ""); |
60 | 394 | editedCalculationIndex = -1; | 404 | editedCalculationIndex = -1; |
61 | @@ -400,7 +410,7 @@ | |||
62 | 400 | favouriteTextField.forceActiveFocus(); | 410 | favouriteTextField.forceActiveFocus(); |
63 | 401 | scrollableView.scrollToBottom(); | 411 | scrollableView.scrollToBottom(); |
64 | 402 | } | 412 | } |
66 | 403 | 413 | ||
67 | 404 | model.isFavourite = !model.isFavourite; | 414 | model.isFavourite = !model.isFavourite; |
68 | 405 | } | 415 | } |
69 | 406 | } | 416 | } |
70 | @@ -525,10 +535,10 @@ | |||
71 | 525 | id: favouriteTextField | 535 | id: favouriteTextField |
72 | 526 | 536 | ||
73 | 527 | anchors { | 537 | anchors { |
75 | 528 | right: confirmFavourite.left | 538 | right: parent.right |
76 | 529 | rightMargin: units.gu(1) | 539 | rightMargin: units.gu(1) |
77 | 530 | } | 540 | } |
79 | 531 | width: parent.width - confirmFavourite.width - units.gu(3) | 541 | width: parent.width - units.gu(3) |
80 | 532 | height: parent.height | 542 | height: parent.height |
81 | 533 | visible: !textInputField.visible | 543 | visible: !textInputField.visible |
82 | 534 | 544 | ||
83 | @@ -547,49 +557,23 @@ | |||
84 | 547 | } | 557 | } |
85 | 548 | } | 558 | } |
86 | 549 | 559 | ||
117 | 550 | 560 | onAccepted: { | |
118 | 551 | } | 561 | textInputField.visible = true; |
119 | 552 | 562 | textInputField.forceActiveFocus(); | |
120 | 553 | Icon { | 563 | if (editedCalculationIndex >= 0) { |
121 | 554 | id: confirmFavourite | 564 | calculationHistory.updateCalculationInDatabase(editedCalculationIndex, |
122 | 555 | visible: favouriteTextField.visible | 565 | calculationHistory.getContents().get(editedCalculationIndex).dbId, |
123 | 556 | 566 | true, | |
124 | 557 | name: "keyboard-enter" | 567 | favouriteTextField.text); |
125 | 558 | 568 | favouriteTextField.text = ""; | |
126 | 559 | anchors { | 569 | editedCalculationIndex = -1; |
97 | 560 | right: parent.right | ||
98 | 561 | rightMargin: units.gu(1) | ||
99 | 562 | top: parent.top | ||
100 | 563 | topMargin: units.gu(1) | ||
101 | 564 | } | ||
102 | 565 | |||
103 | 566 | MouseArea { | ||
104 | 567 | anchors.fill: parent | ||
105 | 568 | |||
106 | 569 | onReleased: { | ||
107 | 570 | textInputField.visible = true; | ||
108 | 571 | textInputField.forceActiveFocus(); | ||
109 | 572 | if (editedCalculationIndex >= 0) { | ||
110 | 573 | calculationHistory.updateCalculationInDatabase(editedCalculationIndex, | ||
111 | 574 | calculationHistory.getContents().get(editedCalculationIndex).dbId, | ||
112 | 575 | true, | ||
113 | 576 | favouriteTextField.text); | ||
114 | 577 | favouriteTextField.text = ""; | ||
115 | 578 | editedCalculationIndex = -1; | ||
116 | 579 | } | ||
127 | 580 | } | 570 | } |
128 | 581 | } | 571 | } |
129 | 582 | height: parent.height - units.gu(2) | ||
130 | 583 | width: height | ||
131 | 584 | } | 572 | } |
132 | 585 | 573 | ||
133 | 586 | TextField { | 574 | TextField { |
134 | 587 | id: textInputField | 575 | id: textInputField |
135 | 588 | objectName: "textInputField" | 576 | objectName: "textInputField" |
136 | 589 | // TODO: Make sure this bug gets fixed in SDK: | ||
137 | 590 | // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1320885 | ||
138 | 591 | // It has been fixed in vivid - wait until it becomes the stable | ||
139 | 592 | // version before removing this | ||
140 | 593 | width: parent.width - units.gu(2) | 577 | width: parent.width - units.gu(2) |
141 | 594 | height: parent.height | 578 | height: parent.height |
142 | 595 | 579 | ||
143 | @@ -651,7 +635,7 @@ | |||
144 | 651 | Loader { | 635 | Loader { |
145 | 652 | id: keyboardLoader | 636 | id: keyboardLoader |
146 | 653 | width: parent.width | 637 | width: parent.width |
148 | 654 | visible: textInputField.visible | 638 | visible: textInputField.visible && !oskKeyboard.visible |
149 | 655 | source: scrollableView.width > scrollableView.height ? "ui/LandscapeKeyboard.qml" : "ui/PortraitKeyboard.qml" | 639 | source: scrollableView.width > scrollableView.height ? "ui/LandscapeKeyboard.qml" : "ui/PortraitKeyboard.qml" |
150 | 656 | opacity: ((y + height) >= scrollableView.contentY) && (y <= (scrollableView.contentY + scrollableView.height)) ? 1 : 0 | 640 | opacity: ((y + height) >= scrollableView.contentY) && (y <= (scrollableView.contentY + scrollableView.height)) ? 1 : 0 |
151 | 657 | } | 641 | } |
152 | 658 | 642 | ||
153 | === modified file 'app/ui/KeyboardButton.qml' | |||
154 | --- app/ui/KeyboardButton.qml 2015-03-06 21:13:52 +0000 | |||
155 | +++ app/ui/KeyboardButton.qml 2015-03-30 10:02:55 +0000 | |||
156 | @@ -22,7 +22,7 @@ | |||
157 | 22 | AbstractButton { | 22 | AbstractButton { |
158 | 23 | id: buttonRect | 23 | id: buttonRect |
159 | 24 | objectName: modelname + "Button" | 24 | objectName: modelname + "Button" |
161 | 25 | activeFocusOnPress: false | 25 | activeFocusOnPress: true |
162 | 26 | 26 | ||
163 | 27 | property real baseSize: 1 | 27 | property real baseSize: 1 |
164 | 28 | property alias text: buttonText.text | 28 | property alias text: buttonText.text |
165 | @@ -36,6 +36,7 @@ | |||
166 | 36 | onKbdPressedChanged: { | 36 | onKbdPressedChanged: { |
167 | 37 | if (!kbdPressed) { | 37 | if (!kbdPressed) { |
168 | 38 | buttonRect.clicked(); | 38 | buttonRect.clicked(); |
169 | 39 | buttonRect.forceActiveFocus(); | ||
170 | 39 | } | 40 | } |
171 | 40 | } | 41 | } |
172 | 41 | 42 |
PASSED: Continuous integration, rev:139 91.189. 93.70:8080/ job/ubuntu- calculator- app-reboot- ci/128/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2412 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2412/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- calculator- app-reboot- utopic- amd64-ci/ 21 91.189. 93.70:8080/ job/ubuntu- calculator- app-reboot- vivid-amd64- ci/128
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calculator- app-reboot- ci/128/ rebuild
http://