1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-11 23:09:42 -04:00

quickshell: drop support for 0.2, require 0.3+

- Remove all compat code
- Rewire LegacyNetworkService to use Quickshell.Networking
- Add parentWindow to settings child windows
This commit is contained in:
bbedward
2026-05-11 13:04:29 -04:00
parent 3989c7f801
commit b8f4c350a8
52 changed files with 1472 additions and 2064 deletions

View File

@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import qs.Common
import qs.Services
import qs.Widgets
@@ -230,44 +231,41 @@ Column {
if (!inlinePreviewVisible || !textArea.text)
return;
const content = textArea.text;
if (content.length > 0) {
const proc = Qt.createQmlObject(`
import QtQuick
import Quickshell.Io
Process {
property string content: ""
command: ["sh", "-c", "printf '%s' \\"$CONTENT\\" | dms clipboard copy"]
environment: { "CONTENT": content }
running: false
}`, root, "copyProc");
proc.content = content;
proc.running = true;
proc.exited.connect(() => {
ToastService.showInfo(I18n.tr("Copied to clipboard"));
proc.destroy();
});
}
if (content.length === 0)
return;
const proc = clipboardCopyProcComp.createObject(root, {
content: content,
running: true
});
proc.exited.connect(() => {
ToastService.showInfo(I18n.tr("Copied to clipboard"));
proc.destroy();
});
}
function copyHtmlToClipboard() {
if (!inlinePreviewVisible || !pluginHighlightedHtml)
return;
if (pluginHighlightedHtml.length > 0) {
const proc = Qt.createQmlObject(`
import QtQuick
import Quickshell.Io
Process {
property string content: ""
command: ["sh", "-c", "printf '%s' \\"$CONTENT\\" | dms clipboard copy"]
environment: { "CONTENT": content }
running: false
}`, root, "copyProcHtml");
proc.content = pluginHighlightedHtml;
proc.running = true;
proc.exited.connect(() => {
ToastService.showInfo(I18n.tr("HTML copied to clipboard"));
proc.destroy();
});
if (pluginHighlightedHtml.length === 0)
return;
const proc = clipboardCopyProcComp.createObject(root, {
content: pluginHighlightedHtml,
running: true
});
proc.exited.connect(() => {
ToastService.showInfo(I18n.tr("HTML copied to clipboard"));
proc.destroy();
});
}
Component {
id: clipboardCopyProcComp
Process {
property string content: ""
command: ["sh", "-c", "printf '%s' \"$CONTENT\" | dms clipboard copy"]
environment: ({
"CONTENT": content
})
}
}