diff options
| author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-10-16 17:28:09 +0200 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-10-23 11:13:08 +0200 |
| commit | 511a9b521f5c025bb513ac8eecaeff5d41bba7e8 (patch) | |
| tree | 09e74003ec5e11b1da5567031efd8c65f5518e96 /examples/quick/dialogs/systemdialogs/CustomDialogs.qml | |
| parent | 11ff483c564b8a2f5b3ef5e28230fbfc742a2cd2 (diff) | |
QtQuick.Dialogs examples: use controls and layouts; visual tweaks
Make tab and button labels shorter so that they fit even on very-small-
screen devices (like iOS).
Make the content of some tabs scrollable.
Background color of the Font tab matches the others.
Use RowLayout to make baseline alignment of checkboxes and associated
text fields possible.
Use ColumnLayout because it works better inside a ScrollView.
Use Label instead of Text so that the renderType is consistent.
Change-Id: Ie2d07153532f35d108a0b6ad0bb4f10326f79d24
Task-number: QTBUG-41999
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'examples/quick/dialogs/systemdialogs/CustomDialogs.qml')
| -rw-r--r-- | examples/quick/dialogs/systemdialogs/CustomDialogs.qml | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml index 43515536d..90d012e1e 100644 --- a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml @@ -67,7 +67,7 @@ Item { onApply: lastChosen.text = "Apply" onReset: lastChosen.text = "Reset" - Text { + Label { text: "Hello world!" } } @@ -91,9 +91,8 @@ Item { ColumnLayout { id: column width: parent ? parent.width : 100 - Text { + Label { text: "<b>What</b> is the average airspeed velocity of an unladen European swallow?" - textFormat: Text.StyledText Layout.columnSpan: 2 Layout.fillWidth: true wrapMode: Text.WordWrap @@ -104,7 +103,7 @@ Item { id: answer onEditingFinished: spinboxDialog.click(StandardButton.Ok) } - Text { + Label { text: "m/s" Layout.alignment: Qt.AlignBaseline | Qt.AlignLeft } @@ -144,7 +143,7 @@ Item { color: "lightskyblue" implicitWidth: 400 implicitHeight: 100 - Text { + Label { text: "Hello blue sky!" color: "navy" anchors.centerIn: parent @@ -156,12 +155,11 @@ Item { } } - Column { + ColumnLayout { anchors.fill: parent anchors.margins: 12 spacing: 8 - Text { - color: palette.windowText + Label { font.bold: true text: "Message dialog properties:" } @@ -170,22 +168,26 @@ Item { text: "Modal" Binding on checked { value: helloDialog.modality != Qt.NonModal } } - CheckBox { - id: customizeTitle - text: "Window Title" - checked: true - width: parent.width + RowLayout { + CheckBox { + id: customizeTitle + text: "Window Title" + Layout.alignment: Qt.AlignBaseline + checked: true + } TextField { id: windowTitleField - anchors.right: parent.right + Layout.alignment: Qt.AlignBaseline + Layout.fillWidth: true text: "Custom Dialog" - width: root.width - customizeTitle.implicitWidth - 30 } } - + Label { + text: "Buttons:" + } Flow { spacing: 8 - width: parent.width + Layout.fillWidth: true property bool updating: false function updateButtons(button, checked) { if (updating) return @@ -289,12 +291,14 @@ Item { Component.onCompleted: updateButtons() } - Text { + Label { id: lastChosen } + Item { Layout.fillHeight: true } } Rectangle { + id: bottomBar anchors { left: parent.left right: parent.right @@ -311,22 +315,22 @@ Item { anchors.leftMargin: 12 width: parent.width Button { - text: "Hello World dialog" + text: "Hello World" anchors.verticalCenter: parent.verticalCenter onClicked: helloDialog.open() } Button { - text: "Input dialog" + text: "Input" anchors.verticalCenter: parent.verticalCenter onClicked: spinboxDialog.open() } Button { - text: "Date picker" + text: "Date" anchors.verticalCenter: parent.verticalCenter onClicked: dateDialog.open() } Button { - text: "Buttonless marginless dialog" + text: "No buttons or margins" anchors.verticalCenter: parent.verticalCenter onClicked: filledDialog.open() } |
