mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
Truncate long layer names in Layers panel list to prevent horizontal scroll
This commit is contained in:
1 parent
962d2610fc
commit
bf3715f6aa
1 file changed
+18
-1
+18
-1
@@ -975,6 +975,21 @@
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
text-align: left;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.layerItem > span:first-child {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.layerItem > span:last-child {
|
||||
flex-shrink: 0;
|
||||
color: var(--muted);
|
||||
font-size: .78rem;
|
||||
}
|
||||
|
||||
.layerItem.active {
|
||||
@@ -3394,7 +3409,9 @@
|
||||
const item = document.createElement('button');
|
||||
item.type = 'button';
|
||||
item.className = `layerItem${layer.id === state.selectedLayerId ? ' active' : ''}`;
|
||||
item.innerHTML = `<span>${layer.name || layer.type}</span><span>${layer.type}</span>`;
|
||||
const rawName = layer.name || layer.type;
|
||||
const displayName = rawName.length > 32 ? rawName.slice(0, 29) + '...' : rawName;
|
||||
item.innerHTML = `<span title="${rawName}">${displayName}</span><span>${layer.type}</span>`;
|
||||
item.addEventListener('click', () => {
|
||||
state.selectedLayerId = layer.id;
|
||||
render();
|
||||
|
||||
Reference in new issue
Block a user