~zsombi/ubuntu-ui-toolkit/textarea-in-listitem-empty

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): tpeeters
  • Date: 2013-04-05 11:52:07 UTC
  • mfrom: (405.2.19 doc-mainview)
  • Revision ID: tarmac-20130405115207-ee0yl5uf273nose7
Improve documentation for header and toolbar:
* Simplify Toolbars demo in component showcase using Tabs.
* Simplify Tabs demo in component showcase to match the new documentation
* Update MainView documentation
* Update Page documentation
* Update PageStack documentation
* Mark Tab.iconSource as deprecated in documentation (new tabs don't have icons)
* Update Tabs documentation
* Document ToolbarActions. Fixes: https://bugs.launchpad.net/bugs/1122856, https://bugs.launchpad.net/bugs/1124266, https://bugs.launchpad.net/bugs/1161399.

Approved by PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    \qmltype Page
20
20
    \inqmlmodule Ubuntu.Components 0.1
21
21
    \ingroup ubuntu
22
 
    \brief A page inside a \l MainView will have a header and toolbar.
23
 
        Pages can also can be included in \l Tab object or pushed on a \l PageStack.
 
22
    \brief A page is the basic Item that must be used inside the \l MainView,
 
23
        \l PageStack and \l Tabs.
24
24
        Anchors and height of a Page are automatically determined to align with
25
25
        the header of the \l MainView, but can be overridden.
26
26
 
27
 
    Example:
 
27
    \l MainView provides a header and toolbar for Pages it includes. Each page automatically
 
28
    has its header and toolbar property linked to that of its parent \l MainView.
 
29
    The text of the header, and the buttons in the toolbar are determined by the \l title
 
30
    and \l tools properties of the page:
 
31
 
28
32
    \qml
 
33
        import QtQuick 2.0
 
34
        import Ubuntu.Components 0.1
 
35
 
29
36
        MainView {
 
37
            width: units.gu(48)
 
38
            height: units.gu(60)
 
39
 
30
40
            Page {
31
 
                title: i18n.tr("Root page")
 
41
                title: "Example page"
 
42
 
 
43
                Label {
 
44
                    anchors.centerIn: parent
 
45
                    text: "Hello world!"
 
46
                }
32
47
 
33
48
                tools: ToolbarActions {
34
49
                    Action {
35
50
                        text: "one"
36
 
                        iconSource: Qt.resolvedUrl("1.png")
37
 
                        onTriggered: print("First action")
38
 
                     }
39
 
                     Action {
 
51
                    }
 
52
                    Action {
40
53
                        text: "two"
41
 
                        iconSource: Qt.resolvedUrl("2.png")
42
 
                        onTriggered: print("Second action")
43
 
                     }
44
 
                }
45
 
 
46
 
                Rectangle {
47
 
                    anchors.fill: parent
48
 
                    color: "red"
 
54
                    }
49
55
                }
50
56
            }
51
57
        }
52
58
    \endqml
53
 
 
54
 
    See also \l Tabs and \l PageStack.
 
59
    See \l MainView for more basic examples that show how to use a header and toolbar.
 
60
    Advanced navigation structures can be created by adding Pages to a \l PageStack or \l Tabs.
55
61
*/
56
62
PageTreeNode {
57
63
    id: page