← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nik90/ubuntu-clock-app/fix-empty-state-wrap into lp:ubuntu-clock-app

 

Nekhelesh Ramananthan has proposed merging lp:~nik90/ubuntu-clock-app/fix-empty-state-wrap into lp:ubuntu-clock-app.

Commit message:
Fixed the empty state message not wrapping correctly.

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)
Related bugs:
  Bug #1428165 in Ubuntu Clock App: "Should use wrapping for the "no alarms" description text"
  https://bugs.launchpad.net/ubuntu-clock-app/+bug/1428165

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-clock-app/fix-empty-state-wrap/+merge/251924

Fixes the empty state message not wrapping correctly. Tested with a really long string as shown in http://imgur.com/U41ixrZ
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~nik90/ubuntu-clock-app/fix-empty-state-wrap into lp:ubuntu-clock-app.
=== modified file 'app/alarm/AlarmPage.qml'
--- app/alarm/AlarmPage.qml	2014-10-28 10:54:45 +0000
+++ app/alarm/AlarmPage.qml	2015-03-05 12:56:40 +0000
@@ -140,7 +140,12 @@
 
     Loader {
         id: emptyStateLoader
-        anchors.centerIn: parent
+        anchors {
+            left: parent.left
+            right: parent.right
+            margins: units.gu(2)
+            verticalCenter: parent.verticalCenter
+        }
         active: alarmModel ? alarmModel.count === 0 : true
         Component.onCompleted: {
             setSource(Qt.resolvedUrl("../components/EmptyState.qml"),

=== modified file 'app/components/EmptyState.qml'
--- app/components/EmptyState.qml	2014-10-16 14:24:25 +0000
+++ app/components/EmptyState.qml	2015-03-05 12:56:40 +0000
@@ -33,6 +33,7 @@
     property alias subTitle: emptySublabel.text
 
     height: childrenRect.height
+    width: parent.width
 
     Icon {
         id: emptyIcon
@@ -44,16 +45,19 @@
 
     Label {
         id: emptyLabel
+        fontSize: "large"
+        font.bold: true
+        width: parent.width
         anchors.top: emptyIcon.bottom
         anchors.topMargin: units.gu(5)
-        anchors.horizontalCenter: parent.horizontalCenter
-        fontSize: "large"
-        font.bold: true
+        horizontalAlignment: Text.AlignHCenter
     }
 
     Label {
         id: emptySublabel
+        width: parent.width
+        wrapMode: Text.WordWrap
         anchors.top: emptyLabel.bottom
-        anchors.horizontalCenter: parent.horizontalCenter
+        horizontalAlignment: Text.AlignHCenter
     }
 }

=== modified file 'po/com.ubuntu.clock.pot'
--- po/com.ubuntu.clock.pot	2015-02-27 12:15:58 +0000
+++ po/com.ubuntu.clock.pot	2015-03-05 12:56:40 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-27 13:15+0100\n"
+"POT-Creation-Date: 2015-03-05 13:52+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -48,11 +48,11 @@
 msgid "Select All"
 msgstr ""
 
-#: ../app/alarm/AlarmPage.qml:149
+#: ../app/alarm/AlarmPage.qml:154
 msgid "No saved alarms"
 msgstr ""
 
-#: ../app/alarm/AlarmPage.qml:150
+#: ../app/alarm/AlarmPage.qml:155
 msgid "Tap the + icon to add an alarm"
 msgstr ""
 


Follow ups