Add search (Ctrl+F, wildcards, match case/whole word) and sort, both off by default

This commit is contained in:
sarah committed 2026-09-29 19:59:02 +02:00
1 parent 6c48796dde
commit 1c2acf3f16
5 files changed
+249 -5

No files matched your search

+19
View File
@@ -159,6 +159,12 @@ def BuildSettingsDialog(
label="Open text/config/markup files in SaraFem's own viewer, not your default app",
value=Config.OpenFilesInApp,
)
ShowSearchSwitch = ft.Switch(label="Enable search (Ctrl+F)", value=Config.ShowSearch)
SearchAlwaysVisibleSwitch = ft.Switch(
label="Always show the search bar (off = only on Ctrl+F, Escape to dismiss)",
value=Config.SearchAlwaysVisible,
)
ShowSortSwitch = ft.Switch(label="Enable sort control in the sidebar", value=Config.ShowSort)
BatchRenamePatternField = ft.TextField(
value=Config.BatchRenamePattern,
label="Batch rename pattern (~ = name, ! = counter, ^ = extension)",
@@ -394,6 +400,16 @@ def BuildSettingsDialog(
spacing=12,
scroll=ft.ScrollMode.AUTO,
),
"Search & Sort": ft.Column(
[
ShowSearchSwitch,
SearchAlwaysVisibleSwitch,
ft.Divider(height=1, color=Palette.Surface1),
ShowSortSwitch,
_SectionLabel('The sort control ("[Sort: Name] v") sits above Bookmarks in the sidebar.'),
],
spacing=12,
),
"SaraTag": ft.Column([SaraTagSwitch, SaraTagPathField], spacing=12),
"SaraSortd": ft.Column(
[
@@ -456,6 +472,9 @@ def BuildSettingsDialog(
).Save()
Config.ShowDotfiles = DotfilesSwitch.value
Config.OpenFilesInApp = OpenFilesInAppSwitch.value
Config.ShowSearch = ShowSearchSwitch.value
Config.SearchAlwaysVisible = SearchAlwaysVisibleSwitch.value
Config.ShowSort = ShowSortSwitch.value
Config.BatchRenamePattern = BatchRenamePatternField.value.strip() or "~!^"
Config.DeleteZipAfterExtract = DeleteZipSwitch.value
Config.DefaultArchiveFormat = GetArchiveFormat()