capitalize L in copyList

This commit is contained in:
end-4
2025-11-14 11:13:49 +01:00
parent eb8f1379f2
commit 8404817e51
@@ -14,14 +14,14 @@ OverlayBackground {
property alias stickypadContents: stickypadInput.text property alias stickypadContents: stickypadInput.text
property bool pendingReload: false property bool pendingReload: false
property var copylistEntries: [] property var copyListEntries: []
property string lastParsedCopylistText: "" property string lastParsedCopylistText: ""
property var parsedCopylistLines: [] property var parsedCopylistLines: []
property bool isClickthrough: false property bool isClickthrough: false
Component.onCompleted: { Component.onCompleted: {
stickypadFile.reload(); stickypadFile.reload();
updateCopylistEntries(); updateCopyListEntries();
} }
function saveStickypad() { function saveStickypad() {
@@ -54,20 +54,20 @@ OverlayBackground {
return; return;
if (immediate) { if (immediate) {
copyListDebounce?.stop(); copyListDebounce?.stop();
updateCopylistEntries(); updateCopyListEntries();
} else { } else {
copyListDebounce.restart(); copyListDebounce.restart();
} }
} }
function updateCopylistEntries() { function updateCopyListEntries() {
if (!stickypadInput) if (!stickypadInput)
return; return;
const textValue = root.stickypadContents; const textValue = root.stickypadContents;
if (!textValue || textValue.length === 0) { if (!textValue || textValue.length === 0) {
lastParsedCopylistText = ""; lastParsedCopylistText = "";
parsedCopylistLines = []; parsedCopylistLines = [];
copylistEntries = []; root.copyListEntries = [];
return; return;
} }
@@ -94,7 +94,7 @@ OverlayBackground {
lastParsedCopylistText = textValue; lastParsedCopylistText = textValue;
parsedCopylistLines = parsed; parsedCopylistLines = parsed;
if (parsed.length === 0) { if (parsed.length === 0) {
copylistEntries = []; root.copyListEntries = [];
return; return;
} }
} }
@@ -131,7 +131,7 @@ OverlayBackground {
}; };
}).filter(entry => entry !== null); }).filter(entry => entry !== null);
copylistEntries = entries; root.copyListEntries = entries;
} }
ColumnLayout { ColumnLayout {
@@ -181,11 +181,13 @@ OverlayBackground {
Item { Item {
anchors.fill: stickypadInput anchors.fill: stickypadInput
visible: copylistEntries.length > 0 visible: root.copyListEntries.length > 0
clip: true clip: true
Repeater { Repeater {
model: copylistEntries model: ScriptModel {
values: root.copyListEntries
}
delegate: Item { delegate: Item {
readonly property real lineHeight: Math.max(modelData.height, Appearance.font.pixelSize.normal + 6) readonly property real lineHeight: Math.max(modelData.height, Appearance.font.pixelSize.normal + 6)
readonly property real iconSizeLocal: Appearance.font.pixelSize.normal readonly property real iconSizeLocal: Appearance.font.pixelSize.normal
@@ -261,12 +263,9 @@ OverlayBackground {
StyledText { StyledText {
id: statusLabel id: statusLabel
Layout.fillWidth: true Layout.fillWidth: true
// Layout.preferredHeight: 28
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
text: saveDebounce.running ? Translation.tr("Saving...") : Translation.tr("Saved") text: saveDebounce.running ? Translation.tr("Saving...") : Translation.tr("Saved ")
color: Appearance.colors.colSubtext color: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.small
font.weight: Font.Medium
} }
} }
@@ -299,7 +298,7 @@ OverlayBackground {
pendingReload = false; pendingReload = false;
Qt.callLater(root.focusStickypadAtEnd); Qt.callLater(root.focusStickypadAtEnd);
} }
Qt.callLater(root.updateCopylistEntries); Qt.callLater(root.updateCopyListEntries);
} }
onLoadFailed: error => { onLoadFailed: error => {
if (error === FileViewError.FileNotFound) { if (error === FileViewError.FileNotFound) {
@@ -309,7 +308,7 @@ OverlayBackground {
pendingReload = false; pendingReload = false;
Qt.callLater(root.focusStickypadAtEnd); Qt.callLater(root.focusStickypadAtEnd);
} }
Qt.callLater(root.updateCopylistEntries); Qt.callLater(root.updateCopyListEntries);
} else { } else {
console.log("[Stickypad] Error loading file: " + error); console.log("[Stickypad] Error loading file: " + error);
} }