Add files components 406-420; Tree opens to a known choice
Fifteen file components: FileExplorer, FileGrid, FileIcon, PathBar, MemoryCard, DiskUsage, UploadQueue, Trash, RecentFiles, FilePreview, ArchiveViewer, FileDetails, SharePanel, SyncStatus and QuotaMeter. FileIcon draws six kinds as hand-placed 12x12 pages and a folder. The browsers build on data.Tree, List, GridView and Table; ArchiveViewer owns its sort and keeps the caller's index on its entry. UploadQueue keys rows by name so focus stays on its row. SharePanel never logs the link. SyncStatus turns its arrows on Busy steps, so syncing moves under Reduce Motion. data.Tree now opens the closed branches above a chosen path it knows, so a caller's starting path survives the first frame.
This commit is contained in:
30 files changed
+2416
-2
No files matched your search
@@ -38,3 +38,14 @@ func TestTreeDrawsValuesInTheirSlot(t *testing.T) {
|
||||
t.Fatalf("choosing hp (%q) did not swap which value is inked", sel)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTreeRevealsAChoiceInAClosedBranch(t *testing.T) {
|
||||
// Ether sits in Bag, which starts closed.
|
||||
sel := "0/1"
|
||||
tt := view(400, 300, newClock(), false, func(c *ui.Context) {
|
||||
data.Tree(c, "Items", bag, &sel, data.TreeOptions{})
|
||||
})
|
||||
if r := find(t, tt, "Items"); sel != "0/1" || r.H != 4*2*pixel.LineHeight {
|
||||
t.Fatalf("the choice became %q in %v, want Bag opened on Ether", sel, r)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user