Fix file open overflow on Firefox

This commit is contained in:
Asher 2019-02-26 15:09:59 -06:00
parent f05ce105e8
commit a07d0c9c3d
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
2 changed files with 118 additions and 119 deletions

View File

@ -1,87 +1,88 @@
.dialog { .dialog {
--primary: #2A2E37; --primary: #2A2E37;
--border: black; --border: black;
--faded: #a0a1a5; --faded: #a0a1a5;
--header-background: #161616; --header-background: #161616;
--header-foreground: white; --header-foreground: white;
--list-active-selection-background: rgb(0, 120, 160); --list-active-selection-background: rgb(0, 120, 160);
--list-active-selection-foreground: white; --list-active-selection-foreground: white;
--list-hover-background: rgb(36, 39, 46); --list-hover-background: rgb(36, 39, 46);
font-family: inherit; font-family: inherit;
box-shadow: 0 18px 80px 10px rgba(0, 0, 0, 0.1); box-shadow: 0 18px 80px 10px rgba(0, 0, 0, 0.1);
background-color: var(--primary); background-color: var(--primary);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
user-select: none; user-select: none;
overflow: hidden; overflow: hidden;
border-radius: 5px; border-radius: 5px;
.monaco-tl-twistie { .monaco-tl-twistie {
display: none; display: none;
} }
.title { .title {
background-color: var(--header-background); background-color: var(--header-background);
color: var(--header-foreground); color: var(--header-foreground);
padding: 1px; padding: 1px;
font-size: 11px; font-size: 11px;
font-weight: normal; font-weight: normal;
text-transform: uppercase; text-transform: uppercase;
white-space: nowrap; white-space: nowrap;
padding-left: 10px; padding-left: 10px;
} }
.nav { .nav {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 4px; padding: 4px;
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
min-height: 32px; min-height: 32px;
} }
.path { .path {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.path-part { .path-part {
padding: 5px; padding: 5px;
border-radius: 3px; border-radius: 3px;
font-size: 1.2em; font-size: 1.2em;
cursor: pointer; cursor: pointer;
&:not(:first-child) { &:not(:first-child) {
margin-left: 5px; margin-left: 5px;
} }
&.active { &.active {
font-weight: bold; font-weight: bold;
color: var(--list-active-selection-foreground); color: var(--list-active-selection-foreground);
} }
} }
} }
.file-area { .dialog-grid {
flex: 1; display: grid;
display: flex; grid-template-columns: 2fr 0.2fr 0.8fr;
flex-direction: column; }
.dialog-grid { .headings {
display: grid; padding: 8px;
grid-template-columns: 2fr 0.2fr 0.8fr; font-size: 12px;
} }
.headings { .file-area {
padding: 8px; flex: 1;
font-size: 12px; display: flex;
} flex-direction: column;
overflow: hidden;
.dialog-entry { .dialog-entry {
cursor: pointer; cursor: pointer;
font-size: 1.2em; font-size: 1.2em;
padding: 0px; padding: 0px;
padding-left: 8px; padding-left: 8px;
padding-right: 8px; padding-right: 8px;
.dialog-entry-info { .dialog-entry-info {
@ -89,56 +90,54 @@
flex-direction: row; flex-direction: row;
} }
.dialog-entry-icon { .dialog-entry-icon {
width: 16px; width: 16px;
height: 19px; height: 19px;
display: inline-block; margin-right: 5px;
margin-right: 5px; }
margin-bottom: -3px;
}
&:hover { &:hover {
background-color: var(--list-hover-background); background-color: var(--list-hover-background);
} }
&.active { &.active {
background-color: var(--list-active-selection-background); background-color: var(--list-active-selection-background);
color: var(--list-active-selection-foreground); color: var(--list-active-selection-foreground);
} }
} }
} }
.buttons { .buttons {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 10px; padding: 10px;
position: relative; position: relative;
background: var(--primary); background: var(--primary);
border-top: 1px solid var(--border); border-top: 1px solid var(--border);
button:first-child { button:first-child {
margin-left: auto; margin-left: auto;
margin-right: 10px; margin-right: 10px;
} }
button { button {
background: transparent; background: transparent;
outline: none; outline: none;
border: 0; border: 0;
color: var(--faded); color: var(--faded);
padding: 10px; padding: 10px;
padding-left: 18px; padding-left: 18px;
padding-right: 18px; padding-right: 18px;
transition: 150ms background ease, 150ms color ease; transition: 150ms background ease, 150ms color ease;
cursor: pointer; cursor: pointer;
border-radius: 5px; border-radius: 5px;
&:hover { &:hover {
background: var(--titlebar); background: var(--titlebar);
color: white; color: white;
} }
} }
} }
} }
.monaco-shell .monaco-tree.focused.no-focused-item:focus:before, .monaco-shell .monaco-list:not(.element-focused):focus:before { .monaco-shell .monaco-tree.focused.no-focused-item:focus:before, .monaco-shell .monaco-list:not(.element-focused):focus:before {

View File

@ -167,10 +167,6 @@ class Dialog {
navItems.appendChild(this.pathNode); navItems.appendChild(this.pathNode);
this.root.appendChild(navItems); this.root.appendChild(navItems);
const fileAreaNode = document.createElement("div");
fileAreaNode.classList.add("file-area");
fileAreaNode.classList.add("show-file-icons");
const headingsNode = document.createElement("div"); const headingsNode = document.createElement("div");
headingsNode.className = "headings dialog-grid"; headingsNode.className = "headings dialog-grid";
["Name", "Size", "Last Modified"].forEach(e => { ["Name", "Size", "Last Modified"].forEach(e => {
@ -178,10 +174,14 @@ class Dialog {
header.innerText = e; header.innerText = e;
headingsNode.appendChild(header); headingsNode.appendChild(header);
}); });
this.root.appendChild(headingsNode);
const fileAreaNode = document.createElement("div");
fileAreaNode.classList.add("file-area");
fileAreaNode.classList.add("show-file-icons");
this.filesNode = document.createElement("div"); this.filesNode = document.createElement("div");
this.filesNode.className = "files-list"; this.filesNode.className = "files-list";
fileAreaNode.appendChild(headingsNode);
this.entryList = new ObjectTree<DialogEntry, string>(this.filesNode, { this.entryList = new ObjectTree<DialogEntry, string>(this.filesNode, {
getHeight: (entry: DialogEntry): number => { getHeight: (entry: DialogEntry): number => {
return 20; return 20;