~ken-vandine/ubuntu-system-settings/no_s_i_d

« back to all changes in this revision

Viewing changes to plugins/orientation-lock/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
 *
22
22
import QtQuick 2.4
23
23
import QtQuick.Window 2.1
24
24
import Ubuntu.Components 1.3
25
 
import Ubuntu.Components.ListItems 1.3 as ListItem
26
 
 
27
 
 
28
 
ListItem.Standard {
 
25
 
 
26
 
 
27
ListItem {
29
28
    id: root
30
 
    iconSource: model.icon
31
 
    iconFrame: false
32
 
    text: i18n.tr(model.displayName)
33
 
    control: Switch {
34
 
        id: control
35
 
        objectName: "orientationLockSwitch"
36
 
 
37
 
        property bool serverChecked: systemSettings.rotationLock
38
 
        onServerCheckedChanged: checked = serverChecked
39
 
        Component.onCompleted: checked = serverChecked
40
 
        onTriggered: systemSettings.rotationLock = checked
41
 
 
42
 
        GSettings {
43
 
            id: systemSettings
44
 
            schema.id: "com.ubuntu.touch.system"
 
29
    height: layout.height
 
30
 
 
31
    ListItemLayout {
 
32
        id: layout
 
33
        title.text: i18n.tr(model.displayName)
 
34
        Switch {
 
35
            id: control
 
36
            objectName: "orientationLockSwitch"
 
37
 
 
38
            SlotsLayout.position: SlotsLayout.Trailing
 
39
            property bool serverChecked: systemSettings.rotationLock
 
40
            onServerCheckedChanged: checked = serverChecked
 
41
            Component.onCompleted: checked = serverChecked
 
42
            onTriggered: systemSettings.rotationLock = checked
 
43
 
 
44
            GSettings {
 
45
                id: systemSettings
 
46
                schema.id: "com.ubuntu.touch.system"
 
47
            }
 
48
        }
 
49
        Icon {
 
50
            SlotsLayout.position: SlotsLayout.Leading;
 
51
            SlotsLayout.padding { top: 0; bottom: 0 }
 
52
            source: model.icon
 
53
            height: units.gu(5)
45
54
        }
46
55
    }
47
56
}