New/Upload buttons with the file tree, above or below

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
sarahandClaude Opus 5.5 committed 2026-10-13 17:10:21 +02:00
1 parent 6750f7927f
commit 0450fee42b
6 files changed
+27 -100

No files matched your search

+11 -4
View File
@@ -124,15 +124,22 @@ class Filetree(ft.Container):
self.PathNodes: list[_FiletreeNode] = [] # the directories you're in, marked
self.TreeList = ft.ListView(expand=True)
self.SourceLabel = ft.Text("", size=12, color=Palette.Overlay0, overflow=ft.TextOverflow.ELLIPSIS, max_lines=1)
self.Header = ft.Container(self.SourceLabel, padding=ft.Padding.only(left=12, right=12, top=10, bottom=4))
self.Layout = ft.Column([self.Header, self.TreeList], spacing=0, expand=True)
super().__init__(
content=ft.Column([
ft.Container(self.SourceLabel, padding=ft.Padding.only(left=12, right=12, top=10, bottom=4)),
self.TreeList,
], spacing=0, expand=True),
content=self.Layout,
width=TheApp.Config.SidebarWidth,
bgcolor=Palette.Mantle,
)
def SetEntryButtons(self, Buttons: ft.Control, AtTop: bool, Update: bool = True) -> None:
"""New File / New Directory / Upload, above or below the tree (Config.NewEntryButtonsAtTop)."""
Divider = ft.Divider(height=1, color=Palette.Surface1)
self.Layout.controls = ([self.Header, Buttons, Divider, self.TreeList] if AtTop
else [self.Header, self.TreeList, Divider, Buttons])
if Update:
self.update()
def Reload(self) -> None:
"""Rebuilds the tree from the current source (after connecting,
logging in or out, or a change that moved things around)."""