Zuoqiu-Yingyi / siyuan-theme-dark-plus

思源笔记的一款多功能双模式主题 | A multifunctional dual-mode theme of SiYuan Note.
GNU Affero General Public License v3.0
139 stars 14 forks source link

能否隐藏部分图标 #30

Closed jabobian closed 2 years ago

jabobian commented 2 years ago

比较喜欢界面上东西少一点,所以在theme.js中注释掉了一些不常用的js,

新建窗口通过菜单>更多或者快捷键打开就可以满足,所以想隐藏工具栏上的相关图标。但是注释了Windows.js的话,对应功能也就没有了,能否指导一下,只隐藏工具栏上的图标,保留相应的功能。感谢!

Zuoqiu-Yingyi commented 2 years ago

@jabobian 可以在 script/module/config.js 搜索一下 toolbar, 然后使用 custom.js 覆盖一下对应的 toolbar.enable 字段

jabobian commented 2 years ago

custom.js 可以隐藏工具栏,但是快捷键也失效了。不过还可以接受,如果能有快捷键更好。 export var config = { theme: { window: { enable: false } } };

Zuoqiu-Yingyi commented 2 years ago

custom.js 可以隐藏工具栏,但是快捷键也失效了。不过还可以接受,如果能有快捷键更好。 export var config = { theme: { window: { enable: false } } };

注意: 功能开关和工具栏按钮是否显示时两个开关

jabobian commented 2 years ago

工具栏只有enable开关,没有hide开关。工具栏enable:false不会隐藏,只会变灰。

Zuoqiu-Yingyi commented 2 years ago

工具栏只有enable开关,没有hide开关。工具栏enable:false不会隐藏,只会变灰。

那我下个版本添加一个 hide 字段

Zuoqiu-Yingyi commented 2 years ago

工具栏只有enable开关,没有hide开关。工具栏enable:false不会隐藏,只会变灰。

那我下个版本添加一个 display: boolean 字段

jabobian commented 2 years ago

多谢!!!

Zuoqiu-Yingyi commented 2 years ago

feat: 为工具栏按钮添加配置选项 display: boolean 控制是否显示

jabobian commented 2 years ago

需要隐藏新建窗口工具按钮的可以使用

export var config = {
    theme: {
        window: {
        open: {
            panel: {
                toolbar: {
                    display: false
                }
            },
            block: {
                infocus:
                {
                    toolbar: {
                        display: false
                    }
                },          
                outfocus:
                {
                    toolbar: {
                        display: false
                    }
                }

            }
        }
    }
    }
};