Using a Qml Loader in combination with Pagestack and Tabs results in incorrect positioning
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
High
|
Tim Peeters | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have been investigating on using a QML Loader for the clock app to reduce its start-up time and improve memory usage. The clock app uses a structure similar to the SDK Doc examples as shown below. This structure basically combines PageStack and Tabs component together.
MainView {
id: mainView
width: units.gu(38)
height: units.gu(50)
PageStack {
id: pageStack
Tabs {
id: tabs
Tab {
}
}
Tab {
}
}
}
Page {
id: page3
title: "Page on stack"
Label {
}
}
}
}
However instead of loading say "Tab 2" on startup, I chose to load it only when the user navigates to the tab. I achieved this by using a QML Loader as follows,
Tab {
id: tab2
title: i18n.tr("External")
page: Loader {
}
}
However when you switch to "tab2", you will notice that the elements of the page do not anchors to the bottom of the tabbar. Instead they overlap with the tabbar. It is as if the tabbar did not exist.
I have attached a sample project which can be used to reproduce this issue. All the code that has been mentioned above in the description have been taken from the SDK docs only.
Related branches
- Tim Peeters: Disapprove
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 31 lines (+6/-5)1 file modifiedmodules/Ubuntu/Components/MainView.qml (+6/-5)
- Zsombor Egri: Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 100 lines (+38/-2)3 files modifiedmodules/Ubuntu/Components/Page.qml (+2/-1)
modules/Ubuntu/Components/Tabs.qml (+7/-1)
tests/unit_x11/tst_components/tst_tabs.qml (+29/-0)
Changed in ubuntu-ui-toolkit: | |
importance: | Undecided → High |
assignee: | nobody → Tim Peeters (tpeeters) |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
Thanks for the great sample project, very helpful.
I'm looking into it.