mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-05 04:10:16 +01:00
🎨 Support configuring the floating window hover trigger delay (#17123)
* 🎨 Support configuring the floating window hover trigger delay * 🎨 Support configuring the floating window hover trigger delay
This commit is contained in:
parent
ec4424265a
commit
2739def842
22 changed files with 82 additions and 2 deletions
|
|
@ -317,6 +317,13 @@ func setEditor(c *gin.Context) {
|
|||
editor.HistoryRetentionDays = 3650
|
||||
}
|
||||
|
||||
if nil == editor.FloatWindowDelay {
|
||||
v := 620
|
||||
editor.FloatWindowDelay = &v
|
||||
} else {
|
||||
*editor.FloatWindowDelay = max(0, min(10000, *editor.FloatWindowDelay))
|
||||
}
|
||||
|
||||
oldVirtualBlockRef := model.Conf.Editor.VirtualBlockRef
|
||||
oldVirtualBlockRefInclude := model.Conf.Editor.VirtualBlockRefInclude
|
||||
oldVirtualBlockRefExclude := model.Conf.Editor.VirtualBlockRefExclude
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ type Editor struct {
|
|||
ListLogicalOutdent bool `json:"listLogicalOutdent"` // 列表逻辑反向缩进
|
||||
ListItemDotNumberClickFocus bool `json:"listItemDotNumberClickFocus"` // 单击列表项标记聚焦
|
||||
FloatWindowMode int `json:"floatWindowMode"` // 浮窗触发模式,0:光标悬停,1:按住 Ctrl 悬停,2:不触发浮窗
|
||||
FloatWindowDelay *int `json:"floatWindowDelay"` // 浮窗悬停触发延迟,单位:毫秒,默认 620,nil 表示未设置
|
||||
DynamicLoadBlocks int `json:"dynamicLoadBlocks"` // 块动态数,可配置区间 [48, 1024]
|
||||
Justify bool `json:"justify"` // 是否两端对齐
|
||||
RTL bool `json:"rtl"` // 是否从右到左显示
|
||||
|
|
@ -87,6 +88,7 @@ func NewEditor() *Editor {
|
|||
ListLogicalOutdent: false,
|
||||
ListItemDotNumberClickFocus: true,
|
||||
FloatWindowMode: 0,
|
||||
FloatWindowDelay: func() *int { v := 620; return &v }(),
|
||||
DynamicLoadBlocks: 192,
|
||||
Justify: false,
|
||||
RTL: false,
|
||||
|
|
|
|||
|
|
@ -292,6 +292,12 @@ func InitConf() {
|
|||
if 3650 < Conf.Editor.HistoryRetentionDays {
|
||||
Conf.Editor.HistoryRetentionDays = 3650
|
||||
}
|
||||
if nil == Conf.Editor.FloatWindowDelay {
|
||||
v := 620
|
||||
Conf.Editor.FloatWindowDelay = &v
|
||||
} else {
|
||||
*Conf.Editor.FloatWindowDelay = max(0, min(10000, *Conf.Editor.FloatWindowDelay))
|
||||
}
|
||||
if conf.MinDynamicLoadBlocks > Conf.Editor.DynamicLoadBlocks {
|
||||
Conf.Editor.DynamicLoadBlocks = conf.MinDynamicLoadBlocks
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue