~jonas-drange/ubuntu-system-settings/update-cannot-be-ota

« back to all changes in this revision

Viewing changes to plugins/flight-mode/EntryComponent.qml

  • Committer: Bileto Bot
  • Author(s): Ken VanDine
  • Date: 2016-07-22 14:38:13 UTC
  • mfrom: (1556.3.32 slotsLayout)
  • Revision ID: ci-train-bot@canonical.com-20160722143813-ht9e4766lm0ie5fa
Ported to use Slots layout and updated visuals (LP: #1596529)

Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This file is part of system-settings
3
3
 *
4
 
 * Copyright (C) 2013 Canonical Ltd.
 
4
 * Copyright (C) 2013-2016 Canonical Ltd.
5
5
 *
6
6
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
7
7
 *
20
20
 
21
21
import QtQuick 2.4
22
22
import Ubuntu.Components 1.3
23
 
import Ubuntu.Components.ListItems 1.3 as ListItem
24
23
import Ubuntu.SystemSettings.FlightMode 1.0 as FlightMode
25
24
import Ubuntu.Settings.Components 0.1 as USC
26
25
 
27
 
ListItem.Standard {
 
26
ListItem {
28
27
    id: root
29
 
    iconSource: model.icon
30
 
    iconFrame: false
31
 
    text: i18n.tr(model.displayName)
32
 
    control: Switch {
33
 
        id: switchItem
34
 
 
35
 
        USC.ServerPropertySynchroniser {
36
 
            userTarget: switchItem
37
 
            userProperty: "checked"
38
 
            serverTarget: helper
39
 
            serverProperty: "inFlightMode"
40
 
 
41
 
            onSyncTriggered: helper.setFlightMode(value)
 
28
    height: layout.height
 
29
 
 
30
    ListItemLayout {
 
31
        id: layout
 
32
        title.text: i18n.tr(model.displayName)
 
33
 
 
34
        Switch {
 
35
            id: switchItem
 
36
 
 
37
            SlotsLayout.position: SlotsLayout.Trailing
 
38
            USC.ServerPropertySynchroniser {
 
39
                userTarget: switchItem
 
40
                userProperty: "checked"
 
41
                serverTarget: helper
 
42
                serverProperty: "inFlightMode"
 
43
    
 
44
                onSyncTriggered: helper.setFlightMode(value)
 
45
            }
 
46
        }
 
47
        Icon {
 
48
            SlotsLayout.position: SlotsLayout.Leading;
 
49
            SlotsLayout.padding { top: 0; bottom: 0 }
 
50
            source: model.icon
 
51
            height: units.gu(5)
42
52
        }
43
53
    }
44
54