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/FileDialogs.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/FileDialogs.qml')
| -rw-r--r-- | examples/quick/dialogs/systemdialogs/FileDialogs.qml | 143 |
1 files changed, 70 insertions, 73 deletions
diff --git a/examples/quick/dialogs/systemdialogs/FileDialogs.qml b/examples/quick/dialogs/systemdialogs/FileDialogs.qml index 79a58b982..9f50abcd4 100644 --- a/examples/quick/dialogs/systemdialogs/FileDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/FileDialogs.qml @@ -41,6 +41,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.1 +import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 Item { @@ -72,83 +73,79 @@ Item { } //! [filedialog] - Column { - anchors.fill: parent - anchors.margins: 12 - spacing: 8 - Text { - color: palette.windowText - font.bold: true - text: "File dialog properties:" - } - CheckBox { - id: fileDialogModal - text: "Modal" - checked: true - Binding on checked { value: fileDialog.modality != Qt.NonModal } - } - CheckBox { - id: fileDialogSelectFolder - text: "Select Folder" - Binding on checked { value: fileDialog.selectFolder } - } - CheckBox { - id: fileDialogSelectExisting - text: "Select Existing Files" - checked: true - Binding on checked { value: fileDialog.selectExisting } - } - CheckBox { - id: fileDialogSelectMultiple - text: "Select Multiple Files" - Binding on checked { value: fileDialog.selectMultiple } - } - CheckBox { - id: fileDialogOpenFiles - text: "Open Files After Accepting" - } - CheckBox { - id: fileDialogSidebarVisible - text: "Show Sidebar" - checked: fileDialog.sidebarVisible - Binding on checked { value: fileDialog.sidebarVisible } - } - CheckBox { - id: fileDialogVisible - text: "Visible" - Binding on checked { value: fileDialog.visible } - } - Text { - color: palette.windowText - text: "<b>current view folder:</b> " + fileDialog.folder - } - Text { - color: palette.windowText - text: "<b>name filters:</b> {" + fileDialog.nameFilters + "}" - width: parent.width - wrapMode: Text.Wrap - } - Text { - color: palette.windowText - text: "<b>current filter:</b>" + fileDialog.selectedNameFilter - width: parent.width - wrapMode: Text.Wrap - } - Text { - color: palette.windowText - text: "<b>chosen files:</b> " + fileDialog.fileUrls - width: parent.width - wrapMode: Text.Wrap - } - Text { - color: palette.windowText - text: "<b>chosen single path:</b> " + fileDialog.fileUrl - width: parent.width - wrapMode: Text.Wrap + ScrollView { + id: scrollView + anchors { + left: parent.left + right: parent.right + top: parent.top + bottom: bottomBar.top + leftMargin: 12 + } + ColumnLayout { + spacing: 8 + Item { Layout.preferredHeight: 4 } // padding + Label { + font.bold: true + text: "File dialog properties:" + } + CheckBox { + id: fileDialogModal + text: "Modal" + checked: true + Binding on checked { value: fileDialog.modality != Qt.NonModal } + } + CheckBox { + id: fileDialogSelectFolder + text: "Select Folder" + Binding on checked { value: fileDialog.selectFolder } + } + CheckBox { + id: fileDialogSelectExisting + text: "Select Existing Files" + checked: true + Binding on checked { value: fileDialog.selectExisting } + } + CheckBox { + id: fileDialogSelectMultiple + text: "Select Multiple Files" + Binding on checked { value: fileDialog.selectMultiple } + } + CheckBox { + id: fileDialogOpenFiles + text: "Open Files After Accepting" + } + CheckBox { + id: fileDialogSidebarVisible + text: "Show Sidebar" + checked: fileDialog.sidebarVisible + Binding on checked { value: fileDialog.sidebarVisible } + } + CheckBox { + id: fileDialogVisible + text: "Visible" + Binding on checked { value: fileDialog.visible } + } + Label { + text: "<b>current view folder:</b> " + fileDialog.folder + } + Label { + text: "<b>name filters:</b> {" + fileDialog.nameFilters + "}" + } + Label { + text: "<b>current filter:</b>" + fileDialog.selectedNameFilter + } + Label { + text: "<b>chosen files:</b> " + fileDialog.fileUrls + } + Label { + text: "<b>chosen single path:</b> " + fileDialog.fileUrl + } } } Rectangle { + id: bottomBar anchors { left: parent.left right: parent.right |
