Transform Clipboard to singleton and add rich text copying feature
This commit is contained in:
@@ -209,7 +209,7 @@ Control {
|
||||
icon.name: "mail-attachment"
|
||||
|
||||
onClicked: {
|
||||
if (imageClipboard.hasImage) {
|
||||
if (Clipboard.hasImage) {
|
||||
attachDialog.open()
|
||||
} else {
|
||||
var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay)
|
||||
|
||||
@@ -5,13 +5,14 @@ import Qt.labs.qmlmodels 1.0
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
import org.kde.kitemmodels 1.0
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
import Spectral.Component 2.0
|
||||
import Spectral.Component.Timeline 2.0
|
||||
import Spectral.Dialog 2.0
|
||||
import Spectral.Effect 2.0
|
||||
import Spectral.Menu.Timeline 2.0
|
||||
import Spectral 0.1
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
@@ -27,10 +28,6 @@ Kirigami.ScrollablePage {
|
||||
room: currentRoom
|
||||
}
|
||||
|
||||
ImageClipboard {
|
||||
id: imageClipboard
|
||||
}
|
||||
|
||||
QQC2.Popup {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -74,7 +71,7 @@ Kirigami.ScrollablePage {
|
||||
text: i18n("Clipboard image")
|
||||
onClicked: {
|
||||
var localPath = StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/screenshots/" + (new Date()).getTime() + ".png"
|
||||
if (!imageClipboard.saveImage(localPath)) return
|
||||
if (!Clipboard.saveImage(localPath)) return
|
||||
chatTextInput.attach(localPath)
|
||||
attachDialog.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user