add button to Advanced settings tab to clear caches

This commit is contained in:
Drew Weymouth
2025-11-07 19:48:09 -08:00
parent 360391e832
commit 0ff57513c2
6 changed files with 34 additions and 5 deletions
+9
View File
@@ -38,6 +38,7 @@ type SettingsDialog struct {
OnDismiss func()
OnEqualizerSettingsChanged func()
OnPageNeedsRefresh func()
OnClearCaches func()
config *backend.Config
audioDevices []mpv.AudioDevice
@@ -610,10 +611,18 @@ func (s *SettingsDialog) createAdvancedTab() *container.TabItem {
}
percentEntry.Text = strconv.Itoa(s.config.Application.MaxImageCacheSizeMB)
clearCaches := widget.NewButton(lang.L("Clear caches"), func() {
if s.OnClearCaches != nil {
s.OnClearCaches()
}
})
imgCacheCfg := container.NewHBox(
widget.NewLabel(lang.L("Maximum image cache size")),
percentEntry,
widget.NewLabel("MB"),
layout.NewSpacer(),
clearCaches,
)
osMediaAPIs := widget.NewCheck(lang.L("Enable OS media player integration"), func(b bool) {