Comment 1 for bug 1345775

Revision history for this message
Tim Peeters (tpeeters) wrote :

Launchpad breaks when I try to add a qml file, so here is the source code to reproduce the problem:

import Ubuntu.Components 1.1
import QtQuick 2.2

MainView {
    width: units.gu(40)
    height: units.gu(40)

    useDeprecatedToolbar: false

    Page {
        id: searchPage

        title: "search page"
        Label {
            id: label
            anchors.centerIn: parent
            text: "normal mode" //searchPage.state == "search" ? "search mode" : "normal mode"
        }

        state: "default"
        states: [
            PageHeadState {
                name: "default"
                head: searchPage.head
                actions: Action {
                    id: searchAction
                    iconName: "search"
                    onTriggered: searchPage.state = "search"
                }
            },
            PageHeadState {
                id: headerState
                name: "search"
                head: searchPage.head
                actions: [
                    Action {
                        iconName: "contact"
                    }
                ]
                backAction: Action {
                    id: leaveSearchAction
                    text: "back"
                    iconName: "back"
                    onTriggered: searchPage.state = "default"
                }
                contents: TextField {
                    placeholderText: "search..."
                }
                PropertyChanges {
                    target: label
                    text: "search mode"
                }
            }
        ]
    }
}