Skip to content

Commit

Permalink
增加了跟随配置
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlb0224 committed Jul 8, 2024
1 parent 9e1fb11 commit 0fb0978
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/component/Config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export const ConfigTabArray = ["面板配置", "固定位置", "弹出框", "颜色栏", "标签样式", "标签设置", "待开发"] as const;
export type ConfigTab = (typeof ConfigTabArray)[number];

export const SortTypeArray = ["最近使用", "本条目+最近使用", "使用次数", "字母顺序"] as const;
export type SortType = (typeof SortTypeArray)[number];

export const ConfigTypeArray = ["草绿", "菊黄", "虾红", "跟随"] as const;
export type ConfigType = (typeof ConfigTypeArray)[number];
export function loadDefaultConfig(configType: ConfigType) {
Expand Down Expand Up @@ -75,7 +81,7 @@ export function loadDefaultConfig(configType: ConfigType) {
pPositions: "left,right,bottom,top",
isShowSelectedPopupColorsTag: false,
isShowSelectedPopupMatchTag: true,
showTagsLength: 10,
showTagsLength: 20,
fontSize: 18,
lineHeight: "0.8",
buttonMarginTopBottom: 4,
Expand Down
8 changes: 2 additions & 6 deletions src/component/PopupRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ import { saveAnnotationTags } from "../modules/AnnotationPopup";
import { type } from "os";
import { config } from "process";
import TagPopup from "./TagPopup";
import { Config, ConfigTypeArray, loadDefaultConfig } from "./Config";
const ConfigTabArray = ["面板配置", "固定位置", "弹出框", "颜色栏", "标签样式", "标签设置", "待开发"] as const;
export type ConfigTab = (typeof ConfigTabArray)[number];
import { Config, ConfigTab, ConfigTabArray, ConfigTypeArray, SortType, SortTypeArray, loadDefaultConfig } from "./Config";

const SortTypeArray = ["最近使用", "本条目+最近使用", "使用次数", "字母顺序"] as const;
export type SortType = (typeof SortTypeArray)[number];

export function PopupRoot({
reader,
Expand Down Expand Up @@ -452,7 +448,6 @@ export function PopupRoot({

setSortType(config.sortType);
setPref("sortType", config.sortType);

// setTimeout(() => setShowConfig(true));
}
const handleContentDiv = React.useCallback(
Expand Down Expand Up @@ -1136,6 +1131,7 @@ export function PopupRoot({
root.remove();
return;
}
ztoolkit.log("按键记录", e)
}}
/>
{/* <span style={tagStyle}>
Expand Down

0 comments on commit 0fb0978

Please sign in to comment.