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

Proposed by Riccardo Padovani
Status: Merged
Merged at revision: 17
Proposed branch: lp:~rpadovani/ubuntu-calculator-app/resultTextfield
Merge into: lp:ubuntu-calculator-app
Diff against target: 46 lines (+25/-3)
1 file modified
app/ubuntu-calculator-app.qml (+25/-3)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-calculator-app/resultTextfield
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Approve
Review via email: mp+243272@code.launchpad.net

Commit message

Improved the texfield where calc are inserted

Description of the change

Improved the texfield where calc are inserted

To post a comment you must log in.
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

I think TextField better fit our needs (please take a look at my comments)

Could you please check it by yourself?

If something do not working correctly, I could fix TextField (as I did before).

review: Needs Fixing
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

I thought about that. In a first implementation, I used TextField, unfortunately it's hard to stilish it. I think it's easier to implement the tooltip for TextInput than implement style for TextField.

Maybe I miss something, so please let me know if there is a better way

18. By Riccardo Padovani

Use Textfield instead TextInput

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Yap, stupid comment, fixed both, thanks for the suggestion

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

Copy/paste works perfectly for me.

Thanks Riccardo!

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 2014-11-28 20:54:49 +0000
3+++ app/ubuntu-calculator-app.qml 2014-12-02 00:01:03 +0000
4@@ -17,6 +17,7 @@
5 */
6 import QtQuick 2.3
7 import Ubuntu.Components 1.1
8+import Ubuntu.Components.Themes.Ambiance 0.1
9
10 import "ui"
11 import "engine/math.js" as MathJs
12@@ -247,10 +248,31 @@
13 footer: Column {
14 width: parent.width
15
16- Text {
17- width: parent.width
18- height: units.gu(5)
19+ TextField {
20+ height: units.gu(6)
21+ // Workaround to align text to right due bug #1320885
22+ // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1320885
23+ //width: parent.width - units.gu(2)
24+ width: contentWidth + units.gu(3)
25+ //anchors.horizontalCenter: parent.horizontalCenter
26+ anchors.right: parent.right
27+ anchors.rightMargin: units.gu(1)
28+
29+ // remove ubuntu shape
30+ style: TextFieldStyle {
31+ background: Item {
32+ }
33+ }
34+
35 text: displayedInputText
36+ font.pixelSize: units.gu(4)
37+
38+ // Decomment that when upstream bug is fixed
39+ //verticalAlignment: TextInput.AlignVCenter
40+ //horizontalAlignment: TextInput.AlignRight
41+
42+ readOnly: true
43+ selectByMouse: true
44 }
45
46 // TODO: insert here actual screen

Subscribers

People subscribed via source and target branches