Fix collection tree renaming background color (#3829)

This commit is contained in:
windingwind 2024-05-31 19:16:05 +08:00 committed by GitHub
parent d6d9979f19
commit 066eda7315
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -373,6 +373,7 @@ var CollectionTree = class CollectionTree extends LibraryTree {
label = document.createElement('input');
label.className = 'cell-text';
label.setAttribute("size", 5);
label.toggleAttribute("no-windows-native", true);
label.value = treeRow.editingName;
label.addEventListener('input', e => this.handleEditingChange(e, index));
label.addEventListener('mousedown', (e) => e.stopImmediatePropagation());

View file

@ -62,6 +62,8 @@ $icons: (
.cell.primary {
display: flex;
align-items: center;
// Stretch the cell to full height
align-self: stretch;
:not(.cell-text) {
flex-shrink: 0
@ -75,12 +77,16 @@ $icons: (
}
input.cell-text {
border: 1px highlight solid;
// Stretch the input to full height and be centered vertically
align-self: stretch;
border: none;
outline: color-mix(in srgb, var(--color-accent) 80%, var(--material-background)) solid 2px;
padding: 1px 2px;
margin-right: 5px;
width: 100%;
font-size: inherit;
pointer-events: auto;
background: var(--material-background);
}
.cell-icon {