From 3f8b08fbd4a47d1a74cb4e57732e8ac6c070c5b3 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 12 Nov 2025 22:22:12 +0800 Subject: [PATCH] :art: Support setting status bar message switch https://github.com/siyuan-note/siyuan/issues/16236 Signed-off-by: Daniel <845765@qq.com> --- app/appearance/langs/ar_SA.json | 5 +++-- app/appearance/langs/de_DE.json | 5 +++-- app/appearance/langs/en_US.json | 5 +++-- app/appearance/langs/es_ES.json | 5 +++-- app/appearance/langs/fr_FR.json | 5 +++-- app/appearance/langs/he_IL.json | 5 +++-- app/appearance/langs/it_IT.json | 5 +++-- app/appearance/langs/ja_JP.json | 5 +++-- app/appearance/langs/pl_PL.json | 5 +++-- app/appearance/langs/pt_BR.json | 5 +++-- app/appearance/langs/ru_RU.json | 5 +++-- app/appearance/langs/zh_CHT.json | 5 +++-- app/appearance/langs/zh_CN.json | 5 +++-- kernel/conf/appearance.go | 4 ++++ kernel/model/conf.go | 4 ++++ kernel/task/queue.go | 7 +++++++ kernel/util/statusbar.go | 25 +++++++++++++++++++++++++ 17 files changed, 79 insertions(+), 26 deletions(-) create mode 100644 kernel/util/statusbar.go diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json index a177178e3..7a9c001f8 100644 --- a/app/appearance/langs/ar_SA.json +++ b/app/appearance/langs/ar_SA.json @@ -1119,8 +1119,9 @@ "appearance1": "سمات كتلة الكود", "appearance10": "وظيفة زر الإغلاق", "appearance11": "التصغير إلى شريط المهام عند النقر على زر الإغلاق", - "appearance16": "إخفاء شريط الحالة السفلي", - "appearance17": "عند التمكين، سيتم إخفاء شريط الحالة السفلي في نسخة سطح المكتب", + "appearance16": "شريط الحالة السفلي", + "appearance17": "عند التمكين، سيتم إخفاء شريط الحالة", + "appearance18": "تكوين مفتاح رسائل شريط الحالة", "min": "تصغير", "restore": "استعادة", "max": "تكبير", diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json index 09a20d049..981ecc774 100644 --- a/app/appearance/langs/de_DE.json +++ b/app/appearance/langs/de_DE.json @@ -1119,8 +1119,9 @@ "appearance1": "Codeblock-Thema", "appearance10": "Einstellungen für die Schaltfläche schließen", "appearance11": "Nach dem Klicken auf die Schaltfläche schließen in das Tray minimieren", - "appearance16": "Untere Statusleiste ausblenden", - "appearance17": "Die Statusleiste am unteren Bildschirmrand ausblenden, wenn aktiviert", + "appearance16": "Untere Statusleiste", + "appearance17": "Wenn aktiviert, wird die Statusleiste ausgeblendet", + "appearance18": "Schalter für Statusleistenmeldungen konfigurieren", "min": "Min", "restore": "Wiederherstellen", "max": "Max", diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 88fd26293..a0edb4c5b 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1119,8 +1119,9 @@ "appearance1": "Code Block Theme", "appearance10": "Close button settings", "appearance11": "shrink to the tray after clicking the close button", - "appearance16": "Hide bottom status bar", - "appearance17": "Hide the status bar at the bottom of the desktop when enabled", + "appearance16": "Bottom status bar", + "appearance17": "When enabled, the status bar will be hidden", + "appearance18": "Configure the status bar message switch", "min": "Min", "restore": "Restore", "max": "Max", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index d4c769938..a6f16c107 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1119,8 +1119,9 @@ "appearance1": "Tema del bloque de código", "appearance10": "Configuración del botón de cierre", "appearance11": "encoger a la bandeja después de hacer clic en el botón de cierre", - "appearance16": "Ocultar la barra de estado inferior", - "appearance17": "Ocultar la barra de estado en la parte inferior del escritorio cuando está activada", + "appearance16": "Barra de estado inferior", + "appearance17": "Al habilitar, la barra de estado se ocultará", + "appearance18": "Configurar el interruptor de mensajes de la barra de estado", "min": "Minimizar", "restore": "Restaurar", "max": "Maximizar", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 37e71a534..4c110850c 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1119,8 +1119,9 @@ "appearance1": "Thème du bloc de codes", "appearance10": "Close button settings", "appearance11": "shrink to the tray after clicking the close button", - "appearance16": "Masquer la barre d'état inférieure", - "appearance17": "Masquer la barre d'état en bas du bureau lorsqu'elle est activée", + "appearance16": "Barre d'état inférieure", + "appearance17": "Une fois activé, la barre d'état sera masquée", + "appearance18": "Configurer l'interrupteur des messages de la barre d'état", "min": "Min", "restore": "Restaurer", "max": "Max", diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json index 937928175..21d9fd28d 100644 --- a/app/appearance/langs/he_IL.json +++ b/app/appearance/langs/he_IL.json @@ -1119,8 +1119,9 @@ "appearance1": "ערכת נושא לקוד", "appearance10": "הגדרות כפתור סגירה", "appearance11": "נמוך למגש לאחר לחיצה על כפתור הסגירה", - "appearance16": "הסתר את שורת המצב התחתונה", - "appearance17": "הסתר את שורת המצב בתחתית הדסקטופ כאשר אפשרות זו מופעלת", + "appearance16": "שורת המצב התחתונה", + "appearance17": "כאשר מופעל, שורת המצב תוסתר", + "appearance18": "הגדר את מתג ההודעות של שורת המצב", "min": "מינ", "restore": "שחזר", "max": "מקס", diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json index 1b7823d9f..afbb3538d 100644 --- a/app/appearance/langs/it_IT.json +++ b/app/appearance/langs/it_IT.json @@ -1119,8 +1119,9 @@ "appearance1": "Tema del blocco di codice", "appearance10": "Impostazioni del pulsante di chiusura", "appearance11": "Riduci a icona dopo aver cliccato sul pulsante di chiusura", - "appearance16": "Nascondi barra di stato inferiore", - "appearance17": "Nascondi la barra di stato in basso sul desktop quando abilitato", + "appearance16": "Barra di stato inferiore", + "appearance17": "Quando abilitato, la barra di stato verrà nascosta", + "appearance18": "Configura l'interruttore dei messaggi della barra di stato", "min": "Min", "restore": "Ripristina", "max": "Max", diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json index 5cc3c8a4e..543dfe86f 100644 --- a/app/appearance/langs/ja_JP.json +++ b/app/appearance/langs/ja_JP.json @@ -1119,8 +1119,9 @@ "appearance1": "コードブロックのテーマ", "appearance10": "閉じるボタン", "appearance11": "閉じるボタンをクリックするとタスクトレイに格納する", - "appearance16": "ステータスバー", - "appearance17": "ステータスバーを表示しない", + "appearance16": "下部ステータスバー", + "appearance17": "有効にするとステータスバーが非表示になります", + "appearance18": "ステータスバーのメッセージスイッチを設定", "min": "最小化", "restore": "元のサイズ", "max": "最大化", diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json index a1cc22310..0e577c5d6 100644 --- a/app/appearance/langs/pl_PL.json +++ b/app/appearance/langs/pl_PL.json @@ -1119,8 +1119,9 @@ "appearance1": "Motyw bloku kodu", "appearance10": "Ustawienia przycisku zamykania", "appearance11": "zmniejsz do zasobnika po kliknięciu przycisku zamykania", - "appearance16": "Ukryj dolny pasek stanu", - "appearance17": "Ukryj pasek stanu u dołu pulpitu, gdy jest włączony", + "appearance16": "Dolny pasek stanu", + "appearance17": "Po włączeniu pasek stanu zostanie ukryty", + "appearance18": "Skonfiguruj przełącznik wiadomości paska stanu", "min": "Min", "restore": "Przywróć", "max": "Max", diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json index 67a7fd301..e18a08b60 100644 --- a/app/appearance/langs/pt_BR.json +++ b/app/appearance/langs/pt_BR.json @@ -1119,8 +1119,9 @@ "appearance1": "Tema do Bloco de Código", "appearance10": "Configurações do botão fechar", "appearance11": "minimizar para a bandeja após clicar no botão fechar", - "appearance16": "Ocultar barra de status inferior", - "appearance17": "Oculta a barra de status na parte inferior da área de trabalho quando ativado", + "appearance16": "Barra de status inferior", + "appearance17": "Ao ativar, a barra de status será ocultada", + "appearance18": "Configurar o interruptor de mensagens da barra de status", "min": "Mín", "restore": "Restaurar", "max": "Máx", diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json index 22d619616..d1674e3bd 100644 --- a/app/appearance/langs/ru_RU.json +++ b/app/appearance/langs/ru_RU.json @@ -1119,8 +1119,9 @@ "appearance1": "Тема блока кода", "appearance10": "Настройки кнопки закрытия", "appearance11": "Свернуть в трей после нажатия на кнопку закрытия", - "appearance16": "Скрыть нижнюю строку состояния", - "appearance17": "Скрыть строку состояния внизу рабочего стола при включении", + "appearance16": "Нижняя панель состояния", + "appearance17": "После включения панель состояния будет скрыта", + "appearance18": "Настройка переключателя сообщений панели состояния", "min": "Минимум", "restore": "Восстановить", "max": "Максимум", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 74a3e17ed..a44d8a614 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1119,8 +1119,9 @@ "appearance1": "代碼塊主題", "appearance10": "關閉按鈕設置", "appearance11": "點擊關閉按鈕後縮小到託盤中", - "appearance16": "隱藏底部狀態欄", - "appearance17": "啟用後將隱藏桌面端底部狀態欄", + "appearance16": "底部狀態欄", + "appearance17": "啟用後將隱藏狀態欄", + "appearance18": "配置狀態欄消息開關", "min": "最小化", "restore": "向下還原", "max": "最大化", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index a34904e8b..8eeab564e 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1119,8 +1119,9 @@ "appearance1": "代码块主题", "appearance10": "关闭按钮设置", "appearance11": "点击关闭按钮后缩小到托盘中", - "appearance16": "隐藏底部状态栏", - "appearance17": "启用后将隐藏桌面端底部状态栏", + "appearance16": "底部状态栏", + "appearance17": "启用后将隐藏状态栏", + "appearance18": "配置状态栏消息开关", "min": "最小化", "restore": "向下还原", "max": "最大化", diff --git a/kernel/conf/appearance.go b/kernel/conf/appearance.go index ebd1002ac..8be9e428a 100644 --- a/kernel/conf/appearance.go +++ b/kernel/conf/appearance.go @@ -16,6 +16,8 @@ package conf +import "github.com/siyuan-note/siyuan/kernel/util" + type Appearance struct { Mode int `json:"mode"` // 模式:0:明亮,1:暗黑 ModeOS bool `json:"modeOS"` // 模式是否跟随系统 @@ -33,6 +35,7 @@ type Appearance struct { ThemeJS bool `json:"themeJS"` // 是否启用了主题 JavaScript CloseButtonBehavior int `json:"closeButtonBehavior"` // 关闭按钮行为,0:退出,1:最小化到托盘 HideStatusBar bool `json:"hideStatusBar"` // 是否隐藏底部状态栏 + StatusBar *util.StatusBar `json:"statusBar"` // 底部状态栏配置 } func NewAppearance() *Appearance { @@ -47,6 +50,7 @@ func NewAppearance() *Appearance { Lang: "en_US", CloseButtonBehavior: 0, HideStatusBar: false, + StatusBar: &util.StatusBar{}, } } diff --git a/kernel/model/conf.go b/kernel/model/conf.go index b73aa52c4..920ec1f77 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -203,6 +203,10 @@ func InitConf() { if "" == Conf.Appearance.CodeBlockThemeLight { Conf.Appearance.CodeBlockThemeLight = "github" } + if nil == Conf.Appearance.StatusBar { + Conf.Appearance.StatusBar = &util.StatusBar{} + } + util.StatusBarCfg = Conf.Appearance.StatusBar if nil == Conf.FileTree { Conf.FileTree = conf.NewFileTree() } diff --git a/kernel/task/queue.go b/kernel/task/queue.go index d1e07d846..2eb1d7915 100644 --- a/kernel/task/queue.go +++ b/kernel/task/queue.go @@ -189,6 +189,13 @@ func StatusJob() { } count[action]++ + if action == HistoryDatabaseIndexCommit && util.StatusBarCfg.MsgTaskHistoryDatabaseIndexCommitDisabled { + continue + } + if action == AssetContentDatabaseIndexCommit && util.StatusBarCfg.MsgTaskAssetDatabaseIndexCommitDisabled { + continue + } + if nil != actionLangs { if label := actionLangs[task.Action]; nil != label { action = label.(string) diff --git a/kernel/util/statusbar.go b/kernel/util/statusbar.go new file mode 100644 index 000000000..cda8b84e8 --- /dev/null +++ b/kernel/util/statusbar.go @@ -0,0 +1,25 @@ +// SiYuan - Refactor your thinking +// Copyright (c) 2020-present, b3log.org +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package util + +// StatusBar 底部状态栏配置。https://github.com/siyuan-note/siyuan/issues/16236 +type StatusBar struct { + MsgTaskHistoryDatabaseIndexCommitDisabled bool `json:"msgTaskHistoryDatabaseIndexCommitDisabled"` + MsgTaskAssetDatabaseIndexCommitDisabled bool `json:"msgTaskAssetDatabaseIndexCommitDisabled"` +} + +var StatusBarCfg *StatusBar