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

View file

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