add filter icons

This commit is contained in:
codetypes committed 2024-04-26 23:22:52 +08:00
1 parent 78925c4ae5
commit 0cbbde3820
4 files changed
+42 -9

No files matched your search

+1
View File
@@ -42,6 +42,7 @@
"saveAs": "Save As...", "saveAs": "Save As...",
"saveAsSubtree": "Save As Subtree", "saveAsSubtree": "Save As Subtree",
"searchFile": "Search File", "searchFile": "Search File",
"searchNode": "Search Node",
"services": "Services", "services": "Services",
"start": "Start", "start": "Start",
"undo": "Undo", "undo": "Undo",
+1
View File
@@ -42,6 +42,7 @@
"saveAs": "另存为...", "saveAs": "另存为...",
"saveAsSubtree": "另存为子树", "saveAsSubtree": "另存为子树",
"searchFile": "搜索文件", "searchFile": "搜索文件",
"searchNode": "搜索节点",
"services": "服务", "services": "服务",
"start": "开始", "start": "开始",
"undo": "撤销", "undo": "撤销",
+36 -6
View File
@@ -21,6 +21,9 @@ import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from "re
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FiDelete } from "react-icons/fi"; import { FiDelete } from "react-icons/fi";
import { IoMdReturnLeft } from "react-icons/io"; import { IoMdReturnLeft } from "react-icons/io";
import { PiCubeFocus } from "react-icons/pi";
import { RiFocus3Fill, RiFocus3Line } from "react-icons/ri";
import { VscCaseSensitive } from "react-icons/vsc";
import { mergeRefs } from "react-merge-refs"; import { mergeRefs } from "react-merge-refs";
import { useDebounceCallback } from "usehooks-ts"; import { useDebounceCallback } from "usehooks-ts";
import "./register-node"; import "./register-node";
@@ -1002,24 +1005,50 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
<Flex <Flex
style={{ style={{
position: "absolute", position: "absolute",
marginTop: "10px", width: "100%",
marginLeft: "10px", justifyContent: "end",
paddingRight: "10px",
paddingTop: "10px",
}}
>
<Flex
style={{
backgroundColor: "#161b22", backgroundColor: "#161b22",
padding: "4px 10px 4px 10px", padding: "4px 10px 4px 10px",
borderRadius: "4px", borderRadius: "4px",
borderLeft: "4px solid #f78166", borderLeft: "3px solid #f78166",
boxShadow: "0 0 8px 2px #0000005c", boxShadow: "0 0 8px 2px #0000005c",
alignItems: "center", alignItems: "center",
}} }}
> >
<Input <Input
autoFocus autoFocus
allowClear
size="small" size="small"
style={{ borderRadius: "2px" }} style={{
borderRadius: "2px",
paddingTop: "1px",
paddingBottom: "1px",
paddingRight: "2px",
}}
onChange={(e) => onSearchChange(e.currentTarget.value)} onChange={(e) => onSearchChange(e.currentTarget.value)}
suffix={
<Flex style={{ alignItems: "center" }}>
<Button
type="text"
size="small"
style={{ width: "20px", height: "20px" }}
icon={<VscCaseSensitive style={{ width: "18px", height: "18px" }} />}
/> />
<div style={{ padding: "0 10px 0 5px" }}> <Button
type="text"
size="small"
style={{ width: "20px", height: "20px" }}
icon={<RiFocus3Line />}
/>
</Flex>
}
/>
<div style={{ padding: "0 10px 0 5px", minWidth: "40px" }}>
{results.length ? `${resultIndex + 1}/${results.length}` : ""} {results.length ? `${resultIndex + 1}/${results.length}` : ""}
</div> </div>
<Button <Button
@@ -1066,6 +1095,7 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
}} }}
/> />
</Flex> </Flex>
</Flex>
)} )}
<Dropdown menu={{ items: menuItems, onClick }} trigger={["contextMenu"]}> <Dropdown menu={{ items: menuItems, onClick }} trigger={["contextMenu"]}>
+4 -3
View File
@@ -7,9 +7,9 @@ import { app } from "@electron/remote";
import { Button, Flex, Layout, Space, Tabs, Tag, Tooltip } from "antd"; import { Button, Flex, Layout, Space, Tabs, Tag, Tooltip } from "antd";
import { FC, useEffect, useState } from "react"; import { FC, useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { BiAddToQueue } from "react-icons/bi";
import { FaExclamationTriangle, FaRegFolderOpen } from "react-icons/fa"; import { FaExclamationTriangle, FaRegFolderOpen } from "react-icons/fa";
import { PiTreeStructureFill } from "react-icons/pi"; import { PiTreeStructureFill } from "react-icons/pi";
import { VscNewFolder, VscRepo } from "react-icons/vsc";
import useForceUpdate from "use-force-update"; import useForceUpdate from "use-force-update";
import { useWindowSize } from "usehooks-ts"; import { useWindowSize } from "usehooks-ts";
import { Editor } from "./editor"; import { Editor } from "./editor";
@@ -275,7 +275,7 @@ export const Workspace: FC = () => {
}} }}
onClick={() => workspace.createProject()} onClick={() => workspace.createProject()}
> >
<BiAddToQueue size="20px" /> <VscNewFolder size="20px" />
{t("createProject")} {t("createProject")}
</Flex> </Flex>
<Flex <Flex
@@ -289,7 +289,7 @@ export const Workspace: FC = () => {
}} }}
onClick={() => workspace.openProject()} onClick={() => workspace.openProject()}
> >
<FaRegFolderOpen size="19px" /> <VscRepo size="19px" />
{t("openProject")} {t("openProject")}
</Flex> </Flex>
</Flex> </Flex>
@@ -337,6 +337,7 @@ export const Workspace: FC = () => {
{[ {[
{ label: t("searchFile"), hotkeys: isMacos ? "⌘ P" : "Ctrl + P" }, { label: t("searchFile"), hotkeys: isMacos ? "⌘ P" : "Ctrl + P" },
{ label: t("build"), hotkeys: isMacos ? "⌘ B" : "Ctrl + B" }, { label: t("build"), hotkeys: isMacos ? "⌘ B" : "Ctrl + B" },
{ label: t("searchNode"), hotkeys: isMacos ? "⌘ F" : "Ctrl + F" },
{ label: t("insertNode"), hotkeys: "Enter" }, { label: t("insertNode"), hotkeys: "Enter" },
{ label: t("deleteNode"), hotkeys: "Backspace" }, { label: t("deleteNode"), hotkeys: "Backspace" },
].map((v) => ( ].map((v) => (