~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2202

« back to all changes in this revision

Viewing changes to plugins/Ubuntu/Settings/Menus/UserSessionMenu.qml

  • Committer: Bileto Bot
  • Date: 2016-10-24 11:32:00 UTC
  • mfrom: (146.3.110 slots-layout)
  • Revision ID: ci-train-bot@canonical.com-20161024113200-85dvkl9m1o0msi5i
* Menus: rewrite components using ListItemLayout's and SlotsLayout's
* Bump revision to 0.10, as per Components removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2013 Canonical Ltd.
 
2
 * Copyright 2013-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU Lesser General Public License as published by
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 *
16
16
 * Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
 
17
 *             Marco Trevisan <marco.trevisan@canonical.com>
17
18
 */
18
19
 
19
20
import QtQuick 2.4
20
21
import Ubuntu.Components 1.3
21
 
import Ubuntu.Components.ListItems 1.3 as ListItem
22
22
 
23
23
StandardMenu {
24
24
    id: userSessionMenu
25
25
 
26
26
    property alias name: userSessionMenu.text
27
 
    property bool active: false
 
27
    property alias active: activeIcon.visible
28
28
 
29
 
    component: Component {
 
29
    slots: [
30
30
        Rectangle {
31
31
            id: activeIcon
32
32
            objectName: "activeIcon"
33
 
            implicitWidth: checkMark.width + units.gu(1.5)
34
 
            implicitHeight: checkMark.height + units.gu(1.5)
 
33
            implicitWidth: checkMark.width + units.gu(1)
 
34
            implicitHeight: checkMark.height + units.gu(1)
35
35
            radius: width / 2
36
36
            antialiasing: true
37
37
            color: theme.palette.normal.backgroundText
38
 
            visible: userSessionMenu.active
 
38
            visible: false
39
39
 
40
 
            Image {
 
40
            Icon {
41
41
                id: checkMark
42
 
                source: "image://theme/tick"
 
42
                name: "tick"
43
43
                height: units.gu(2)
44
44
                width: height
45
45
                anchors.centerIn: parent
46
 
 
47
 
                sourceSize {
48
 
                    height: height
49
 
                    width: width
50
 
                }
51
46
            }
52
47
        }
53
 
    }
 
48
    ]
54
49
}