mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 23:06:09 +01:00
🎨 改进集市已下载包的显示和更新 https://github.com/siyuan-note/siyuan/issues/5807
This commit is contained in:
parent
3473496a43
commit
99fdfd7966
2 changed files with 30 additions and 5 deletions
|
|
@ -49,6 +49,11 @@ func BazaarWidgets() (widgets []*bazaar.Widget) {
|
|||
return
|
||||
}
|
||||
|
||||
func InstalledWidgets() (widgets []*bazaar.Widget) {
|
||||
widgets = bazaar.InstalledWidgets()
|
||||
return
|
||||
}
|
||||
|
||||
func InstallBazaarWidget(repoURL, repoHash, widgetName string) error {
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
|
@ -91,6 +96,14 @@ func BazaarIcons() (icons []*bazaar.Icon) {
|
|||
return
|
||||
}
|
||||
|
||||
func InstalledIcons() (icons []*bazaar.Icon) {
|
||||
icons = bazaar.InstalledIcons()
|
||||
for _, icon := range icons {
|
||||
icon.Current = icon.Name == Conf.Appearance.Icon
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func InstallBazaarIcon(repoURL, repoHash, iconName string) error {
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
|
@ -138,6 +151,14 @@ func BazaarThemes() (ret []*bazaar.Theme) {
|
|||
return
|
||||
}
|
||||
|
||||
func InstalledThemes() (ret []*bazaar.Theme) {
|
||||
ret = bazaar.InstalledThemes()
|
||||
for _, theme := range ret {
|
||||
theme.Current = theme.Name == Conf.Appearance.ThemeDark || theme.Name == Conf.Appearance.ThemeLight
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bool) error {
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
|
@ -197,6 +218,11 @@ func BazaarTemplates() (templates []*bazaar.Template) {
|
|||
return
|
||||
}
|
||||
|
||||
func InstalledTemplates() (templates []*bazaar.Template) {
|
||||
templates = bazaar.InstalledTemplates()
|
||||
return
|
||||
}
|
||||
|
||||
func InstallBazaarTemplate(repoURL, repoHash, templateName string) error {
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue