mirror of
https://git.srhtnin.garden/sarah/SaraFem.git
synced 2026-10-15 02:23:17 +02:00
List view metadata columns and drag-to-resize everywhere
- New optional list-view columns: Description, Size (now includes directories), Modified, Owner, Created (via statx birth time), Content (item/line count or image dimensions), Access (rwx) - Drag-to-resize: list view column headers, sidebar sections (Bookmarks/ Devices/Filetree), Preview/Tags split, and the sidebar/preview side panels themselves — all commit to Config on release, not per drag frame - Column resizing mutates existing row cells live instead of rebuilding, with metadata cached per (file, mtime) — fixes lag in large folders - Fix list view background click (rows were full ListTile width with no empty space to click); bookmark selected-background now covers the triple-dot menu too; batch rename/new-file dialogs pre-select their default text instead of just pre-filling it - Toolbar scrolls instead of clipping when buttons don't fit; toolbar and breadcrumbs are independently toggleable - Add a "Server" bookmark icon Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
a5f5c5ca79
commit
31b6c554e6
6 files changed
+699
-89
No files matched your search
+54
-1
@@ -17,7 +17,7 @@ from Core import (
|
||||
# Settings Browser can already hot-apply live (dotfiles, breadcrumbs, preview, tags).
|
||||
# The window title bar, sidebar (bookmarks/filetree) layout, theme, and SaraTag's
|
||||
# dynamically-loaded module need a restart to take effect.
|
||||
RestartRequiredNote = "Window title bar, Theme, Font, Sidebar and SaraTag settings need a restart to take effect."
|
||||
RestartRequiredNote = "Window title bar, Theme, Font and SaraTag settings need a restart to take effect."
|
||||
|
||||
DialogWidth = 700
|
||||
DialogHeight = 520
|
||||
@@ -91,6 +91,27 @@ def BuildSettingsDialog(
|
||||
SharedFontDropdown = FontPicker(Shared.FontFamily)
|
||||
SharedTitleBarSwitch = ft.Switch(label="Hide window title bar", value=Shared.HideWindowTitleBar)
|
||||
|
||||
# "Middle" tab: the main file-list pane itself, not the panels around it.
|
||||
ViewModePicker, GetViewMode = _OptionPicker(
|
||||
[("list", "List", "VIEW_LIST_OUTLINED"), ("grid", "Grid", "GRID_VIEW_OUTLINED")], Config.ViewMode
|
||||
)
|
||||
ListDescriptionSwitch = ft.Switch(label="Description", value=Config.ListShowDescription)
|
||||
ListSizeSwitch = ft.Switch(label="Size", value=Config.ListShowSize)
|
||||
ListModifiedSwitch = ft.Switch(label="Modified", value=Config.ListShowModified)
|
||||
ListOwnerSwitch = ft.Switch(label="Owner", value=Config.ListShowOwner)
|
||||
ListCreatedSwitch = ft.Switch(label="Created", value=Config.ListShowCreated)
|
||||
ListContentSwitch = ft.Switch(
|
||||
label="Content (item count / line count / image size)", value=Config.ListShowContent
|
||||
)
|
||||
ListAccessSwitch = ft.Switch(label="Access (rwx)", value=Config.ListShowAccess)
|
||||
GridIconSizeField = ft.TextField(
|
||||
value=str(Config.GridIconSize), label="Grid icon size", keyboard_type=ft.KeyboardType.NUMBER
|
||||
)
|
||||
GridNamePositionPicker, GetGridNamePosition = _OptionPicker(
|
||||
[("below", "Below", "SOUTH"), ("above", "Above", "NORTH")],
|
||||
"below" if Config.GridNameBelowIcon else "above",
|
||||
)
|
||||
|
||||
# SaraFem's own values ("General" tab), only used with shared settings off.
|
||||
ThemeDropdown = ThemePicker(Config.Theme)
|
||||
FontDropdown = FontPicker(Config.FontFamily)
|
||||
@@ -234,6 +255,28 @@ def BuildSettingsDialog(
|
||||
spacing=12,
|
||||
scroll=ft.ScrollMode.AUTO,
|
||||
),
|
||||
"Middle": ft.Column(
|
||||
[
|
||||
_SectionLabel("View"),
|
||||
ViewModePicker,
|
||||
ft.Divider(height=1, color=Palette.Surface1),
|
||||
_SectionLabel("List columns (besides Name)"),
|
||||
ListDescriptionSwitch,
|
||||
ListSizeSwitch,
|
||||
ListModifiedSwitch,
|
||||
ListOwnerSwitch,
|
||||
ListCreatedSwitch,
|
||||
ListContentSwitch,
|
||||
ListAccessSwitch,
|
||||
ft.Divider(height=1, color=Palette.Surface1),
|
||||
_SectionLabel("Grid"),
|
||||
GridIconSizeField,
|
||||
_SectionLabel("Name position"),
|
||||
GridNamePositionPicker,
|
||||
],
|
||||
spacing=12,
|
||||
scroll=ft.ScrollMode.AUTO,
|
||||
),
|
||||
"Toolbar": ft.Column(
|
||||
[
|
||||
ToolbarSwitch,
|
||||
@@ -326,6 +369,15 @@ def BuildSettingsDialog(
|
||||
)
|
||||
|
||||
def DoSave(e=None) -> None:
|
||||
Config.ViewMode = GetViewMode()
|
||||
Config.ListShowDescription = ListDescriptionSwitch.value
|
||||
Config.ListShowSize = ListSizeSwitch.value
|
||||
Config.ListShowModified = ListModifiedSwitch.value
|
||||
Config.ListShowOwner = ListOwnerSwitch.value
|
||||
Config.ListShowCreated = ListCreatedSwitch.value
|
||||
Config.ListShowContent = ListContentSwitch.value
|
||||
Config.ListShowAccess = ListAccessSwitch.value
|
||||
Config.GridNameBelowIcon = GetGridNamePosition() == "below"
|
||||
Config.UseSharedSettings = UseSharedSwitch.value
|
||||
Config.Theme = ThemeDropdown.value
|
||||
Config.FontFamily = FontDropdown.value or Config.FontFamily
|
||||
@@ -384,6 +436,7 @@ def BuildSettingsDialog(
|
||||
(TagMaxWidthField, "TagMaxWidth"),
|
||||
(TagPanelMinHeightField, "TagPanelMinHeight"),
|
||||
(TagPanelMaxHeightField, "TagPanelMaxHeight"),
|
||||
(GridIconSizeField, "GridIconSize"),
|
||||
):
|
||||
try:
|
||||
setattr(Config, TargetAttr, int(Field.value))
|
||||
|
||||
Reference in new issue
Block a user