mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-13 12:52:10 +08:00
settings-Quick search, add dimensions, modify window width.
This commit is contained in:
parent
607ff84af9
commit
d655198b1d
@ -278,6 +278,7 @@ function getQuickSearch({
|
|||||||
useItemOpen = false,
|
useItemOpen = false,
|
||||||
openAfterHideQuickSearchWindow = true,
|
openAfterHideQuickSearchWindow = true,
|
||||||
matchConditionsRemark = false,
|
matchConditionsRemark = false,
|
||||||
|
width = 600,
|
||||||
}: {
|
}: {
|
||||||
enable?: boolean | null;
|
enable?: boolean | null;
|
||||||
showHideShortcutKey?: string | null;
|
showHideShortcutKey?: string | null;
|
||||||
@ -289,6 +290,7 @@ function getQuickSearch({
|
|||||||
useItemOpen?: boolean | null;
|
useItemOpen?: boolean | null;
|
||||||
openAfterHideQuickSearchWindow?: boolean | null;
|
openAfterHideQuickSearchWindow?: boolean | null;
|
||||||
matchConditionsRemark?: boolean | null;
|
matchConditionsRemark?: boolean | null;
|
||||||
|
width?: number | null;
|
||||||
}): QuickSearch {
|
}): QuickSearch {
|
||||||
return {
|
return {
|
||||||
enable: enable ?? true,
|
enable: enable ?? true,
|
||||||
@ -301,6 +303,7 @@ function getQuickSearch({
|
|||||||
useItemOpen: useItemOpen ?? false,
|
useItemOpen: useItemOpen ?? false,
|
||||||
openAfterHideQuickSearchWindow: openAfterHideQuickSearchWindow ?? true,
|
openAfterHideQuickSearchWindow: openAfterHideQuickSearchWindow ?? true,
|
||||||
matchConditionsRemark: matchConditionsRemark ?? false,
|
matchConditionsRemark: matchConditionsRemark ?? false,
|
||||||
|
width: width ?? 600,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function createQuickSearchWindow() {
|
|||||||
global.quickSearchWindowInit = false;
|
global.quickSearchWindowInit = false;
|
||||||
quickSearchWindow = global.quickSearchWindow = new BrowserWindow({
|
quickSearchWindow = global.quickSearchWindow = new BrowserWindow({
|
||||||
title: "Dawn Launcher",
|
title: "Dawn Launcher",
|
||||||
width: 600,
|
width: global.setting.quickSearch.width,
|
||||||
height: 44,
|
height: 44,
|
||||||
type: "toolbar",
|
type: "toolbar",
|
||||||
frame: false,
|
frame: false,
|
||||||
|
@ -18,4 +18,8 @@ export default function () {
|
|||||||
ipcMain.on("setQuickSearchWindowHeight", (event, args) => {
|
ipcMain.on("setQuickSearchWindowHeight", (event, args) => {
|
||||||
global.quickSearchWindow.setBounds({ height: args });
|
global.quickSearchWindow.setBounds({ height: args });
|
||||||
});
|
});
|
||||||
|
// 设置快速搜索窗口宽度
|
||||||
|
ipcMain.on("setQuickSearchWindowWidth", (event, args) => {
|
||||||
|
global.quickSearchWindow.setBounds({ width: args });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -822,6 +822,10 @@ contextBridge.exposeInMainWorld("quickSearch", {
|
|||||||
setWindowHeight: (height: number) => {
|
setWindowHeight: (height: number) => {
|
||||||
ipcRenderer.send("setQuickSearchWindowHeight", height);
|
ipcRenderer.send("setQuickSearchWindowHeight", height);
|
||||||
},
|
},
|
||||||
|
// 设置窗口宽度
|
||||||
|
setWindowWidth: (width: number) => {
|
||||||
|
ipcRenderer.send("setQuickSearchWindowWidth", width);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld("about", {
|
contextBridge.exposeInMainWorld("about", {
|
||||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -175,6 +175,7 @@ declare global {
|
|||||||
onShowWindowBefore: (callback: Callback) => Function;
|
onShowWindowBefore: (callback: Callback) => Function;
|
||||||
onClearData: (callback: Callback) => Function;
|
onClearData: (callback: Callback) => Function;
|
||||||
setWindowHeight: (height: number) => void;
|
setWindowHeight: (height: number) => void;
|
||||||
|
setWindowWidth: (width: number) => void;
|
||||||
};
|
};
|
||||||
about: {
|
about: {
|
||||||
createWindow: () => void;
|
createWindow: () => void;
|
||||||
|
@ -1083,6 +1083,25 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</NForm>
|
</NForm>
|
||||||
|
<NForm
|
||||||
|
label-placement="left"
|
||||||
|
:show-feedback="false"
|
||||||
|
size="small"
|
||||||
|
class="mt-3"
|
||||||
|
>
|
||||||
|
<span class="block font-semibold">{{ store.language.size }}</span>
|
||||||
|
<NFormItem :label="store.language.width" class="mt-1">
|
||||||
|
<NInputNumber
|
||||||
|
v-model:value="setting.quickSearch.width"
|
||||||
|
size="small"
|
||||||
|
:min="0"
|
||||||
|
class="w-full"
|
||||||
|
placeholder=""
|
||||||
|
:show-button="false"
|
||||||
|
@update:value="updateQuickSearchWidth"
|
||||||
|
></NInputNumber>
|
||||||
|
</NFormItem>
|
||||||
|
</NForm>
|
||||||
<NForm
|
<NForm
|
||||||
label-placement="left"
|
label-placement="left"
|
||||||
:show-feedback="false"
|
:show-feedback="false"
|
||||||
@ -2121,6 +2140,12 @@ let quickSearchHistorySortOptions = ref([
|
|||||||
value: "openNumber",
|
value: "openNumber",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
// 快速搜索宽度更新
|
||||||
|
function updateQuickSearchWidth(value: number | null) {
|
||||||
|
if (value) {
|
||||||
|
window.quickSearch.setWindowWidth(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 网络搜索模式
|
// 网络搜索模式
|
||||||
let webSearchModeOptions = ref([
|
let webSearchModeOptions = ref([
|
||||||
{
|
{
|
||||||
|
2
types/setting.d.ts
vendored
2
types/setting.d.ts
vendored
@ -182,6 +182,8 @@ export interface QuickSearch {
|
|||||||
openAfterHideQuickSearchWindow: boolean;
|
openAfterHideQuickSearchWindow: boolean;
|
||||||
// 匹配条件:备注
|
// 匹配条件:备注
|
||||||
matchConditionsRemark: boolean;
|
matchConditionsRemark: boolean;
|
||||||
|
// 宽度
|
||||||
|
width: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 网络搜索
|
// 网络搜索
|
||||||
|
Loading…
Reference in New Issue
Block a user