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

« back to all changes in this revision

Viewing changes to Ubuntu/Settings/Menus/StandardMenu.qml

  • Committer: CI bot
  • Author(s): Michał Sawicz, Nick Dedekind
  • Date: 2014-07-01 14:06:14 UTC
  • mfrom: (68.1.11 suru-icons)
  • Revision ID: ps-jenkins@lists.canonical.com-20140701140614-axftfu3pap0oj1y9
Adapt to suru theme Fixes: 1304560

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2014 Canonical Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.0
 
18
import Ubuntu.Components 0.1 as Components
 
19
import Ubuntu.Settings.Components 0.1 as USC
 
20
import Ubuntu.Components.ListItems 0.1 as ListItems
 
21
import QtQuick.Layouts 1.1
 
22
 
 
23
ListItems.Empty {
 
24
    id: menu
 
25
 
 
26
    property alias iconSource: iconVisual.source
 
27
    property alias text: label.text
 
28
    property alias iconColor: iconVisual.color
 
29
    property alias component: componentLoader.sourceComponent
 
30
 
 
31
    RowLayout {
 
32
 
 
33
        anchors {
 
34
            fill: parent
 
35
            leftMargin: menu.__contentsMargins
 
36
            rightMargin: menu.__contentsMargins
 
37
        }
 
38
        spacing: menu.__contentsMargins
 
39
 
 
40
        USC.IconVisual {
 
41
            id: iconVisual
 
42
            visible: status == Image.Ready
 
43
            color: Theme.palette.selected.backgroundText
 
44
 
 
45
            readonly property real size: Math.min(units.gu(3), parent.height - menu.__contentsMargins)
 
46
 
 
47
            height: size
 
48
            width: size
 
49
            Layout.alignment: Qt.AlignVCenter
 
50
        }
 
51
 
 
52
        Components.Label {
 
53
            id: label
 
54
            Layout.fillWidth: true
 
55
            Layout.alignment: Qt.AlignVCenter
 
56
 
 
57
            elide: Text.ElideRight
 
58
            maximumLineCount: 1
 
59
            opacity: label.enabled ? 1.0 : 0.5
 
60
        }
 
61
 
 
62
        Loader {
 
63
            id: componentLoader
 
64
        }
 
65
    }
 
66
}