Skip to content

Commit

Permalink
✨ feat: 增加设置,决定是否高亮预约侧边栏 icon
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Apr 1, 2024
1 parent 15ba799 commit 1f8d319
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/setting-gui.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
name: "RetvType",
type: "select",
},
{
name: "HighlightResv",
type: "checkbox"
}
]
};
Expand Down
3 changes: 3 additions & 0 deletions src/func/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export class RoutineEventHandler {
* 如果今天有预约,就在 head 中插入特殊的样式
*/
public updateResvIconStyle() {
const HighlightResv = settings.get('HighlightResv');
if (!HighlightResv) return;

if (reservation.isTodayReserved()) {
updateStyleSheet(`
span[data-type="siyuan-dailynote-todaydock_tab"][data-title="${this.plugin.i18n.DockReserve.arial}"] {
Expand Down
1 change: 1 addition & 0 deletions src/global-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class SettingManager {
ResvEmbedAt: 'top' as RetvPosition, //Retrieved 块嵌入位置
RetvType: 'embed' as RetvType, //Retrieved 块的类型
NotebookBlacklist: {}, //笔记本黑名单
HighlightResv: true as boolean, //高亮显示预约块
};

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type SettingKey = (
'PluginVersion' | "EnableMove" | 'EnableReserve' |
"ExpandGutterMenu" | 'PopupReserveDialog' | 'ResvEmbedAt' |
'RetvType' | 'EnableResvDock' | 'DisableAutoCreateOnMobile' |
'NotebookBlacklist' | 'AutoOpenAfterSync'
'NotebookBlacklist' | 'AutoOpenAfterSync' | 'HighlightResv';
);

interface ISettingItem {
Expand Down

0 comments on commit 1f8d319

Please sign in to comment.