mirror of https://github.com/nomic-ai/gpt4all
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.8 KiB
QML
71 lines
1.8 KiB
QML
1 year ago
|
import QtCore
|
||
|
import QtQuick
|
||
|
import QtQuick.Controls
|
||
1 year ago
|
import QtQuick.Controls.Basic
|
||
1 year ago
|
import QtQuick.Layouts
|
||
|
|
||
|
Dialog {
|
||
1 year ago
|
id: popupDialog
|
||
1 year ago
|
anchors.centerIn: parent
|
||
|
opacity: 0.9
|
||
|
padding: 20
|
||
|
property alias text: textField.text
|
||
1 year ago
|
property bool shouldTimeOut: true
|
||
|
property bool shouldShowBusy: false
|
||
|
modal: shouldShowBusy
|
||
|
closePolicy: shouldShowBusy ? Popup.NoAutoClose : (Popup.CloseOnEscape | Popup.CloseOnPressOutside)
|
||
1 year ago
|
|
||
|
Theme {
|
||
|
id: theme
|
||
|
}
|
||
|
|
||
1 year ago
|
Row {
|
||
|
anchors.centerIn: parent
|
||
|
width: childrenRect.width
|
||
|
height: childrenRect.height
|
||
|
spacing: 20
|
||
|
|
||
|
Text {
|
||
|
id: textField
|
||
|
anchors.verticalCenter: busyIndicator.verticalCenter
|
||
|
horizontalAlignment: Text.AlignJustify
|
||
|
color: theme.textColor
|
||
|
Accessible.role: Accessible.HelpBalloon
|
||
|
Accessible.name: text
|
||
|
Accessible.description: qsTr("Reveals a shortlived help balloon")
|
||
|
}
|
||
|
|
||
|
BusyIndicator {
|
||
|
id: busyIndicator
|
||
|
visible: shouldShowBusy
|
||
|
running: shouldShowBusy
|
||
|
|
||
|
Accessible.role: Accessible.Animation
|
||
|
Accessible.name: qsTr("Busy indicator")
|
||
|
Accessible.description: qsTr("Displayed when the popup is showing busy")
|
||
|
}
|
||
1 year ago
|
}
|
||
1 year ago
|
|
||
1 year ago
|
background: Rectangle {
|
||
|
anchors.fill: parent
|
||
1 year ago
|
color: theme.backgroundDarkest
|
||
1 year ago
|
border.width: 1
|
||
1 year ago
|
border.color: theme.dialogBorder
|
||
1 year ago
|
radius: 10
|
||
|
}
|
||
|
|
||
|
exit: Transition {
|
||
|
NumberAnimation { duration: 500; property: "opacity"; from: 1.0; to: 0.0 }
|
||
|
}
|
||
1 year ago
|
|
||
|
onOpened: {
|
||
1 year ago
|
if (shouldTimeOut)
|
||
|
timer.start()
|
||
1 year ago
|
}
|
||
|
|
||
|
Timer {
|
||
|
id: timer
|
||
|
interval: 500; running: false; repeat: false
|
||
|
onTriggered: popupDialog.close()
|
||
|
}
|
||
1 year ago
|
}
|