mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
improve label cell performance by avoiding clipboard retrieval
This commit is contained in:
parent
1eb595823b
commit
77fde3cda9
1 changed files with 9 additions and 12 deletions
|
@ -92,18 +92,15 @@ class LabelCell extends TextFieldTreeTableCell<Entry, String> {
|
||||||
});
|
});
|
||||||
getItems().add(copyLabel);
|
getItems().add(copyLabel);
|
||||||
|
|
||||||
Object content = Clipboard.getSystemClipboard().getContent(DataFormat.PLAIN_TEXT);
|
MenuItem pasteLabel = new MenuItem("Paste Label");
|
||||||
if(content instanceof String) {
|
pasteLabel.setOnAction(AE -> {
|
||||||
MenuItem pasteLabel = new MenuItem("Paste Label");
|
hide();
|
||||||
pasteLabel.setOnAction(AE -> {
|
Object currentContent = Clipboard.getSystemClipboard().getContent(DataFormat.PLAIN_TEXT);
|
||||||
hide();
|
if(currentContent instanceof String) {
|
||||||
Object currentContent = Clipboard.getSystemClipboard().getContent(DataFormat.PLAIN_TEXT);
|
entry.labelProperty().set((String)currentContent);
|
||||||
if(currentContent instanceof String) {
|
}
|
||||||
entry.labelProperty().set((String)currentContent);
|
});
|
||||||
}
|
getItems().add(pasteLabel);
|
||||||
});
|
|
||||||
getItems().add(pasteLabel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue