on xenial help sign in
some fixes in send button and review text field size
f972e8eDiego Sarmentero
Dash/Apps/AppInfo.qml+1−1
@@ -81,7 +81,7 @@ Row {
81 styleColor: "black"
81 styleColor: "black"
82 opacity: .6
82 opacity: .6
83 //TRANSLATORS: Number of persons who wrote reviews for this app
83 //TRANSLATORS: Number of persons who wrote reviews for this app
84− text: i18n.tr("%n review", "%n reviews", root.reviews)
84+ text: i18n.tr("%1 review", "%1 reviews", root.reviews).arg(root.reviews)
85 }
85 }
86 }
86 }
87 }
87 }
Dash/Apps/AppReviews.qml+9−4
@@ -83,6 +83,8 @@ Column {
83 height: units.gu(4)
83 height: units.gu(4)
84 verticalAlignment: Text.AlignVCenter
84 verticalAlignment: Text.AlignVCenter
85
85
86+ Behavior on height { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
87+
86 onFocusChanged: {
88 onFocusChanged: {
87 if(reviewField.focus){
89 if(reviewField.focus){
88 root.state = "editing";
90 root.state = "editing";
@@ -94,9 +96,10 @@ Column {
94 if (reviewField.text == "") {
96 if (reviewField.text == "") {
95 root.state = "";
97 root.state = "";
96 reviewField.focus = false;
98 reviewField.focus = false;
97− } else if (reviewField.lineCount > 1 && reviewField.lineCount < 6) {
99+ } else if (reviewField.lineCount > 1) {
98− reviewField.height = units.gu(3) * reviewField.lineCount;
100+ reviewField.height = reviewField.contentHeight;
101+ }
99− } else if (reviewField.lineCount == 1) {
102+ if (reviewField.lineCount == 1) {
100 reviewField.height = units.gu(4);
103 reviewField.height = units.gu(4);
101 }
104 }
102 }
105 }
@@ -115,13 +118,15 @@ Column {
115 id: sendButton
118 id: sendButton
116 objectName: "sendButton"
119 objectName: "sendButton"
117 width: units.gu(10)
120 width: units.gu(10)
121+ height: units.gu(4)
118− height: reviewField.height
122+ anchors.bottom: reviewField.bottom
119 color: Theme.palette.selected.foreground
123 color: Theme.palette.selected.foreground
120 text: i18n.tr("Send")
124 text: i18n.tr("Send")
121 opacity: 0
125 opacity: 0
122
126
123 onClicked: {
127 onClicked: {
124 root.sendReview(reviewField.text);
128 root.sendReview(reviewField.text);
129+ reviewField.text = ""
125 }
130 }
126 }
131 }
127 }
132 }
tests/qmltests/Dash/Apps/tst_AppInfo.qml+1−1
@@ -46,7 +46,7 @@ Item {
46
46
47 function test_reviews() {
47 function test_reviews() {
48 var rated = findChild(appInfo, "reviewsLabel");
48 var rated = findChild(appInfo, "reviewsLabel");
49− compare(rated.text, i18n.tr("%n review", "%n reviews", 8), "Reviews don't match");
49+ compare(rated.text, i18n.tr("%1 review", "%1 reviews", 8).arg(8), "Reviews don't match");
50 }
50 }
51 }
51 }
52}
52}