Vanessa 2025-11-13 11:14:46 +08:00
parent f4d09f952f
commit 4b37741535
2 changed files with 13 additions and 15 deletions

View file

@ -181,10 +181,7 @@ export const appearance = {
<input class="b3-switch fn__flex-center" id="closeButtonBehavior" type="checkbox"${window.siyuan.config.appearance.closeButtonBehavior === 0 ? "" : " checked"}> <input class="b3-switch fn__flex-center" id="closeButtonBehavior" type="checkbox"${window.siyuan.config.appearance.closeButtonBehavior === 0 ? "" : " checked"}>
</label>`; </label>`;
}, },
_send: (statusBar?: { _send: (statusBar?: Config.IAppearanceStatusBar) => {
msgTaskHistoryDatabaseIndexCommitDisabled: boolean
msgTaskAssetDatabaseIndexCommitDisabled: boolean
}) => {
const themeLight = (appearance.element.querySelector("#themeLight") as HTMLSelectElement).value; const themeLight = (appearance.element.querySelector("#themeLight") as HTMLSelectElement).value;
const themeDark = (appearance.element.querySelector("#themeDark") as HTMLSelectElement).value; const themeDark = (appearance.element.querySelector("#themeDark") as HTMLSelectElement).value;
const modeElementValue = parseInt((appearance.element.querySelector("#mode") as HTMLSelectElement).value); const modeElementValue = parseInt((appearance.element.querySelector("#mode") as HTMLSelectElement).value);
@ -246,7 +243,6 @@ export const appearance = {
bindEvent: () => { bindEvent: () => {
appearance.element.querySelector("#statusBarSetting").addEventListener("click", () => { appearance.element.querySelector("#statusBarSetting").addEventListener("click", () => {
const dialog = new Dialog({ const dialog = new Dialog({
transparent: true,
width: "360px", width: "360px",
height: "80vh", height: "80vh",
title: window.siyuan.languages.appearance18, title: window.siyuan.languages.appearance18,
@ -257,14 +253,14 @@ export const appearance = {
${window.siyuan.languages["_taskAction"]["task.asset.database.index.commit"]} ${window.siyuan.languages["_taskAction"]["task.asset.database.index.commit"]}
</div> </div>
<span class="fn__space"></span> <span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="asset" type="checkbox"${window.siyuan.config.appearance.statusBar.msgTaskAssetDatabaseIndexCommitDisabled ? " checked" : ""}> <input class="b3-switch fn__flex-center" id="asset" type="checkbox"${window.siyuan.config.appearance.statusBar.msgTaskAssetDatabaseIndexCommitDisabled ? "" : " checked"}>
</label> </label>
<label class="b3-list-item"> <label class="b3-list-item">
<div class="b3-list-item__text"> <div class="b3-list-item__text">
${window.siyuan.languages["_taskAction"]["task.history.database.index.commit"]} ${window.siyuan.languages["_taskAction"]["task.history.database.index.commit"]}
</div> </div>
<span class="fn__space"></span> <span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="history" type="checkbox"${window.siyuan.config.appearance.statusBar.msgTaskHistoryDatabaseIndexCommitDisabled ? " checked" : ""}> <input class="b3-switch fn__flex-center" id="history" type="checkbox"${window.siyuan.config.appearance.statusBar.msgTaskHistoryDatabaseIndexCommitDisabled ? "" : " checked"}">
</label> </label>
</div>` </div>`
}); });
@ -272,14 +268,14 @@ export const appearance = {
const historyElement = dialog.element.querySelector("#history") as HTMLInputElement; const historyElement = dialog.element.querySelector("#history") as HTMLInputElement;
assetElement.addEventListener("change", () => { assetElement.addEventListener("change", () => {
appearance._send({ appearance._send({
msgTaskHistoryDatabaseIndexCommitDisabled: historyElement.checked, msgTaskHistoryDatabaseIndexCommitDisabled: !historyElement.checked,
msgTaskAssetDatabaseIndexCommitDisabled: assetElement.checked msgTaskAssetDatabaseIndexCommitDisabled: !assetElement.checked
}); });
}); });
historyElement.addEventListener("change", () => { historyElement.addEventListener("change", () => {
appearance._send({ appearance._send({
msgTaskHistoryDatabaseIndexCommitDisabled: historyElement.checked, msgTaskHistoryDatabaseIndexCommitDisabled: !historyElement.checked,
msgTaskAssetDatabaseIndexCommitDisabled: assetElement.checked msgTaskAssetDatabaseIndexCommitDisabled: !assetElement.checked
}); });
}); });
}); });

View file

@ -260,10 +260,12 @@ declare namespace Config {
* The version number of the theme currently in use * The version number of the theme currently in use
*/ */
themeVer: string; themeVer: string;
statusBar: { statusBar: IAppearanceStatusBar;
msgTaskHistoryDatabaseIndexCommitDisabled: boolean }
msgTaskAssetDatabaseIndexCommitDisabled: boolean
}; export interface IAppearanceStatusBar {
msgTaskHistoryDatabaseIndexCommitDisabled: boolean;
msgTaskAssetDatabaseIndexCommitDisabled: boolean;
} }
/** /**