on xenial help sign in
some fixes in send button and review text field size
commitf972e8e5c2a8cf1445636b90948941bf456ade96 authorDiego Sarmentero <diego.sarmentero@gmail.com> dateTue 23 Jul 2013, 13:04 (13 years ago) parentb2b0904
3 files changed+11−6
Dash/Apps/AppInfo.qml+1−1 Dash/Apps/AppReviews.qml+9−4 tests/qmltests/Dash/Apps/tst_AppInfo.qml+1−1
Dash/Apps/AppInfo.qml+1−1
@@ -81,7 +81,7 @@ Row {
8181 styleColor: "black"
8282 opacity: .6
8383 //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)
8585 }
8686 }
8787 }
Dash/Apps/AppReviews.qml+9−4
@@ -83,6 +83,8 @@ Column {
8383 height: units.gu(4)
8484 verticalAlignment: Text.AlignVCenter
8585
86+ Behavior on height { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
87+
8688 onFocusChanged: {
8789 if(reviewField.focus){
8890 root.state = "editing";
@@ -94,9 +96,10 @@ Column {
9496 if (reviewField.text == "") {
9597 root.state = "";
9698 reviewField.focus = false;
97− } else if (reviewField.lineCount > 1 && reviewField.lineCount < 6) {
98− reviewField.height = units.gu(3) * reviewField.lineCount;
99− } else if (reviewField.lineCount == 1) {
99+ } else if (reviewField.lineCount > 1) {
100+ reviewField.height = reviewField.contentHeight;
101+ }
102+ if (reviewField.lineCount == 1) {
100103 reviewField.height = units.gu(4);
101104 }
102105 }
@@ -115,13 +118,15 @@ Column {
115118 id: sendButton
116119 objectName: "sendButton"
117120 width: units.gu(10)
118− height: reviewField.height
121+ height: units.gu(4)
122+ anchors.bottom: reviewField.bottom
119123 color: Theme.palette.selected.foreground
120124 text: i18n.tr("Send")
121125 opacity: 0
122126
123127 onClicked: {
124128 root.sendReview(reviewField.text);
129+ reviewField.text = ""
125130 }
126131 }
127132 }
tests/qmltests/Dash/Apps/tst_AppInfo.qml+1−1
@@ -46,7 +46,7 @@ Item {
4646
4747 function test_reviews() {
4848 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");
5050 }
5151 }
5252}