setIsResizing(true)}
@@ -213,24 +201,17 @@ function FileTree({ nodes, depth, expandedDirs, toggleDir, activeTabId, activeFi
{node.type === 'dir' ? (
<>
-
+
-
+
>
) : (
<>
-
+
>
)}
diff --git a/src/renderer/components/TabBar/TabBar.tsx b/src/renderer/components/TabBar/TabBar.tsx
index 4bf2375..a7074b3 100644
--- a/src/renderer/components/TabBar/TabBar.tsx
+++ b/src/renderer/components/TabBar/TabBar.tsx
@@ -1,6 +1,7 @@
import React, { useCallback, useState, useEffect, useRef } from 'react'
import { useTabStore } from '../../stores/tabStore'
import { getFileName } from '../../lib/fileUtils'
+import { Close, Plus } from '../Icons'
interface ContextMenuState {
visible: boolean
@@ -22,7 +23,6 @@ export function TabBar() {
const [menu, setMenu] = useState
({ visible: false, x: 0, y: 0, tabId: '' })
const menuRef = useRef(null)
- // 关闭标签(带未保存确认)
const handleClose = useCallback((e: React.MouseEvent, tabId: string) => {
e.stopPropagation()
const tab = tabs.find(t => t.id === tabId)
@@ -44,7 +44,6 @@ export function TabBar() {
setMenu({ visible: true, x: Math.max(0, x), y: Math.max(0, y), tabId })
}, [])
- // 点击空白处关闭菜单
useEffect(() => {
if (!menu.visible) return
const handleClick = () => setMenu(prev => ({ ...prev, visible: false }))
@@ -52,7 +51,6 @@ export function TabBar() {
return () => document.removeEventListener('click', handleClick)
}, [menu.visible])
- // 菜单操作
const handleMenuClose = useCallback(() => {
const tab = tabs.find(t => t.id === menu.tabId)
if (tab?.isModified) {
@@ -64,7 +62,6 @@ export function TabBar() {
}, [tabs, menu.tabId, closeTab])
const handleMenuCloseOthers = useCallback(() => {
- // 检查其他标签是否有未保存
const otherModified = tabs.filter(t => t.id !== menu.tabId && t.isModified)
if (otherModified.length > 0) {
const names = otherModified.map(t => t.filePath ? getFileName(t.filePath) : '未命名').join('、')
@@ -96,7 +93,6 @@ export function TabBar() {
setMenu(prev => ({ ...prev, visible: false }))
}, [tabs, menu.tabId, closeTabsToRight])
- // 判断右侧是否还有标签
const hasRightTabs = menu.visible && (() => {
const index = tabs.findIndex(t => t.id === menu.tabId)
return index < tabs.length - 1
@@ -121,10 +117,7 @@ export function TabBar() {
className="tab-close"
onClick={(e) => handleClose(e, tab.id)}
>
-
+
))}
@@ -134,10 +127,7 @@ export function TabBar() {
onClick={() => createTab(null, '')}
title="新建标签页 (Ctrl+T)"
>
-
关闭其他标签
diff --git a/src/renderer/components/Toolbar/Toolbar.tsx b/src/renderer/components/Toolbar/Toolbar.tsx
index b0576ac..b204b71 100644
--- a/src/renderer/components/Toolbar/Toolbar.tsx
+++ b/src/renderer/components/Toolbar/Toolbar.tsx
@@ -1,4 +1,5 @@
import React from 'react'
+import { FolderOpen, Save, SplitView, EditMode, PreviewMode, Moon, Sun } from '../Icons'
interface ToolbarProps {
onOpen: () => void
@@ -14,61 +15,30 @@ export function Toolbar({ onOpen, onSave, viewMode, onViewModeChange, darkMode,
diff --git a/src/renderer/components/WelcomeScreen/WelcomeScreen.tsx b/src/renderer/components/WelcomeScreen/WelcomeScreen.tsx
index c252446..ccb8b8b 100644
--- a/src/renderer/components/WelcomeScreen/WelcomeScreen.tsx
+++ b/src/renderer/components/WelcomeScreen/WelcomeScreen.tsx
@@ -1,4 +1,5 @@
import React from 'react'
+import { AppIcon, WelcomeFile, WelcomeNew } from '../Icons'
interface WelcomeScreenProps {
onOpen: () => void
@@ -10,26 +11,17 @@ export function WelcomeScreen({ onOpen, onNew }: WelcomeScreenProps) {
欢迎使用 MarkLite
-
一款轻量级的 Markdown 阅读器
+
一款轻量级的 Markdown 编辑器