~ubuntu-branches/ubuntu/vivid/qtcreator-plugin-ubuntu/vivid

« back to all changes in this revision

Viewing changes to share/qtcreator/ubuntu/qml/Components/SectionItem.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Benjamin Zeller
  • Date: 2015-01-30 06:05:59 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20150130060559-1kirdtmm6bl6eb26
Tags: 3.1.1+15.04.20150130-0ubuntu1
[ Benjamin Zeller ]
Refactoring of the publish Tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 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 1.0
 
19
import Ubuntu.Components.ListItems 1.0 as ListItem
 
20
 
 
21
ListItem.Expandable {
 
22
    id: expandingColumnItem
 
23
    expandedHeight: contentColumn.height + units.gu(1)
 
24
    collapsedHeight:  headerRow.height
 
25
    divider.visible: false
 
26
 
 
27
    property string title
 
28
    property string imageSource
 
29
    default property alias data: contentColumn.data
 
30
 
 
31
    onClicked: {
 
32
        expanded = !expanded;
 
33
    }
 
34
 
 
35
    Column {
 
36
        id: contentColumn
 
37
        anchors { top: parent.top; left: parent.left; right: parent.right }
 
38
        Row{
 
39
            id: headerRow
 
40
            anchors { left: parent.left; right: parent.right}
 
41
            height: Math.max(24,label.paintedHeight)
 
42
            Image {
 
43
                source:  expandingColumnItem.expanded ? "qrc:/ubuntu/images/view-collapse.svg" : "qrc:/ubuntu/images/view-expand.svg"
 
44
                width: 24
 
45
                height: 24
 
46
            }
 
47
            Item{
 
48
                width: units.gu(1)
 
49
                height: 1
 
50
            }
 
51
            Image {
 
52
                source: imageSource
 
53
                width: 16
 
54
                height: 16
 
55
                visible: imageSource.length > 0
 
56
                anchors.verticalCenter: parent.verticalCenter
 
57
            }
 
58
            Item{
 
59
                visible: imageSource.length > 0
 
60
                width: units.gu(1)
 
61
                height: 1
 
62
            }
 
63
            Label {
 
64
                id: label
 
65
                text: expandingColumnItem.title
 
66
                fontSize: "large"
 
67
            }
 
68
        }
 
69
    }
 
70
}