2023-01-16 09:34:00 +00:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2024-02-22 14:51:16 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2023-01-16 09:34:00 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls.Material
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
import ".."
|
|
|
|
|
|
|
|
Page {
|
2023-05-02 07:00:42 +00:00
|
|
|
id: root
|
2023-01-16 09:34:00 +00:00
|
|
|
topPadding: Constants.pageTopPadding
|
|
|
|
|
|
|
|
// Component.onCompleted: Material.background = "red"
|
|
|
|
|
|
|
|
component TextAreaFlow: Flow {
|
|
|
|
id: layout
|
|
|
|
spacing: 40
|
|
|
|
|
|
|
|
required property int containerStyle
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text\nmore text"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text\nmore text"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
placeholderText: "Disabled placeholder"
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "Disabled text"
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "Disabled text\nMore text"
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "text\nmore text"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
2023-04-11 05:44:33 +00:00
|
|
|
|
2024-03-06 08:00:24 +00:00
|
|
|
TextArea {
|
|
|
|
text: "0 leftPadding"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
leftPadding: 0
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "0 rightPadding"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
rightPadding: 0
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "0 topPadding"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
topPadding: 0
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
text: "0 bottomPadding"
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
bottomPadding: 0
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
2025-02-26 12:01:27 +00:00
|
|
|
TextArea {
|
|
|
|
placeholderText: "leftPadding 0"
|
|
|
|
leftPadding: 0
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
placeholderText: "No leftPadding"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
placeholderText: "leftPadding 50"
|
|
|
|
leftPadding: 50
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
|
2023-04-11 05:44:33 +00:00
|
|
|
Flickable {
|
|
|
|
width: 200
|
|
|
|
height: 100
|
|
|
|
|
|
|
|
TextArea.flickable: TextArea {
|
|
|
|
placeholderText: "placeholderText"
|
|
|
|
text: "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn"
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
|
|
|
}
|
|
|
|
}
|
2023-01-16 09:34:00 +00:00
|
|
|
|
2023-05-02 07:00:42 +00:00
|
|
|
TextArea {
|
|
|
|
text: "AlignLeft"
|
|
|
|
placeholderText: "AlignLeft"
|
|
|
|
horizontalAlignment: TextArea.AlignLeft
|
|
|
|
// Make it a big bigger so it's easier to see the effects of alignment.
|
|
|
|
width: implicitWidth + 30
|
2023-01-16 09:34:00 +00:00
|
|
|
|
2023-05-02 07:00:42 +00:00
|
|
|
Material.containerStyle: layout.containerStyle
|
2023-01-16 09:34:00 +00:00
|
|
|
}
|
|
|
|
|
2023-05-02 07:00:42 +00:00
|
|
|
TextArea {
|
|
|
|
text: "AlignHCenter"
|
|
|
|
placeholderText: "AlignMiddle"
|
|
|
|
horizontalAlignment: TextArea.AlignMiddle
|
|
|
|
width: implicitWidth + 30
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
2023-01-16 09:34:00 +00:00
|
|
|
}
|
|
|
|
|
2023-05-02 07:00:42 +00:00
|
|
|
TextArea {
|
|
|
|
text: "AlignRight"
|
|
|
|
placeholderText: "AlignRight"
|
|
|
|
horizontalAlignment: TextArea.AlignRight
|
|
|
|
width: implicitWidth + 30
|
|
|
|
|
|
|
|
Material.containerStyle: layout.containerStyle
|
2023-01-16 09:34:00 +00:00
|
|
|
}
|
2023-05-02 07:00:42 +00:00
|
|
|
}
|
2023-01-16 09:34:00 +00:00
|
|
|
|
2023-05-02 07:00:42 +00:00
|
|
|
ScrollView {
|
|
|
|
id: scrollView
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
width: scrollView.availableWidth
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Filled"
|
|
|
|
}
|
|
|
|
TextAreaFlow {
|
|
|
|
containerStyle: Material.Filled
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.bottomMargin: 40
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Outlined"
|
|
|
|
}
|
|
|
|
TextAreaFlow {
|
|
|
|
containerStyle: Material.Outlined
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2023-01-16 09:34:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|