From 70af64f35bf107f38ca48f9cccf82ac6b3160eb4 Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Wed, 31 May 2023 11:24:29 +0200 Subject: [PATCH] Utilisation des layout_0 --- qml/pages/FirstPage.qml | 48 +++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index 17f3851..90db436 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -3,8 +3,6 @@ import Sailfish.Silica 1.0 Page { id: page - - // The effective value will be restricted by ApplicationWindow.allowedOrientations allowedOrientations: Orientation.All SilicaFlickable { @@ -21,7 +19,7 @@ Page { Rectangle { id: baseRect - color: "red" + color: "#facccc" anchors.fill: parent } @@ -29,27 +27,35 @@ Page { title: qsTr("UI Template") } - Label { - id: firstLabel - anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top + Column { + id: column + width: parent.width + spacing: 10 + + Label { + id: firstLabel + width: parent.width + text: qsTr("Argh") + color: Theme.secondaryHighlightColor + font.pixelSize: Theme.fontSizeExtraLarge + horizontalAlignment: Text.AlignHCenter } - text: qsTr("Argh") - color: Theme.secondaryHighlightColor - font.pixelSize: Theme.fontSizeExtraLarge - } - TextField { - id: secondField - width: parent.width - anchors { - horizontalCenter: parent.horizontalCenter - verticalCenter: parent.verticalCenter + TextField { + id: secondField + width: parent.width + placeholderText: "Enter text" + font.pixelSize: Theme.fontSizeLarge + font.bold: true + } + + TextField { + id: thirdField + width: parent.width + placeholderText: "Enter text again" + font.pixelSize: Theme.fontSizeLarge + font.bold: true } - placeholderText: "Enter text" - font.pixelSize: Theme.fontSizeLarge - font.bold: true } } }