Skip to content

Update icons & styling #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions webview-ui/src/components/FileList/FileNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import clsx from "clsx";

import { useWorkspaceContext } from "../../Context";
import FileNodeChildren from "./FileNodeChildren";
import nextflowIcon from "../../images/nextflow-icon.svg";
import processIcon from "../../images/process.svg";

import styles from "./styles.module.css";

Expand All @@ -25,7 +25,7 @@ const FileNode = ({ node }: Props) => {
<div className={clsx(styles.row, { [styles[typeStyleName]]: !!type })}>
<label className={clsx(styles.item)}>
<span className={styles.name} onClick={() => openFile(node)}>
<img className={styles.icon} src={nextflowIcon} />
<img className={styles.icon} src={processIcon} />
{node.name}
</span>
{type === "processes" && (
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/components/FileList/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
width: 100%;
}
& .icon {
width: 10px;
height: 10px;
width: 15px;
height: 14px;
margin-right: 6px;
}
}
Expand Down
32 changes: 25 additions & 7 deletions webview-ui/src/components/FileTree/FileNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { useState, useEffect } from "react";
import { useWorkspaceContext } from "../../Context";
import styles from "./styles.module.css";
import { FileNode as FileNodeType } from "../../Context/WorkspaceProvider/types";
import folderClosed from "../../images/folder-closed.svg";
import folderOpen from "../../images/folder-open.svg";
import file from "../../images/file.svg";

type Props = {
node: FileNodeType;
Expand Down Expand Up @@ -53,16 +56,31 @@ const FileNode = ({ node, level = 0, searchTerm }: Props) => {
}
if (!hasChildren && !isMatch) return null;

let icon = null;
let iconClassName = "";
if (isFolder) {
if (expanded) {
icon = folderOpen;
iconClassName = styles.folderIconOpen;
} else {
icon = folderClosed;
iconClassName = styles.folderIconClosed;
}
} else {
icon = file;
iconClassName = styles.fileIcon;
}

return (
<div className={clsx(styles.row, { [styles.folder]: isFolder })}>
<div
className={clsx(styles.row, {
[styles.folder]: isFolder,
[styles.expanded]: expanded
})}
>
<label className={clsx(styles.item)}>
<span className={styles.name} onClick={handleClick}>
<i
className={clsx(
"codicon",
isFolder ? "codicon-symbol-method" : "codicon-symbol-method"
)}
/>
<img src={icon} className={clsx(styles.icon, iconClassName)} />
{node.name}
</span>
{hasChildren && (
Expand Down
19 changes: 13 additions & 6 deletions webview-ui/src/components/FileTree/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@
align-items: center;
padding: 6px 8px;
width: 100%;
& i {
margin-right: 6px;
opacity: 0.8;
font-size: 14px;
}
}
}
& .children {
padding: 0 0 4px 0;
margin-left: 7px;
border-left: 1px solid var(--vscode-dropdown-border);
border-left: 1px solid var(--vscode-tree-inactiveIndentGuidesStroke);
}
&.folder {
& > .item > .name {
Expand All @@ -42,3 +37,15 @@
}
}
}
.icon {
margin-right: 6px;
height: 13px;
width: 20px;
&.fileIcon {
width: 11px;
height: 14px;
}
&.folderIconOpen {
transform: translateX(1px);
}
}
4 changes: 4 additions & 0 deletions webview-ui/src/images/file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions webview-ui/src/images/folder-closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions webview-ui/src/images/folder-open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions webview-ui/src/images/process.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions webview-ui/src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ html,
body,
#root,
#root > * {
background-color: var(--vscode-editor-background) !important;
background-color: var(--vscode-sideBar-background) !important;
}
:root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
Expand All @@ -17,7 +17,6 @@ body,

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
/* background-color: #242424; */

font-synthesis: none;
text-rendering: optimizeLegibility;
Expand Down