use fontawesome icons for entries

This commit is contained in:
joshuaboud 2021-05-25 16:12:26 -03:00
parent 462c9086b1
commit 28b7698534
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E
2 changed files with 11 additions and 5 deletions

View File

@ -80,7 +80,12 @@
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
.nav-item .nav-dir-icon { .nav-item .nav-file-icon {
font-size: 100px;
color: #3c3f42;
}
/* .nav-item .nav-dir-icon {
position: relative; position: relative;
background-color: #212427; background-color: #212427;
width: 100px; width: 100px;
@ -120,7 +125,7 @@
border-color: #3c3f42 #151515; border-color: #3c3f42 #151515;
display: block; display: block;
width: 0; width: 0;
} } */
.nav-info-column { .nav-info-column {
background-color: #212427; background-color: #212427;

View File

@ -32,7 +32,8 @@ class NavEntry {
this.path = path; this.path = path;
this.dom_element = document.createElement("div"); this.dom_element = document.createElement("div");
this.dom_element.classList.add("nav-item"); this.dom_element.classList.add("nav-item");
let icon = this.dom_element.nav_item_icon = document.createElement("div"); let icon = this.dom_element.nav_item_icon = document.createElement("i");
icon.classList.add("nav-file-icon");
let title = this.dom_element.nav_item_title = document.createElement("div"); let title = this.dom_element.nav_item_title = document.createElement("div");
title.classList.add("nav-item-title"); title.classList.add("nav-item-title");
title.innerText = this.filename(); title.innerText = this.filename();
@ -90,7 +91,7 @@ class NavFile extends NavEntry {
constructor(/*string or array*/ path, /*dict*/ stat, nav_window_ref) { constructor(/*string or array*/ path, /*dict*/ stat, nav_window_ref) {
super(path, stat, nav_window_ref); super(path, stat, nav_window_ref);
this.nav_type = "file"; this.nav_type = "file";
this.dom_element.nav_item_icon.classList.add("nav-file-icon"); this.dom_element.nav_item_icon.classList.add("fas", "fa-file");
} }
handleEvent(e) { handleEvent(e) {
super.handleEvent(e); super.handleEvent(e);
@ -101,7 +102,7 @@ class NavDir extends NavEntry {
constructor(/*string or array*/ path, /*dict*/ stat, nav_window_ref) { constructor(/*string or array*/ path, /*dict*/ stat, nav_window_ref) {
super(path, stat, nav_window_ref); super(path, stat, nav_window_ref);
this.nav_type = "dir"; this.nav_type = "dir";
this.dom_element.nav_item_icon.classList.add("nav-dir-icon"); this.dom_element.nav_item_icon.classList.add("fas", "fa-folder");
this.double_click = false; this.double_click = false;
} }
handleEvent(e) { handleEvent(e) {