← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-keyboard-swipe-fix2 into lp:ubuntu-calculator-app

 

See it didn't published my inline comment, sorry!

Diff comments:

> === modified file 'app/ubuntu-calculator-app.qml'
> --- app/ubuntu-calculator-app.qml	2015-06-17 20:11:29 +0000
> +++ app/ubuntu-calculator-app.qml	2015-06-18 21:38:28 +0000
> @@ -167,7 +167,7 @@
>              try {
>                  shortFormula = formatBigNumber(mathJs.eval(shortFormula));
>              } catch(exception) {
> -                console.log("Error: math.js " + exception.toString() + " engine formula:" + shortFormula);
> +                console.log("Info: Unable to create temporarly result " + exception.toString() + " formula:" + shortFormula);
>              }
>  
>              isFormulaIsValidToCalculate = false;
> 
> === modified file 'app/ui/CalcKeyboard.qml'
> --- app/ui/CalcKeyboard.qml	2015-03-05 22:57:16 +0000
> +++ app/ui/CalcKeyboard.qml	2015-06-18 21:38:28 +0000
> @@ -22,8 +22,8 @@
>      id: virtualKeyboard
>      height: flickableKeyboard.height + units.gu(1)
>  
> -    property int pressedKey: -1
> -    property string pressedKeyText: ""
> +    property int pressedKey: -1;
> +    property string pressedKeyText: "";

We use ';' only in Javascript snippets, not in pure qml, please remove that :-)

>  
>      default property alias children: keyboardsRow.children
>  
> @@ -38,21 +38,23 @@
>  
>          property int currentIndex: 0
>  
> -        onDragEnded: {
> +        onMovementEnded: {
>              var index = 0;
>              if (horizontalVelocity > units.gu(50)) {
> -                index = Math.min(keyboardsRow.children.length - 1, currentIndex + 1)
> +                // Don't allow to change index above the number of keyboards
> +                index = Math.min(keyboardsRow.children.length - 1, currentIndex + 1);
>              } else if (horizontalVelocity < -units.gu(50)) {
> -                index = Math.max(0, currentIndex - 1)
> +                // Don't allow to change index below 0
> +                index = Math.max(0, currentIndex - 1);
>              } else {
> -                index = Math.round(contentX / (width + keyboardsRow.spacing))
> -                index = Math.max(0, index)
> -                index = Math.min(keyboardsRow.children.length - 1, index)
> +                index = Math.round(contentX / (width + keyboardsRow.spacing));
> +                index = Math.max(0, index);
> +                index = Math.min(keyboardsRow.children.length - 1, index);
>              }
>  
>              currentIndex = index;
> -            snapAnimation.to = index * (flickableKeyboard.width)
> -            snapAnimation.start()
> +            snapAnimation.to = index * (flickableKeyboard.width);
> +            snapAnimation.start();
>          }
>  
>          UbuntuNumberAnimation {
> 


-- 
https://code.launchpad.net/~gang65/ubuntu-calculator-app/ubuntu-calculator-app-keyboard-swipe-fix2/+merge/262393
Your team Ubuntu Calculator Developers is subscribed to branch lp:ubuntu-calculator-app.


References