FluentUI/Gallery/res/qml/page/T_DialogWindow.qml
yxdy a44db97aa3
Some checks failed
Gallery App Build / Windows (push) Has been cancelled
Gallery App Build / macOS (push) Has been cancelled
Gallery App Build / Ubuntu (push) Has been cancelled
init
2025-02-12 10:31:20 +08:00

64 lines
1.6 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI.Controls
import Gallery
ScrollablePage {
id: page
title: qsTr("DialogWindow")
CardHighlight{
Layout.fillWidth: true
codeSnippet:
`import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI.Controls
Item{
id: root
width: parent.width
height: layout_content.height
Column{
id: layout_content
anchors.right: parent.right
anchors.left: parent.left
spacing: 20
Button {
text: qsTr("Input")
onClicked: inputDialog.open()
width: 120
DialogWindow {
id: inputDialog
title: qsTr("Input")
standardButtons: Dialog.Ok | Dialog.Cancel
ColumnLayout {
spacing: 20
anchors.fill: parent
Label {
elide: Label.ElideRight
text: qsTr("Please enter the credentials:")
Layout.fillWidth: true
}
TextField {
focus: true
placeholderText: qsTr("Username")
Layout.fillWidth: true
}
TextField {
placeholderText: qsTr("Password")
echoMode: TextField.PasswordEchoOnEdit
Layout.fillWidth: true
}
}
}
}
}
}
`}
}