Port MessageSourceDialog to OverlaySheet
This commit is contained in:
@@ -34,7 +34,7 @@ Control {
|
||||
onTriggered: {
|
||||
let contextMenu = fileDelegateContextMenu.createObject(root)
|
||||
contextMenu.viewSource.connect(function() {
|
||||
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
messagerSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
})
|
||||
contextMenu.downloadAndOpen.connect(downloadAndOpen)
|
||||
contextMenu.saveFileAs.connect(saveFileAs)
|
||||
@@ -90,9 +90,9 @@ Control {
|
||||
onSecondaryClicked: saveFileAction.trigger()
|
||||
|
||||
Component {
|
||||
id: messageSourceDialog
|
||||
id: messagerSourceSheet
|
||||
|
||||
MessageSourceDialog {}
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
@@ -63,7 +63,7 @@ RowLayout {
|
||||
onClicked: {
|
||||
var contextMenu = fileDelegateContextMenu.createObject(root)
|
||||
contextMenu.viewSource.connect(function() {
|
||||
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
})
|
||||
contextMenu.downloadAndOpen.connect(downloadAndOpen)
|
||||
contextMenu.saveFileAs.connect(saveFileAs)
|
||||
@@ -79,9 +79,9 @@ RowLayout {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceDialog
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceDialog {}
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
@@ -104,7 +104,7 @@ Image {
|
||||
onSecondaryClicked: {
|
||||
var contextMenu = imageDelegateContextMenu.createObject(root)
|
||||
contextMenu.viewSource.connect(function() {
|
||||
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
})
|
||||
contextMenu.downloadAndOpen.connect(downloadAndOpen)
|
||||
contextMenu.saveFileAs.connect(saveFileAs)
|
||||
@@ -120,9 +120,9 @@ Image {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceDialog
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceDialog {}
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
@@ -191,7 +191,7 @@ RowLayout {
|
||||
onSecondaryClicked: {
|
||||
var contextMenu = imageDelegateContextMenu.createObject(root)
|
||||
contextMenu.viewSource.connect(function() {
|
||||
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
|
||||
})
|
||||
contextMenu.downloadAndOpen.connect(downloadAndOpen)
|
||||
contextMenu.saveFileAs.connect(saveFileAs)
|
||||
@@ -207,9 +207,9 @@ RowLayout {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceDialog
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceDialog {}
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
Popup {
|
||||
property string sourceText
|
||||
|
||||
anchors.centerIn: parent
|
||||
width: 480
|
||||
|
||||
id: root
|
||||
|
||||
modal: true
|
||||
padding: 16
|
||||
|
||||
closePolicy: Dialog.CloseOnEscape | Dialog.CloseOnPressOutside
|
||||
|
||||
contentItem: ScrollView {
|
||||
clip: true
|
||||
|
||||
Label {
|
||||
text: sourceText
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: destroy()
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module NeoChat.Dialog
|
||||
RoomSettingsDialog 1.0 RoomSettingsDialog.qml
|
||||
UserDetailDialog 1.0 UserDetailDialog.qml
|
||||
MessageSourceDialog 1.0 MessageSourceDialog.qml
|
||||
LoginDialog 1.0 LoginDialog.qml
|
||||
CreateRoomDialog 1.0 CreateRoomDialog.qml
|
||||
InviteUserDialog 1.0 InviteUserDialog.qml
|
||||
|
||||
25
imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml
Normal file
25
imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
|
||||
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
|
||||
Kirigami.OverlaySheet {
|
||||
|
||||
property string sourceText
|
||||
|
||||
header: Kirigami.Heading {
|
||||
text: i18n("Message Source")
|
||||
}
|
||||
|
||||
Label {
|
||||
text: sourceText
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
module NeoChat.Menu.Timeline
|
||||
MessageDelegateContextMenu 1.0 MessageDelegateContextMenu.qml
|
||||
FileDelegateContextMenu 1.0 FileDelegateContextMenu.qml
|
||||
MessageSourceSheet 1.0 MessageSourceSheet.qml
|
||||
|
||||
@@ -397,7 +397,7 @@ Kirigami.ScrollablePage {
|
||||
'eventId': eventId,
|
||||
});
|
||||
contextMenu.viewSource.connect(function() {
|
||||
messageSourceDialog.createObject(page, {
|
||||
messageSourceSheet.createObject(page, {
|
||||
'sourceText': toolTip,
|
||||
}).open();
|
||||
contextMenu.close();
|
||||
@@ -424,8 +424,8 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceDialog
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceDialog {}
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
}
|
||||
|
||||
2
res.qrc
2
res.qrc
@@ -45,7 +45,7 @@
|
||||
<file>imports/NeoChat/Dialog/qmldir</file>
|
||||
<file>imports/NeoChat/Dialog/RoomSettingsDialog.qml</file>
|
||||
<file>imports/NeoChat/Dialog/UserDetailDialog.qml</file>
|
||||
<file>imports/NeoChat/Dialog/MessageSourceDialog.qml</file>
|
||||
<file>imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml</file>
|
||||
<file>imports/NeoChat/Dialog/CreateRoomDialog.qml</file>
|
||||
<file>imports/NeoChat/Dialog/AcceptInvitationDialog.qml</file>
|
||||
<file>imports/NeoChat/Dialog/StartChatDialog.qml</file>
|
||||
|
||||
Reference in New Issue
Block a user