Skip to content

Commit 45a2c9f

Browse files
committed
Show icons next to the model folder and files in the dropdown, styling tweaks to increase padding
1 parent c49ac68 commit 45a2c9f

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

ui/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ <h4 class="collapsible">
291291
<div class="dropdown display-settings">
292292
<button class="dropbtn primaryButton">
293293
<i class="fa-solid fa-bars"></i>
294-
Preview options
294+
Preview settings
295295
<i class="fa-solid fa-angle-down"></i>
296296
</button>
297297
<div class="dropdown-content">

ui/media/css/main.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ div.img-preview img {
623623
}
624624

625625
#editor-settings-entries ul {
626-
margin: 0px;
627626
padding: 0px;
628627
}
629628

ui/media/css/searchable-models.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@
1616
.model-list ul {
1717
padding-right: 20px;
1818
padding-inline-start: 0;
19-
padding-bottom: 0px;
19+
margin-top: 6pt;
2020
}
2121

2222
.model-list li {
23-
padding-bottom: 0px;
23+
padding-top: 3px;
24+
padding-bottom: 3px;
25+
}
26+
27+
.model-list .icon {
28+
padding-right: 3pt;
2429
}
2530

2631
.model-result {
@@ -31,7 +36,7 @@
3136
color: var(--text-color);
3237
list-style: none;
3338
padding: 3px 6px 3px 6px;
34-
font-size: 10pt;
39+
font-size: 9pt;
3540
font-style: italic;
3641
display: none;
3742
}
@@ -42,14 +47,15 @@
4247
padding: 6px 6px 6px 6px;
4348
font-size: 9pt;
4449
font-weight: bold;
50+
border-top: 1px solid var(--background-color1);
4551
}
4652

4753
.model-list li.model-file {
4854
color: var(--input-text-color);
4955
list-style: none;
5056
padding-left: 12px;
5157
padding-right:20px;
52-
font-size: 9pt;
58+
font-size: 10pt;
5359
font-weight: normal;
5460
transition: none;
5561
transition:property: none;

ui/media/js/searchable-models.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class ModelDropdown
517517
* @param {Array<string>} classes
518518
* @returns {HTMLElement}
519519
*/
520-
createElement(tagName, attributes, classes, text) {
520+
createElement(tagName, attributes, classes, text, icon) {
521521
const element = document.createElement(tagName)
522522
if (attributes) {
523523
Object.entries(attributes).forEach(([key, value]) => {
@@ -527,6 +527,11 @@ class ModelDropdown
527527
if (classes) {
528528
classes.forEach(className => element.classList.add(className))
529529
}
530+
if (icon) {
531+
let iconEl = document.createElement('i')
532+
iconEl.className = icon + ' icon'
533+
element.appendChild(iconEl)
534+
}
530535
if (text) {
531536
element.appendChild(document.createTextNode(text))
532537
}
@@ -565,7 +570,7 @@ class ModelDropdown
565570
const fullPath = folderName ? `${folderName.substring(1)}/${model}` : model
566571
modelsMap.set(
567572
model,
568-
this.createElement('li', { 'data-path': fullPath }, classes, model),
573+
this.createElement('li', { 'data-path': fullPath }, classes, model, 'fa-regular fa-file'),
569574
)
570575
}
571576
})
@@ -579,7 +584,7 @@ class ModelDropdown
579584
const modelElements = modelNames.map(name => modelsMap.get(name))
580585

581586
if (modelElements.length && folderName) {
582-
listElement.appendChild(this.createElement('li', undefined, ['model-folder'], folderName))
587+
listElement.appendChild(this.createElement('li', undefined, ['model-folder'], folderName.substring(1), 'fa-solid fa-folder-open'))
583588
}
584589

585590
const allModelElements = isRootFolder ? [...folderElements, ...modelElements] : [...modelElements, ...folderElements]

0 commit comments

Comments
 (0)