2023-07-06 14:53:43 +00:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
import QtQuick.Dialogs
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: myDialog
|
2023-07-09 18:56:54 +00:00
|
|
|
property alias closeButtonVisible: myCloseButton.visible
|
2023-07-06 14:53:43 +00:00
|
|
|
background: Rectangle {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2024-01-22 19:41:47 +00:00
|
|
|
color: theme.containerBackground
|
2023-07-06 14:53:43 +00:00
|
|
|
border.width: 1
|
|
|
|
border.color: theme.dialogBorder
|
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
|
2023-11-22 14:10:44 +00:00
|
|
|
Rectangle {
|
|
|
|
id: closeBackground
|
2024-02-12 17:23:56 +00:00
|
|
|
visible: myCloseButton.visible
|
2023-11-22 14:10:44 +00:00
|
|
|
z: 299
|
|
|
|
anchors.centerIn: myCloseButton
|
|
|
|
width: myCloseButton.width + 10
|
|
|
|
height: myCloseButton.height + 10
|
2024-01-22 19:41:47 +00:00
|
|
|
color: theme.containerBackground
|
2023-11-22 14:10:44 +00:00
|
|
|
}
|
|
|
|
|
2023-07-06 14:53:43 +00:00
|
|
|
MyToolButton {
|
2023-07-09 18:56:54 +00:00
|
|
|
id: myCloseButton
|
2023-07-06 14:53:43 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|