~themuso/ubuntu-ui-toolkit/add-accessibility-metadata

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/PageHeadSections.qml

  • Committer: Luke Yelavich
  • Date: 2014-07-28 07:04:49 UTC
  • mfrom: (992.51.43 ubuntu-ui-toolkit)
  • Revision ID: luke.yelavich@canonical.com-20140728070449-30bfzhu758caz058
Merge with trunk.

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.2
 
18
 
 
19
/*!
 
20
    \qmltype PageHeadSections
 
21
    \inqmlmodule Ubuntu.Components 1.1
 
22
    \ingroup ubuntu
 
23
    \since Ubuntu.Components 1.1
 
24
    \brief PageHeadSections is used to configure the sections for a \l Page.
 
25
 
 
26
    These sections will be shown in the bottom part of the header. This component does not
 
27
    need to be instantiated by the developer, it is automatically part of \l PageHeadConfiguration.
 
28
 */
 
29
QtObject {
 
30
    // To be used inside PageHeadConfiguration
 
31
    id: sections
 
32
 
 
33
    /*!
 
34
      Set this property to false to disable user interaction to change the selected section.
 
35
      Default value: true
 
36
     */
 
37
    property bool enabled: true
 
38
 
 
39
    /*!
 
40
      List of strings that represent section names. Example:
 
41
      \qml
 
42
        import Ubuntu.Components 1.1
 
43
        import QtQuick 2.2
 
44
 
 
45
        MainView {
 
46
            width: units.gu(50)
 
47
            height: units.gu(80)
 
48
 
 
49
            useDeprecatedToolbar: false
 
50
 
 
51
            Page {
 
52
                id: page
 
53
                title: "Sections"
 
54
                head {
 
55
                    sections {
 
56
                        model: ["one", "two", "three"]
 
57
                    }
 
58
                }
 
59
 
 
60
                Label {
 
61
                    anchors.centerIn: parent
 
62
                    text: "Section " + page.head.sections.selectedIndex
 
63
                }
 
64
            }
 
65
        }
 
66
     \endqml
 
67
     */
 
68
    property var model
 
69
 
 
70
    /*!
 
71
      The index of the currently selected section in \l model.
 
72
     */
 
73
    property int selectedIndex: model ? 0 : -1
 
74
}