~nik90/ubuntu-weather-app/fix-ota10-sdk-issues

« back to all changes in this revision

Viewing changes to app/ui/settings/LocationPage.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2016-02-28 22:40:41 UTC
  • Revision ID: krnekhelesh@gmail.com-20160228224041-6igc1h51f42xy2oi
Migrated all child settings page to listitemlayout and pageheader

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2015 Canonical Ltd
 
2
 * Copyright (C) 2015-2016 Canonical Ltd
3
3
 *
4
4
 * This file is part of Ubuntu Weather App
5
5
 *
18
18
 
19
19
import QtQuick 2.4
20
20
import Ubuntu.Components 1.3
21
 
import Ubuntu.Components.ListItems 1.0 as ListItem
22
21
 
23
22
Page {
24
 
    title: i18n.tr("Location")
25
 
 
26
 
    ListItem.Standard {
27
 
        control: CheckBox {
28
 
            checked: settings.detectCurrentLocation
29
 
 
30
 
            onCheckedChanged: settings.detectCurrentLocation = checked;
 
23
    id: locationPage
 
24
 
 
25
    header: PageHeader {
 
26
        title: i18n.tr("Location")
 
27
    }
 
28
 
 
29
    ListItem {
 
30
        anchors.top: locationPage.header.bottom
 
31
        height: locationLayout.height + divider.height
 
32
        ListItemLayout {
 
33
            id: locationLayout
 
34
            title.text: i18n.tr("Detect current location")
 
35
            Switch {
 
36
                id: locationSwitch
 
37
                SlotsLayout.position: SlotsLayout.Last
 
38
                checked: settings.detectCurrentLocation
 
39
                onCheckedChanged: settings.detectCurrentLocation = checked;
 
40
            }
31
41
        }
32
 
        text: i18n.tr("Detect current location")
33
42
 
34
 
        onClicked: control.checked = !control.checked
 
43
        onClicked: locationSwitch.checked = !locationSwitch.checked
35
44
    }
36
45
}