Improve source menu
This commit is contained in:
@@ -65,7 +65,12 @@ MessageDelegateContextMenu {
|
|||||||
text: i18n("View Source")
|
text: i18n("View Source")
|
||||||
icon.name: "code-context"
|
icon.name: "code-context"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
messageSourceSheet.createObject(root, {'sourceText': root.source}).open();
|
applicationWindow().pageStack.pushDialogLayer('qrc:/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml', {
|
||||||
|
sourceText: root.source
|
||||||
|
}, {
|
||||||
|
title: i18n("Message Source"),
|
||||||
|
width: Kirigami.Units.gridUnit * 25
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -49,7 +49,12 @@ Loader {
|
|||||||
text: i18n("View Source")
|
text: i18n("View Source")
|
||||||
icon.name: "code-context"
|
icon.name: "code-context"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
messageSourceSheet.createObject(page, {'sourceText': loadRoot.source}).open();
|
applicationWindow().pageStack.pushDialogLayer('qrc:/imports/NeoChat/Menu/Timeline/MessageSourceSheet.qml', {
|
||||||
|
sourceText: loadRoot.source
|
||||||
|
}, {
|
||||||
|
title: i18n("Message Source"),
|
||||||
|
width: Kirigami.Units.gridUnit * 25
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,23 +7,38 @@ import QtQuick.Controls 2.15
|
|||||||
|
|
||||||
import org.kde.syntaxhighlighting 1.0
|
import org.kde.syntaxhighlighting 1.0
|
||||||
import org.kde.kirigami 2.15 as Kirigami
|
import org.kde.kirigami 2.15 as Kirigami
|
||||||
|
import org.kde.neochat 1.0
|
||||||
|
|
||||||
Kirigami.OverlaySheet {
|
Kirigami.Page {
|
||||||
|
|
||||||
property string sourceText
|
property string sourceText
|
||||||
|
|
||||||
|
topPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
|
||||||
title: i18n("Message Source")
|
title: i18n("Message Source")
|
||||||
|
|
||||||
TextArea {
|
ScrollView {
|
||||||
id: sourceTextArea
|
anchors.fill: parent
|
||||||
text: sourceText
|
contentWidth: availableWidth
|
||||||
readOnly: true
|
TextArea {
|
||||||
wrapMode: Text.WordWrap
|
id: sourceTextArea
|
||||||
|
text: sourceText
|
||||||
|
readOnly: true
|
||||||
|
textFormat: TextEdit.PlainText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
background: Rectangle {
|
||||||
|
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||||
|
Kirigami.Theme.inherit: false
|
||||||
|
color: Kirigami.Theme.backgroundColor
|
||||||
|
}
|
||||||
|
|
||||||
SyntaxHighlighter {
|
SyntaxHighlighter {
|
||||||
textEdit: sourceTextArea
|
textEdit: sourceTextArea
|
||||||
repository: Repository
|
definition: "JSON"
|
||||||
definition: "JSON"
|
repository: Repository
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -713,12 +713,6 @@ Kirigami.ScrollablePage {
|
|||||||
MessageDelegateContextMenu {}
|
MessageDelegateContextMenu {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: messageSourceSheet
|
|
||||||
|
|
||||||
MessageSourceSheet {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: fileDelegateContextMenu
|
id: fileDelegateContextMenu
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user