mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-11 21:39:11 +00:00
Remove binary state from high-level API and use Jinja templates (#3147)
Signed-off-by: Jared Van Bortel <jared@nomic.ai> Signed-off-by: Adam Treat <treat.adam@gmail.com> Co-authored-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
59
gpt4all-chat/qml/ConfirmationDialog.qml
Normal file
59
gpt4all-chat/qml/ConfirmationDialog.qml
Normal file
@@ -0,0 +1,59 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
|
||||
MyDialog {
|
||||
id: confirmationDialog
|
||||
anchors.centerIn: parent
|
||||
modal: true
|
||||
padding: 20
|
||||
property alias dialogTitle: titleText.text
|
||||
property alias description: descriptionText.text
|
||||
|
||||
Theme { id: theme }
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
Text {
|
||||
id: titleText
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
textFormat: Text.StyledText
|
||||
color: theme.textColor
|
||||
font.pixelSize: theme.fontSizeLarger
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Text {
|
||||
id: descriptionText
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
textFormat: Text.StyledText
|
||||
color: theme.textColor
|
||||
font.pixelSize: theme.fontSizeMedium
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: dialogBox
|
||||
padding: 20
|
||||
alignment: Qt.AlignRight
|
||||
spacing: 10
|
||||
MySettingsButton {
|
||||
text: qsTr("OK")
|
||||
textColor: theme.mediumButtonText
|
||||
backgroundColor: theme.mediumButtonBackground
|
||||
backgroundColorHovered: theme.mediumButtonBackgroundHovered
|
||||
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
||||
}
|
||||
MySettingsButton {
|
||||
text: qsTr("Cancel")
|
||||
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
Keys.onEnterPressed: confirmationDialog.accept()
|
||||
Keys.onReturnPressed: confirmationDialog.accept()
|
||||
}
|
||||
Component.onCompleted: dialogBox.forceActiveFocus()
|
||||
}
|
Reference in New Issue
Block a user