← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nik90/ubuntu-clock-app/2-migrate-settings-page-listitems into lp:ubuntu-clock-app

 

Nekhelesh Ramananthan has proposed merging lp:~nik90/ubuntu-clock-app/2-migrate-settings-page-listitems into lp:ubuntu-clock-app with lp:~nik90/ubuntu-clock-app/1-migrate-add-city-listitems as a prerequisite.

Commit message:
Migrated settings page listitems to the new 15.04 list items

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-clock-app/2-migrate-settings-page-listitems/+merge/260973

This MP implements the following,
- Migrate SubtitledListItem, Settings Page listitems to the new 15.04 ones
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~nik90/ubuntu-clock-app/2-migrate-settings-page-listitems into lp:ubuntu-clock-app.
=== modified file 'app/alarm/AlarmSettingsPage.qml'
--- app/alarm/AlarmSettingsPage.qml	2015-06-03 16:07:05 +0000
+++ app/alarm/AlarmSettingsPage.qml	2015-06-03 16:07:05 +0000
@@ -17,10 +17,10 @@
  */
 
 import QtQuick 2.4
+import QtQuick.Layouts 1.1
 import DateTime 1.0
 import Alarm.Settings 1.0
 import Ubuntu.Components 1.2
-import Ubuntu.Components.ListItems 1.0 as ListItem
 import "../components"
 
 Page {
@@ -84,7 +84,7 @@
                 right: parent.right
             }
 
-            ListItem.Empty {
+            ListItem {
                 height: 2 * implicitHeight
 
                 Label {
@@ -119,60 +119,80 @@
             ExpandableListItem {
                 id: _alarmDuration
 
-                listViewHeight: units.gu(24)
+                listViewHeight: units.gu(28)
                 text: i18n.tr("Silence after")
                 subText: i18n.tr("%1 minute", "%1 minutes", alarmSettings.duration).arg(alarmSettings.duration)
 
                 model: durationModel
 
-                delegate: ListItem.Standard {
-                    text: model.text
+                delegate: ListItem {
+                    RowLayout {
+                        anchors {
+                            left: parent.left
+                            right: parent.right
+                            margins: units.gu(2)
+                            verticalCenter: parent.verticalCenter
+                        }
+
+                        Label {
+                            text: model.text
+                            Layout.fillWidth: true
+                        }
+
+                        Icon {
+                            width: units.gu(2)
+                            height: width
+                            name: "ok"
+                            visible: alarmSettings.duration === duration
+                        }
+                    }
+
                     onClicked: {
                         alarmSettings.duration = duration
                         _alarmDuration.expanded = false
                     }
-
-                    Icon {
-                        width: units.gu(2)
-                        height: width
-                        name: "ok"
-                        visible: alarmSettings.duration === duration
-                        anchors.right: parent.right
-                        anchors.rightMargin: units.gu(2)
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
                 }
             }
 
             ExpandableListItem {
                 id: _alarmSnooze
 
-                listViewHeight: units.gu(24)
+                listViewHeight: units.gu(28)
                 text: i18n.tr("Snooze for")
                 subText: i18n.tr("%1 minute", "%1 minutes", alarmSettings.snoozeDuration).arg(alarmSettings.snoozeDuration)
 
                 model: snoozeModel
 
-                delegate: ListItem.Standard {
-                    text: model.text
+                delegate: ListItem {
+                    RowLayout {
+                        anchors {
+                            left: parent.left
+                            right: parent.right
+                            margins: units.gu(2)
+                            verticalCenter: parent.verticalCenter
+                        }
+
+                        Label {
+                            text: model.text
+                            Layout.fillWidth: true
+                        }
+
+                        Icon {
+                            width: units.gu(2)
+                            height: width
+                            name: "ok"
+                            visible: alarmSettings.snoozeDuration === duration
+                        }
+                    }
+
                     onClicked: {
                         alarmSettings.snoozeDuration = duration
                         _alarmSnooze.expanded = false
                     }
-
-                    Icon {
-                        width: units.gu(2)
-                        height: width
-                        name: "ok"
-                        visible: alarmSettings.snoozeDuration === duration
-                        anchors.right: parent.right
-                        anchors.rightMargin: units.gu(2)
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
                 }
             }
 
-            ListItem.Empty {
+            ListItem {
                 Label {
                     text: i18n.tr("Vibration")
                     color: UbuntuColors.midAubergine

=== modified file 'app/components/ExpandableListItem.qml'
--- app/components/ExpandableListItem.qml	2015-06-03 16:07:05 +0000
+++ app/components/ExpandableListItem.qml	2015-06-03 16:07:05 +0000
@@ -43,7 +43,7 @@
     }
 
     collapseOnClick: true
-    expandedHeight: contentColumn.height + units.gu(1)
+    expandedHeight: contentColumn.height
 
     Column {
         id: contentColumn
@@ -53,30 +53,26 @@
             right: parent.right
         }
 
-        Item {
-            width: parent.width
+        SubtitledListItem {
+            id: expandableHeader
             height: expandableListItem.collapsedHeight
-
-            SubtitledListItem {
-                id: expandableHeader
-                onClicked: expandableListItem.expanded = true
-
-                Icon {
-                    id: arrow
-
-                    width: units.gu(2)
-                    height: width
-                    anchors.right: parent.right
-                    anchors.rightMargin: units.gu(2)
-                    anchors.verticalCenter: parent.verticalCenter
-
-                    name: "go-down"
-                    color: "Grey"
-                    rotation: expandableListItem.expanded ? 180 : 0
-
-                    Behavior on rotation {
-                        UbuntuNumberAnimation {}
-                    }
+            onClicked: expandableListItem.expanded = true
+
+            Icon {
+                id: arrow
+
+                width: units.gu(2)
+                height: width
+                anchors.right: parent.right
+                anchors.rightMargin: units.gu(2)
+                anchors.verticalCenter: parent.verticalCenter
+
+                name: "go-down"
+                color: "Grey"
+                rotation: expandableListItem.expanded ? 180 : 0
+
+                Behavior on rotation {
+                    UbuntuNumberAnimation {}
                 }
             }
         }

=== modified file 'app/components/SubtitledListItem.qml'
--- app/components/SubtitledListItem.qml	2015-06-03 16:07:05 +0000
+++ app/components/SubtitledListItem.qml	2015-06-03 16:07:05 +0000
@@ -18,7 +18,6 @@
 
 import QtQuick 2.4
 import Ubuntu.Components 1.2
-import Ubuntu.Components.ListItems 1.0 as ListItem
 
 /*
   This component is almost an identical copy of the SDK's subtitled with the
@@ -27,7 +26,7 @@
   #TODO: Revert to using the SDK Subtitled Component when they change the
   design to match the new clock app design.
  */
-ListItem.Empty {
+ListItem {
     id: _subtitledContainer
 
     // Property to set the main text label

=== modified file 'po/com.ubuntu.clock.pot'
--- po/com.ubuntu.clock.pot	2015-06-03 16:07:05 +0000
+++ po/com.ubuntu.clock.pot	2015-06-03 16:07:05 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-05-28 02:36+0200\n"
+"POT-Creation-Date: 2015-06-03 16:00+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -71,7 +71,7 @@
 #: ../app/alarm/AlarmSettingsPage.qml:65 ../app/alarm/AlarmSettingsPage.qml:66
 #: ../app/alarm/AlarmSettingsPage.qml:67 ../app/alarm/AlarmSettingsPage.qml:68
 #: ../app/alarm/AlarmSettingsPage.qml:124
-#: ../app/alarm/AlarmSettingsPage.qml:152
+#: ../app/alarm/AlarmSettingsPage.qml:162
 #, qt-format
 msgid "%1 minute"
 msgid_plural "%1 minutes"
@@ -86,15 +86,15 @@
 msgid "Silence after"
 msgstr ""
 
-#: ../app/alarm/AlarmSettingsPage.qml:151
+#: ../app/alarm/AlarmSettingsPage.qml:161
 msgid "Snooze for"
 msgstr ""
 
-#: ../app/alarm/AlarmSettingsPage.qml:177
+#: ../app/alarm/AlarmSettingsPage.qml:197
 msgid "Vibration"
 msgstr ""
 
-#: ../app/alarm/AlarmSettingsPage.qml:211
+#: ../app/alarm/AlarmSettingsPage.qml:231
 msgid "Change time and date"
 msgstr ""
 


Follow ups