mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-06 11:00:48 +00:00
Add a close button for dialogs.
This commit is contained in:
33
gpt4all-chat/qml/MyDialog.qml
Normal file
33
gpt4all-chat/qml/MyDialog.qml
Normal file
@@ -0,0 +1,33 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Layouts
|
||||
|
||||
Dialog {
|
||||
id: myDialog
|
||||
background: Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: theme.backgroundDarkest
|
||||
border.width: 1
|
||||
border.color: theme.dialogBorder
|
||||
radius: 10
|
||||
}
|
||||
|
||||
MyToolButton {
|
||||
x: 0 + myDialog.width - myDialog.padding - width - 15
|
||||
y: 0 - myDialog.padding + 15
|
||||
z: 300
|
||||
visible: myDialog.closePolicy != Popup.NoAutoClose
|
||||
width: 30
|
||||
height: 30
|
||||
padding: 0
|
||||
source: "qrc:/gpt4all/icons/close.svg"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
onClicked: {
|
||||
myDialog.close();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user