Skip to content

Commit 5c07b42

Browse files
committed
feat: 更漂亮的设置页面
1 parent d4134d0 commit 5c07b42

23 files changed

Lines changed: 578 additions & 189 deletions

lang/index.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,5 +3734,61 @@
37343734
"ru": "",
37353735
"en": "",
37363736
"fr": ""
3737+
},
3738+
"wzgjv47": {
3739+
"zh-cn": " 前往发布页 ",
3740+
"ja": "",
3741+
"ko": "",
3742+
"ru": "",
3743+
"en": "",
3744+
"fr": ""
3745+
},
3746+
"ypb7wrd": {
3747+
"zh-cn": "控制编辑器中的拼写检查能力",
3748+
"ja": "",
3749+
"ko": "",
3750+
"ru": "",
3751+
"en": "",
3752+
"fr": ""
3753+
},
3754+
"bgchnp4": {
3755+
"zh-cn": "图片粘贴",
3756+
"ja": "",
3757+
"ko": "",
3758+
"ru": "",
3759+
"en": "",
3760+
"fr": ""
3761+
},
3762+
"p3ko1gf": {
3763+
"zh-cn": "设置粘贴图片后的保存与上传方式",
3764+
"ja": "",
3765+
"ko": "",
3766+
"ru": "",
3767+
"en": "",
3768+
"fr": ""
3769+
},
3770+
"ksgnsqh": {
3771+
"zh-cn": "配置 AI 提供商、模型与连接参数",
3772+
"ja": "",
3773+
"ko": "",
3774+
"ru": "",
3775+
"en": "",
3776+
"fr": ""
3777+
},
3778+
"zaoq64e": {
3779+
"zh-cn": "常用的打开、保存与另存为操作",
3780+
"ja": "",
3781+
"ko": "",
3782+
"ru": "",
3783+
"en": "",
3784+
"fr": ""
3785+
},
3786+
"q1na9je": {
3787+
"zh-cn": "将当前内容导出为不同格式文件",
3788+
"ja": "",
3789+
"ko": "",
3790+
"ru": "",
3791+
"en": "",
3792+
"fr": ""
37373793
}
37383794
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"font-list": "^1.5.1",
7474
"he": "^1.2.0",
7575
"katex": "^0.16.28",
76+
"lucide-vue-next": "^1.0.0",
7677
"mdast": "^3.0.0",
7778
"mermaid": "^11.10.0",
7879
"mitt": "^3.0.1",

src/renderer/components/dialogs/UpdateConfirmDialog.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { nextTick, ref, watch } from "vue";
3+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
34
import { unified } from "unified";
45
import remarkParse from "remark-parse";
56
import remarkRehype from "remark-rehype";
@@ -92,9 +93,10 @@ watch(
9293
<div class="dialog-content" @click.stop>
9394
<div class="dialog-header">
9495
<h3>milkup 新版本现已发布!</h3>
95-
<span class="link" @click="openReleasePage"
96-
>前往发布页 <i class="iconfont icon-link"></i
97-
></span>
96+
<span class="link" @click="openReleasePage">
97+
前往发布页
98+
<AppIcon name="link" class="link-icon" />
99+
</span>
98100
</div>
99101

100102
<!-- 进度条区域 - 固定在内容上方 -->

src/renderer/components/menu/MenuBar.vue

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import FileOptions from "@/renderer/components/settings/FileOptions.vue";
66
import Language from "@/renderer/components/settings/Language.vue";
77
import SettingBase from "@/renderer/components/settings/SettingBase.vue";
88
import ShortcutPage from "@/renderer/components/settings/ShortcutPage.vue";
9+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
910
import emitter from "@/renderer/events";
1011
import { checkUpdate } from "@/renderer/services/api/update.js";
1112
@@ -21,32 +22,32 @@ const MenuComponents = {
2122
shortcut: ShortcutPage,
2223
};
2324
const MenuOptions = [
24-
{ label: "文件", action: () => (activeTab.value = "file"), icon: "icon-document", value: "file" },
25+
{ label: "文件", action: () => (activeTab.value = "file"), icon: "document", value: "file" },
2526
{
2627
label: "设置",
2728
action: () => (activeTab.value = "settings"),
28-
icon: "icon-config-props",
29+
icon: "config-props",
2930
value: "settings",
3031
},
3132
{
3233
label: "外观",
3334
action: () => (activeTab.value = "appearance"),
34-
icon: "icon-waiguan",
35+
icon: "waiguan",
3536
value: "appearance",
3637
},
3738
{
3839
label: "快捷键",
3940
action: () => (activeTab.value = "shortcut"),
40-
icon: "icon-input",
41+
icon: "shortcut-key",
4142
value: "shortcut",
4243
},
4344
{
4445
label: "语言",
4546
action: () => (activeTab.value = "language"),
46-
icon: "icon-fanyi",
47+
icon: "fanyi",
4748
value: "language",
4849
},
49-
{ label: "关于", action: () => (activeTab.value = "about"), icon: "icon-github", value: "about" },
50+
{ label: "关于", action: () => (activeTab.value = "about"), icon: "github", value: "about" },
5051
];
5152
checkUpdate().then((updateInfo) => {
5253
if (updateInfo) {
@@ -58,15 +59,16 @@ checkUpdate().then((updateInfo) => {
5859
<template>
5960
<div class="MenubarBox">
6061
<div class="optionsContainer">
61-
<span
62+
<button
6263
v-for="option in MenuOptions"
6364
:key="option.label"
64-
class="iconfont"
65-
:class="{ active: activeTab === option.value, [option.icon]: true }"
65+
class="menu-option"
66+
:class="{ active: activeTab === option.value }"
6667
@click="option.action"
6768
>
69+
<AppIcon :name="option.icon" class="menu-option-icon" />
6870
{{ option.label }}
69-
</span>
71+
</button>
7072
</div>
7173
<div class="detailContainer">
7274
<div class="scrollView">
@@ -117,7 +119,7 @@ checkUpdate().then((updateInfo) => {
117119
-webkit-app-region: drag;
118120
background: var(--background-color);
119121
120-
span {
122+
.menu-option {
121123
cursor: pointer;
122124
width: 100%;
123125
-webkit-app-region: no-drag;
@@ -126,12 +128,14 @@ checkUpdate().then((updateInfo) => {
126128
display: flex;
127129
align-items: center;
128130
gap: 8px;
131+
border: none;
132+
background: transparent;
133+
text-align: left;
129134
color: var(--text-color);
130135
131-
&::before {
132-
font-size: 16px;
133-
transform: translateY(1px);
134-
font-weight: 100 !important;
136+
.menu-option-icon {
137+
font-size: 18px;
138+
flex-shrink: 0;
135139
}
136140
137141
&:hover {

src/renderer/components/menu/StatusBar.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { computed, ref } from "vue";
3+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
34
import { toggleShowOutline } from "@/renderer/hooks/useOutline";
45
import useSourceCode from "@/renderer/hooks/useSourceCode";
56
@@ -58,12 +59,11 @@ window.electronAPI.on("view:toggleView", () => {
5859
<div class="StatusBarBox">
5960
<div class="left-section">
6061
<div>
61-
<span class="iconfont icon-List-outlined" @click="toggleShowOutline()"></span>
62-
<span
63-
class="iconfont"
64-
:class="isShowSource ? 'icon-input' : 'icon-markdown'"
65-
@click.stop="toggleSourceCode()"
66-
>
62+
<span class="status-icon-btn" @click="toggleShowOutline()">
63+
<AppIcon name="List-outlined" />
64+
</span>
65+
<span class="status-icon-btn" @click.stop="toggleSourceCode()">
66+
<AppIcon :name="isShowSource ? 'input' : 'markdown'" />
6767
</span>
6868
</div>
6969

@@ -74,7 +74,7 @@ window.electronAPI.on("view:toggleView", () => {
7474
@click="handleRestore"
7575
title="点击恢复下载弹窗"
7676
>
77-
<span class="iconfont icon-download"></span>
77+
<AppIcon name="download" class="status-inline-icon" />
7878
<span>正在下载 {{ downloadProgress }}%</span>
7979
<div class="mini-progress-bg">
8080
<div class="mini-progress-fill" :style="{ width: `${downloadProgress}%` }"></div>
@@ -85,7 +85,7 @@ window.electronAPI.on("view:toggleView", () => {
8585
class="update-progress-bar success"
8686
@click="handleRestore"
8787
>
88-
<span class="iconfont icon-check-circle"></span>
88+
<AppIcon name="check-circle" class="status-inline-icon" />
8989
<span>下载完成,点击安装</span>
9090
</div>
9191
</div>

src/renderer/components/menu/TitleBar.vue

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { onUnmounted, ref } from "vue";
3+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
34
import TabBar from "@/renderer/components/workspace/TabBar.vue";
45
import MenuDropDown from "./MenuDropDown.vue";
56
@@ -46,13 +47,15 @@ onUnmounted(() => {
4647
<TabBar />
4748

4849
<div class="window-controls">
49-
<span class="iconfont icon-min" @click="minimize"></span>
50-
<span
51-
class="iconfont"
52-
:class="isFullScreen ? 'icon-normal' : 'icon-max'"
53-
@click="toggleMaximize"
54-
></span>
55-
<span class="iconfont icon-close" @click="close"></span>
50+
<button class="window-control-btn" @click="minimize">
51+
<AppIcon name="min" />
52+
</button>
53+
<button class="window-control-btn" @click="toggleMaximize">
54+
<AppIcon :name="isFullScreen ? 'normal' : 'max'" />
55+
</button>
56+
<button class="window-control-btn close-btn" @click="close">
57+
<AppIcon name="close" />
58+
</button>
5659
</div>
5760
</template>
5861
<template v-else>
@@ -91,7 +94,7 @@ onUnmounted(() => {
9194
justify-content: center;
9295
9396
/* ✅ 控制按钮不能拖动 */
94-
span {
97+
.window-control-btn {
9598
display: flex;
9699
align-items: center;
97100
justify-content: center;
@@ -100,15 +103,14 @@ onUnmounted(() => {
100103
color: var(--text-color-1);
101104
height: 40px;
102105
width: 40px;
103-
104-
// padding: 8px;
105-
// 保持长宽比
106+
border: none;
107+
background: transparent;
106108
107109
&:hover {
108110
background: var(--hover-color);
109111
}
110112
111-
&.icon-close:hover {
113+
&.close-btn:hover {
112114
background: #ff5f56;
113115
color: white;
114116
}

src/renderer/components/outline/Outline.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { reactive, ref, watch } from "vue";
3+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
34
import WorkSpace from "@/renderer/components/workspace/WorkSpace.vue";
45
import useOutline from "@/renderer/hooks/useOutline";
56
import emitter from "@/renderer/events";
@@ -161,15 +162,15 @@ onUnmounted(() => document.removeEventListener("click", onDocClick));
161162
:class="{ collapsed: collapsedSet.has(oi.id) }"
162163
@click.stop="toggleCollapse(oi)"
163164
>
164-
<span class="iconfont icon-arrow-right"></span>
165+
<AppIcon name="arrow-right" />
165166
</span>
166167
<span v-else class="collapse-icon-placeholder"></span>
167168
<span class="outlineItem-text">{{ oi.text }}</span>
168169
</div>
169170
</template>
170171
</template>
171172
<div v-else class="empty-state">
172-
<span class="iconfont icon-List-outlined empty-icon"></span>
173+
<AppIcon name="List-outlined" class="empty-icon" />
173174
<span class="empty-text">暂无大纲</span>
174175
</div>
175176
</div>
@@ -194,7 +195,7 @@ onUnmounted(() => document.removeEventListener("click", onDocClick));
194195
@mouseleave="showCollapseSubmenu = false"
195196
>
196197
<span>折叠</span>
197-
<span class="iconfont icon-arrow-right submenu-arrow"></span>
198+
<AppIcon name="arrow-right" class="submenu-arrow" />
198199
<!-- 二级菜单 -->
199200
<div v-if="showCollapseSubmenu" class="outline-submenu">
200201
<div class="outline-ctx-item" @click="collapseByLevel(1)">折叠一级标题</div>

src/renderer/components/settings/AISetting.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Switch } from "@renderer/components/ui/switch";
99
import { Slider } from "@renderer/components/ui/slider";
1010
import Input from "@renderer/components/ui/input/Input.vue";
1111
import Selector from "@renderer/components/ui/selector/Selector.vue";
12+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
1213
1314
const { config, updateConfig, providerDefaultUrls: urls } = useAIConfig();
1415
@@ -154,7 +155,7 @@ function updateProvider(val: string) {
154155
class="setting-input-width"
155156
/>
156157
<button class="refresh-btn" @click="fetchOllamaModels" title="刷新模型列表">
157-
<i class="iconfont icon-refresh">↻</i>
158+
<AppIcon name="refresh" />
158159
</button>
159160
</div>
160161
<Input

src/renderer/components/settings/About.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import emitter from "@/renderer/events";
55
import { checkUpdate } from "@/renderer/services/api/update";
66
import { version } from "../../../../package.json";
77
import { ref } from "vue";
8+
import AppIcon from "@/renderer/components/ui/AppIcon.vue";
89
import LoadingIcon from "../ui/LoadingIcon.vue";
910
1011
function openByDefaultBrowser(url: string) {
@@ -89,7 +90,10 @@ function handleCheckUpdate() {
8990
@click="openByDefaultBrowser(`https://github.com/Auto-Plugin/milkup/graphs/contributors`)"
9091
>
9192
Thank you for the contribution from
92-
<span class="iconfont icon-github">Auto-Plugin</span></span
93+
<span class="contributor-link">
94+
<AppIcon name="github" />
95+
Auto-Plugin
96+
</span></span
9397
>
9498
</p>
9599
<p class="tip">milkup 是完全免费开源的软件</p>

0 commit comments

Comments
 (0)