Redimensionnement

main
Alexis Drai 2 years ago
parent 91476298ef
commit 7bc7309658

@ -7,11 +7,9 @@ Page {
// The effective value will be restricted by ApplicationWindow.allowedOrientations // The effective value will be restricted by ApplicationWindow.allowedOrientations
allowedOrientations: Orientation.All allowedOrientations: Orientation.All
// To enable PullDownMenu, place our content in a SilicaFlickable
SilicaFlickable { SilicaFlickable {
anchors.fill: parent anchors.fill: parent
// PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
PullDownMenu { PullDownMenu {
MenuItem { MenuItem {
text: qsTr("Show Page 2") text: qsTr("Show Page 2")
@ -19,40 +17,39 @@ Page {
} }
} }
// Tell SilicaFlickable the height of its content.
contentHeight: column.height contentHeight: column.height
// Place our content in a Column. The PageHeader is always placed at the top
// of the page, followed by our content.
Column {
id: column
width: page.width
spacing: Theme.paddingLarge
Rectangle { Rectangle {
id: baseRect id: baseRect
color: "red" color: "red"
width: page.width anchors.fill: parent
height: page.height/2
} }
PageHeader { PageHeader {
title: qsTr("UI Template") title: qsTr("UI Template")
} }
Label { Label {
x: Theme.horizontalPageMargin id: firstLabel
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
}
text: qsTr("Argh") text: qsTr("Argh")
color: Theme.secondaryHighlightColor color: Theme.secondaryHighlightColor
font.pixelSize: Theme.fontSizeExtraLarge font.pixelSize: Theme.fontSizeExtraLarge
} }
TextField { TextField {
id: secondField id: secondField
width: parent.width width: parent.width
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
placeholderText: "Enter text" placeholderText: "Enter text"
font.pixelSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeLarge
font.bold: true font.bold: true
} }
} }
}
} }

Loading…
Cancel
Save