Move the popup dialog into own file and disable network for now.

This commit is contained in:
Adam Treat 2023-04-23 07:05:43 -04:00
parent 889d7d8563
commit c366fc8054
3 changed files with 45 additions and 25 deletions

View File

@ -73,6 +73,7 @@ qt_add_qml_module(chat
qml/ModelDownloaderDialog.qml
qml/ThumbsDownDialog.qml
qml/SettingsDialog.qml
qml/PopupDialog.qml
RESOURCES
icons/send_message.svg
icons/stop_generating.svg

View File

@ -192,10 +192,11 @@ Window {
}
onClicked: {
if (Network.isActive)
Network.isActive = false
else
networkDialog.open();
featureComingSoon.open()
// if (Network.isActive)
// Network.isActive = false
// else
// networkDialog.open()
}
}
@ -229,30 +230,16 @@ Window {
}
}
Dialog {
PopupDialog {
id: copyMessage
anchors.centerIn: parent
modal: false
opacity: 0.9
Text {
horizontalAlignment: Text.AlignJustify
text: qsTr("Conversation copied to clipboard.")
color: "#d1d5db"
Accessible.role: Accessible.HelpBalloon
Accessible.name: text
Accessible.description: qsTr("Reveals a shortlived help balloon")
}
background: Rectangle {
anchors.fill: parent
color: "#202123"
border.width: 1
border.color: "white"
radius: 10
}
text: qsTr("Conversation copied to clipboard.")
}
exit: Transition {
NumberAnimation { duration: 500; property: "opacity"; from: 1.0; to: 0.0 }
}
PopupDialog {
id: featureComingSoon
anchors.centerIn: parent
text: qsTr("Feature coming soon!")
}
Button {

32
qml/PopupDialog.qml Normal file
View File

@ -0,0 +1,32 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Dialog {
id: copyMessage
anchors.centerIn: parent
modal: false
opacity: 0.9
padding: 20
property alias text: textField.text
Text {
id: textField
horizontalAlignment: Text.AlignJustify
color: "#d1d5db"
Accessible.role: Accessible.HelpBalloon
Accessible.name: text
Accessible.description: qsTr("Reveals a shortlived help balloon")
}
background: Rectangle {
anchors.fill: parent
color: "#202123"
border.width: 1
border.color: "white"
radius: 10
}
exit: Transition {
NumberAnimation { duration: 500; property: "opacity"; from: 1.0; to: 0.0 }
}
}