From 42380911a90d831cb29b23726950d490a7f111d7 Mon Sep 17 00:00:00 2001 From: ErikKalkoken Date: Fri, 25 Oct 2024 20:57:31 +0200 Subject: [PATCH] Replace checkbox with toggle in settings --- internal/ui/settings.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ui/settings.go b/internal/ui/settings.go index 50604f6..ea3fb02 100644 --- a/internal/ui/settings.go +++ b/internal/ui/settings.go @@ -26,17 +26,17 @@ func (u *UI) showSettingsDialog() { } // apply file filter - extFilter := widget.NewCheck("enabled", func(v bool) { + extFilter := kxwidget.NewToggle(func(v bool) { u.app.Preferences().SetBool(settingExtensionFilter, v) }) y := u.app.Preferences().BoolWithFallback(settingExtensionFilter, settingExtensionDefault) - extFilter.SetChecked(y) + extFilter.SetState(y) - notifyUpdates := widget.NewCheck("enabled", func(v bool) { + notifyUpdates := kxwidget.NewToggle(func(v bool) { u.app.Preferences().SetBool(settingNotifyUpdates, v) }) z := u.app.Preferences().BoolWithFallback(settingNotifyUpdates, settingNotifyUpdatesDefault) - notifyUpdates.SetChecked(z) + notifyUpdates.SetState(z) items := []*widget.FormItem{ {Text: "Max recent files", Widget: recentEntry, HintText: "Maximum number of recent files remembered"},