2023-09-13 09:12:47 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2023-10-18 09:03:32 +00:00
|
|
|
|
2023-10-25 15:20:02 +00:00
|
|
|
import Models 1.0
|
|
|
|
|
2023-09-13 09:12:47 +00:00
|
|
|
import shared.views.chat 1.0
|
2023-10-18 09:03:32 +00:00
|
|
|
import shared.stores 1.0
|
2023-09-13 09:12:47 +00:00
|
|
|
|
|
|
|
SplitView {
|
2023-10-13 13:36:07 +00:00
|
|
|
|
2023-10-25 15:20:02 +00:00
|
|
|
LinkPreviewModel {
|
2023-10-13 13:36:07 +00:00
|
|
|
id: mockedLinkPreviewModel
|
|
|
|
}
|
|
|
|
|
2023-09-13 09:12:47 +00:00
|
|
|
Pane {
|
|
|
|
id: messageViewWrapper
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
LinksMessageView {
|
|
|
|
id: linksMessageView
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
2023-10-25 15:20:02 +00:00
|
|
|
isOnline: true
|
|
|
|
playAnimations: true
|
2023-10-13 13:36:07 +00:00
|
|
|
linkPreviewModel: mockedLinkPreviewModel
|
2023-10-18 09:03:32 +00:00
|
|
|
gifLinks: [ "https://media.tenor.com/qN_ytiwLh24AAAAC/cold.gif" ]
|
2023-09-13 09:12:47 +00:00
|
|
|
|
2023-10-25 15:20:02 +00:00
|
|
|
gifUnfurlingEnabled: false
|
|
|
|
canAskToUnfurlGifs: true
|
2023-09-13 09:12:47 +00:00
|
|
|
onImageClicked: {
|
|
|
|
console.log("image clicked")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: 25
|
|
|
|
ColumnLayout {
|
2023-10-18 09:03:32 +00:00
|
|
|
Label {
|
|
|
|
text: qsTr("GIF unfuring settings")
|
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
text: qsTr("Enabled")
|
2023-10-25 15:20:02 +00:00
|
|
|
checked: linksMessageView.gifUnfurlingEnabled
|
|
|
|
onToggled: linksMessageView.gifUnfurlingEnabled = !linksMessageView.gifUnfurlingEnabled
|
2023-10-18 09:03:32 +00:00
|
|
|
}
|
|
|
|
CheckBox {
|
2023-10-25 15:20:02 +00:00
|
|
|
text: qsTr("Can ask about GIF unfurling")
|
|
|
|
checked: linksMessageView.canAskToUnfurlGifs
|
|
|
|
onClicked: linksMessageView.canAskToUnfurlGifs = !linksMessageView.canAskToUnfurlGifs
|
2023-10-18 09:03:32 +00:00
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: qsTr("Reset local `askAboutUnfurling` setting")
|
|
|
|
onClicked: linksMessageView.resetLocalAskAboutUnfurling()
|
|
|
|
}
|
2023-10-25 15:20:02 +00:00
|
|
|
CheckBox {
|
|
|
|
text: qsTr("Play animations")
|
|
|
|
checked: linksMessageView.playAnimations
|
|
|
|
onToggled: linksMessageView.playAnimations = !linksMessageView.playAnimations
|
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
text: qsTr("Is online")
|
|
|
|
checked: linksMessageView.isOnline
|
|
|
|
onToggled: linksMessageView.isOnline = !linksMessageView.isOnline
|
|
|
|
}
|
2023-09-13 09:12:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-10-13 13:36:07 +00:00
|
|
|
}
|