mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
@@ -79,6 +79,8 @@ Singleton {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
property bool clipboardEnterToPaste: false
|
||||
|
||||
property var launcherPluginVisibility: ({})
|
||||
|
||||
function getPluginAllowWithoutTrigger(pluginId) {
|
||||
@@ -2233,10 +2235,16 @@ Singleton {
|
||||
if ((existing.dark && typeof existing.dark === "object") || (existing.light && typeof existing.light === "object")) {
|
||||
perMode = existing;
|
||||
} else if (typeof existing.flavor === "string") {
|
||||
perMode.dark = {flavor: existing.flavor, accent: existing.accent || ""};
|
||||
perMode.dark = {
|
||||
flavor: existing.flavor,
|
||||
accent: existing.accent || ""
|
||||
};
|
||||
}
|
||||
}
|
||||
perMode[mode || "dark"] = {flavor: flavor, accent: accent};
|
||||
perMode[mode || "dark"] = {
|
||||
flavor: flavor,
|
||||
accent: accent
|
||||
};
|
||||
variants[themeId] = perMode;
|
||||
registryThemeVariants = variants;
|
||||
saveSettings();
|
||||
|
||||
@@ -469,6 +469,8 @@ var SPEC = {
|
||||
desktopWidgetGroups: { def: [] },
|
||||
|
||||
builtInPluginSettings: { def: {} },
|
||||
clipboardEnterToPaste: { def: false },
|
||||
|
||||
launcherPluginVisibility: { def: {} },
|
||||
launcherPluginOrder: { def: [] }
|
||||
};
|
||||
|
||||
@@ -268,6 +268,7 @@ Item {
|
||||
|
||||
sourceComponent: ClipboardKeyboardHints {
|
||||
wtypeAvailable: modal.wtypeAvailable
|
||||
enterToPaste: SettingsData.clipboardEnterToPaste
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
QtObject {
|
||||
@@ -133,7 +134,11 @@ QtObject {
|
||||
case Qt.Key_Return:
|
||||
case Qt.Key_Enter:
|
||||
if (ClipboardService.keyboardNavigationActive) {
|
||||
modal.pasteSelected();
|
||||
if (SettingsData.clipboardEnterToPaste) {
|
||||
copySelected();
|
||||
} else {
|
||||
modal.pasteSelected();
|
||||
}
|
||||
event.accepted = true;
|
||||
}
|
||||
return;
|
||||
@@ -144,7 +149,11 @@ QtObject {
|
||||
switch (event.key) {
|
||||
case Qt.Key_Return:
|
||||
case Qt.Key_Enter:
|
||||
copySelected();
|
||||
if (SettingsData.clipboardEnterToPaste) {
|
||||
modal.pasteSelected();
|
||||
} else {
|
||||
copySelected();
|
||||
}
|
||||
event.accepted = true;
|
||||
return;
|
||||
case Qt.Key_Delete:
|
||||
|
||||
@@ -6,7 +6,12 @@ Rectangle {
|
||||
id: keyboardHints
|
||||
|
||||
property bool wtypeAvailable: false
|
||||
readonly property string hintsText: wtypeAvailable ? I18n.tr("Shift+Enter: Paste • Shift+Del: Clear All • Esc: Close") : I18n.tr("Shift+Del: Clear All • Esc: Close")
|
||||
property bool enterToPaste: false
|
||||
readonly property string hintsText: {
|
||||
if (!wtypeAvailable)
|
||||
return I18n.tr("Shift+Del: Clear All • Esc: Close");
|
||||
return enterToPaste ? I18n.tr("Shift+Enter: Copy • Shift+Del: Clear All • Esc: Close", "Keyboard hints when enter-to-paste is enabled") : I18n.tr("Shift+Enter: Paste • Shift+Del: Clear All • Esc: Close");
|
||||
}
|
||||
|
||||
height: ClipboardConstants.keyboardHintsHeight
|
||||
radius: Theme.cornerRadius
|
||||
@@ -21,7 +26,7 @@ Rectangle {
|
||||
spacing: 2
|
||||
|
||||
StyledText {
|
||||
text: "↑/↓: Navigate • Enter/Ctrl+C: Copy • Del: Delete • F10: Help"
|
||||
text: keyboardHints.enterToPaste ? I18n.tr("↑/↓: Navigate • Enter: Paste • Del: Delete • F10: Help", "Keyboard hints when enter-to-paste is enabled") : "↑/↓: Navigate • Enter/Ctrl+C: Copy • Del: Delete • F10: Help"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
@@ -427,6 +427,16 @@ Item {
|
||||
checked: root.config.clearAtStartup ?? false
|
||||
onToggled: checked => root.saveConfig("clearAtStartup", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
tab: "clipboard"
|
||||
tags: ["clipboard", "enter", "paste", "behavior"]
|
||||
settingKey: "clipboardEnterToPaste"
|
||||
text: I18n.tr("Enter to Paste")
|
||||
description: I18n.tr("Press Enter to paste, Shift+Enter to copy", "Clipboard behavior setting description")
|
||||
checked: SettingsData.clipboardEnterToPaste
|
||||
onToggled: checked => SettingsData.set("clipboardEnterToPaste", checked)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
|
||||
Reference in New Issue
Block a user