Fix applauncher clipboard copy
This commit is contained in:
parent
532c3a8395
commit
b0702cf2f2
1 changed files with 14 additions and 29 deletions
|
|
@ -68,14 +68,9 @@ PanelWithOverlay {
|
|||
};
|
||||
|
||||
|
||||
const exists = clipboardHistory.find(item =>
|
||||
item.type === 'image' && item.data === entry.data
|
||||
);
|
||||
|
||||
if (!exists) {
|
||||
clipboardHistory = [entry, ...clipboardHistory].slice(0, 20);
|
||||
root.updateFilter();
|
||||
}
|
||||
// Always create a new image entry, even if identical to an existing one
|
||||
clipboardHistory = [entry].concat(clipboardHistory).slice(0, 20);
|
||||
root.updateFilter();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,29 +98,19 @@ PanelWithOverlay {
|
|||
};
|
||||
|
||||
|
||||
const exists = clipboardHistory.find(item => {
|
||||
if (item.type === 'text') {
|
||||
return item.content === content;
|
||||
var newHistory = clipboardHistory.map(item => {
|
||||
if (typeof item === 'string') {
|
||||
return {
|
||||
type: 'text',
|
||||
content: item,
|
||||
timestamp: 0
|
||||
};
|
||||
}
|
||||
|
||||
return item === content;
|
||||
return item;
|
||||
});
|
||||
|
||||
if (!exists) {
|
||||
|
||||
const newHistory = clipboardHistory.map(item => {
|
||||
if (typeof item === 'string') {
|
||||
return {
|
||||
type: 'text',
|
||||
content: item,
|
||||
timestamp: new Date().getTime()
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
clipboardHistory = [entry, ...newHistory].slice(0, 20);
|
||||
}
|
||||
// Always add a new text entry, even if content matches an existing entry
|
||||
clipboardHistory = [entry].concat(newHistory).slice(0, 20);
|
||||
}
|
||||
} else {
|
||||
|
||||
|
|
@ -787,7 +772,7 @@ PanelWithOverlay {
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 1
|
||||
height: Math.max(1, 1 * Theme.scale(screen))
|
||||
color: Theme.outline
|
||||
opacity: index === appList.count - 1 ? 0 : 0.10
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue