Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using the Ubuntu SDK, how can I get an anchor to the top of the toolbar?

I want something like this:

MyItem {
    anchors.bottom: toolbar.top
}

so that I can anchor an item to an omnipresent toolbar in a way that is suitable for a pointer-driven interface.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

When the toolbar is locked and opened, the contents of the MainView are automatically anchored to the top of the toolbar. However, there is a bug in the SDK which causes a 2gu margin above the toolbar. I fix it by adding the following to MainView:

states: [
    State {
        when: showToolbar

        PropertyChanges {
            target: taskViewPage.parent
            anchors.bottomMargin: -root.toolbar.triggerSize
        }
    }
]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.