Merge lp:~rpadovani/ubuntu-calculator-app/improveFavouriteTextfield into lp:ubuntu-calculator-app

Proposed by Riccardo Padovani
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
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

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
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://people.canonical.com/~alan/screenshots/device-2015-03-26-105328.png

140. By Riccardo Padovani

Hide favourite tip

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

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
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.

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

http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/webbrowser-app/vivid/view/head:/src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml

Maybe we should do in similar way but we could distinguish between "Mobile" and "Desktop"?

review: Needs Information
Revision history for this message
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

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

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

Fix wrong position of a component

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
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://people.canonical.com/~alan/screenshots/device-2015-03-30-103948.png

Which is confusing and wrong.

review: Needs Fixing
143. By Riccardo Padovani

Merge from trunk

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

Seems I had some crap on my device. It's working fine now!

review: Approve
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

It is working correctly for me. Thanks.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/ubuntu-calculator-app.qml'
--- app/ubuntu-calculator-app.qml 2015-03-06 21:15:52 +0000
+++ app/ubuntu-calculator-app.qml 2015-03-30 10:02:55 +0000
@@ -73,6 +73,11 @@
73 // If it is set to false, then editing will be invoked73 // If it is set to false, then editing will be invoked
74 property bool deleteSelectedCalculation: true;74 property bool deleteSelectedCalculation: true;
7575
76 Connections {
77 id: oskKeyboard
78 target: Qt.inputMethod
79 }
80
76 /**81 /**
77 * The function calls the Formula.deleteLastFormulaElement function and82 * The function calls the Formula.deleteLastFormulaElement function and
78 * place the result in right vars83 * place the result in right vars
@@ -204,7 +209,10 @@
204 PageStack {209 PageStack {
205 id: mainStack210 id: mainStack
206211
207 Component.onCompleted: push(calculatorPage)212 Component.onCompleted: {
213 push(calculatorPage);
214 calculatorPage.forceActiveFocus();
215 }
208216
209 PageWithBottomEdge {217 PageWithBottomEdge {
210 id: calculatorPage218 id: calculatorPage
@@ -217,6 +225,8 @@
217 title: i18n.tr("Favorite")225 title: i18n.tr("Favorite")
218 }226 }
219227
228 bottomEdgeEnabled: textInputField.visible
229
220 state: visualModel.isInSelectionMode ? "selection" : "default"230 state: visualModel.isInSelectionMode ? "selection" : "default"
221 states: [231 states: [
222 State {232 State {
@@ -348,8 +358,8 @@
348 visualModel.selectItem(visualDelegate);358 visualModel.selectItem(visualDelegate);
349 }359 }
350360
351 rightSideActions: [ screenDelegateCopyAction.item, 361 rightSideActions: [ screenDelegateCopyAction.item,
352 screenDelegateEditAction.item, 362 screenDelegateEditAction.item,
353 screenDelegateFavouriteAction.item ]363 screenDelegateFavouriteAction.item ]
354 leftSideAction: screenDelegateDeleteAction.item364 leftSideAction: screenDelegateDeleteAction.item
355365
@@ -385,10 +395,10 @@
385 id: screenDelegateFavouriteAction395 id: screenDelegateFavouriteAction
386 sourceComponent: Action {396 sourceComponent: Action {
387 iconName: (editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred"397 iconName: (editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred"
388 398
389 text: i18n.tr("Add to favorites")399 text: i18n.tr("Add to favorites")
390 onTriggered: {400 onTriggered: {
391 401
392 if (model.isFavourite) {402 if (model.isFavourite) {
393 calculationHistory.updateCalculationInDatabase(model.index, model.dbId, !model.isFavourite, "");403 calculationHistory.updateCalculationInDatabase(model.index, model.dbId, !model.isFavourite, "");
394 editedCalculationIndex = -1;404 editedCalculationIndex = -1;
@@ -400,7 +410,7 @@
400 favouriteTextField.forceActiveFocus();410 favouriteTextField.forceActiveFocus();
401 scrollableView.scrollToBottom();411 scrollableView.scrollToBottom();
402 }412 }
403 413
404 model.isFavourite = !model.isFavourite;414 model.isFavourite = !model.isFavourite;
405 }415 }
406 }416 }
@@ -525,10 +535,10 @@
525 id: favouriteTextField535 id: favouriteTextField
526536
527 anchors {537 anchors {
528 right: confirmFavourite.left538 right: parent.right
529 rightMargin: units.gu(1)539 rightMargin: units.gu(1)
530 }540 }
531 width: parent.width - confirmFavourite.width - units.gu(3)541 width: parent.width - units.gu(3)
532 height: parent.height542 height: parent.height
533 visible: !textInputField.visible543 visible: !textInputField.visible
534544
@@ -547,49 +557,23 @@
547 }557 }
548 }558 }
549559
550 560 onAccepted: {
551 }561 textInputField.visible = true;
552562 textInputField.forceActiveFocus();
553 Icon {563 if (editedCalculationIndex >= 0) {
554 id: confirmFavourite564 calculationHistory.updateCalculationInDatabase(editedCalculationIndex,
555 visible: favouriteTextField.visible565 calculationHistory.getContents().get(editedCalculationIndex).dbId,
556566 true,
557 name: "keyboard-enter"567 favouriteTextField.text);
558568 favouriteTextField.text = "";
559 anchors {569 editedCalculationIndex = -1;
560 right: parent.right
561 rightMargin: units.gu(1)
562 top: parent.top
563 topMargin: units.gu(1)
564 }
565
566 MouseArea {
567 anchors.fill: parent
568
569 onReleased: {
570 textInputField.visible = true;
571 textInputField.forceActiveFocus();
572 if (editedCalculationIndex >= 0) {
573 calculationHistory.updateCalculationInDatabase(editedCalculationIndex,
574 calculationHistory.getContents().get(editedCalculationIndex).dbId,
575 true,
576 favouriteTextField.text);
577 favouriteTextField.text = "";
578 editedCalculationIndex = -1;
579 }
580 }570 }
581 }571 }
582 height: parent.height - units.gu(2)
583 width: height
584 }572 }
585573
586 TextField {574 TextField {
587 id: textInputField575 id: textInputField
588 objectName: "textInputField"576 objectName: "textInputField"
589 // TODO: Make sure this bug gets fixed in SDK:
590 // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1320885
591 // It has been fixed in vivid - wait until it becomes the stable
592 // version before removing this
593 width: parent.width - units.gu(2)577 width: parent.width - units.gu(2)
594 height: parent.height578 height: parent.height
595579
@@ -651,7 +635,7 @@
651 Loader {635 Loader {
652 id: keyboardLoader636 id: keyboardLoader
653 width: parent.width637 width: parent.width
654 visible: textInputField.visible638 visible: textInputField.visible && !oskKeyboard.visible
655 source: scrollableView.width > scrollableView.height ? "ui/LandscapeKeyboard.qml" : "ui/PortraitKeyboard.qml"639 source: scrollableView.width > scrollableView.height ? "ui/LandscapeKeyboard.qml" : "ui/PortraitKeyboard.qml"
656 opacity: ((y + height) >= scrollableView.contentY) && (y <= (scrollableView.contentY + scrollableView.height)) ? 1 : 0640 opacity: ((y + height) >= scrollableView.contentY) && (y <= (scrollableView.contentY + scrollableView.height)) ? 1 : 0
657 }641 }
658642
=== modified file 'app/ui/KeyboardButton.qml'
--- app/ui/KeyboardButton.qml 2015-03-06 21:13:52 +0000
+++ app/ui/KeyboardButton.qml 2015-03-30 10:02:55 +0000
@@ -22,7 +22,7 @@
22AbstractButton {22AbstractButton {
23 id: buttonRect23 id: buttonRect
24 objectName: modelname + "Button"24 objectName: modelname + "Button"
25 activeFocusOnPress: false25 activeFocusOnPress: true
2626
27 property real baseSize: 127 property real baseSize: 1
28 property alias text: buttonText.text28 property alias text: buttonText.text
@@ -36,6 +36,7 @@
36 onKbdPressedChanged: {36 onKbdPressedChanged: {
37 if (!kbdPressed) {37 if (!kbdPressed) {
38 buttonRect.clicked();38 buttonRect.clicked();
39 buttonRect.forceActiveFocus();
39 }40 }
40 }41 }
4142

Subscribers

People subscribed via source and target branches