Upgrade MyGo to v0.5.5
Elements are now pass-scoped value handles: tests that read bounds after a frame bind a ui.Handle. pixel tells frames apart by the build pass's root, since the Tester clock no longer moves on its own. Fix the regressions the upgrade brought: - Clipboard reads in input handlers go through c.Services(). - MyGo notes an overlay's opener after building it, so AutoFocus inside lost it; pixel.AutoFocus focuses through a Handle, and archtest bans the raw call. Dialogs hand the focus back again. - Elements around a press stay hovered: Tooltip tells a press-given focus by focus arriving under the pointer. - The web host moves the Tester clock with real time, at most 500 ms a call, and gives components the real clock. The gallery's source index also accepts CRLF checkouts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1f3d38110e
commit
03e1f91706
532 files changed
+828
-735
No files matched your search
@@ -27,7 +27,7 @@ type ArchiveViewerOptions struct {
|
||||
}
|
||||
|
||||
type ArchiveViewerResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Sorted reports a header click this frame.
|
||||
Changed, Sorted bool
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ type DiskUsageOptions struct {
|
||||
var useSlots = []pixel.Slot{pixel.Info, pixel.Good, pixel.Warn, pixel.Magic, pixel.Bad, pixel.Accent}
|
||||
|
||||
// DiskUsage stacks each use in one bar over a legend.
|
||||
func DiskUsage(c *ui.Context, text string, uses []Use, capacity int64, o DiskUsageOptions) *ui.Element {
|
||||
func DiskUsage(c *ui.Context, text string, uses []Use, capacity int64, o DiskUsageOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
if capacity <= 0 {
|
||||
panic(fmt.Sprintf("files: DiskUsage capacity %d", capacity))
|
||||
|
||||
@@ -16,7 +16,7 @@ type FileDetailsOptions struct {
|
||||
}
|
||||
|
||||
// FileDetails shows a file's icon, name, kind, size and dates.
|
||||
func FileDetails(c *ui.Context, f File, o FileDetailsOptions) *ui.Element {
|
||||
func FileDetails(c *ui.Context, f File, o FileDetailsOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
check("FileDetails", f)
|
||||
return ui.Column(c).Width(k.D(pixel.Or("FileDetails Width", o.Width, 220))).Gap(k.D(6)).Role(ui.RoleGroup).Label(f.Name).Children(func() {
|
||||
|
||||
@@ -26,7 +26,7 @@ type FileExplorerOptions struct {
|
||||
}
|
||||
|
||||
type FileExplorerResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Opened is Enter or a double click on a file.
|
||||
Changed, Opened bool
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ type FileGridOptions struct {
|
||||
}
|
||||
|
||||
type FileGridResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Opened is Enter or a double click on a file.
|
||||
Changed, Opened bool
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ type FileIconOptions struct {
|
||||
}
|
||||
|
||||
// FileIcon draws a kind: a folder or a dog-eared page.
|
||||
func FileIcon(c *ui.Context, kind Kind, o FileIconOptions) *ui.Element {
|
||||
func FileIcon(c *ui.Context, kind Kind, o FileIconOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
ka := look(kind)
|
||||
s := pixel.Or("FileIcon Scale", o.Scale, 1)
|
||||
|
||||
@@ -24,7 +24,7 @@ type FilePreviewOptions struct {
|
||||
type previewKey struct{}
|
||||
|
||||
// FilePreview shows a picture, else text, in a sunken pane.
|
||||
func FilePreview(c *ui.Context, name string, pv Preview, o FilePreviewOptions) *ui.Element {
|
||||
func FilePreview(c *ui.Context, name string, pv Preview, o FilePreviewOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
w, h := pixel.Or("FilePreview W", o.W, 160), pixel.Or("FilePreview H", o.H, 120)
|
||||
return ui.Column(c).Gap(k.D(2)).AlignItems(ui.Start).Role(ui.RoleGroup).Label(name).Children(func() {
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ type MemoryCardOptions struct {
|
||||
}
|
||||
|
||||
type MemoryCardResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Changed bool
|
||||
// Deleted is the block whose DELETE was pressed, else -1.
|
||||
Deleted int
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ type PathBarOptions struct {
|
||||
}
|
||||
|
||||
type PathBarResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Clicked is the folder clicked, else -1.
|
||||
Clicked int
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func PathBar(c *ui.Context, text string, parts []string, o PathBarOptions) PathB
|
||||
})
|
||||
break
|
||||
}
|
||||
shell, base, st := pixel.Shell(c, func() *ui.Element {
|
||||
shell, base, st := pixel.Shell(c, func() ui.Element {
|
||||
return ui.ButtonBase(c).Label(part).Disabled(o.Disabled)
|
||||
})
|
||||
if base.Clicked() {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ var (
|
||||
)
|
||||
|
||||
// QuotaMeter shows storage used as gems filling up.
|
||||
func QuotaMeter(c *ui.Context, text string, used, quota int64, o QuotaMeterOptions) *ui.Element {
|
||||
func QuotaMeter(c *ui.Context, text string, used, quota int64, o QuotaMeterOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
n := pixel.Or("QuotaMeter Gems", o.Gems, 10)
|
||||
if n > 40 || used < 0 || quota <= 0 {
|
||||
|
||||
@@ -18,7 +18,7 @@ type RecentFilesOptions struct {
|
||||
}
|
||||
|
||||
type RecentFilesResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Opened is Enter or a double click on a file.
|
||||
Changed, Opened bool
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ type SharePanelOptions struct {
|
||||
}
|
||||
|
||||
type SharePanelResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Copied, Changed bool
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ var syncs = [...]struct {
|
||||
}
|
||||
|
||||
// SyncStatus is a cloud: synced, syncing (arrows turning) or failed.
|
||||
func SyncStatus(c *ui.Context, state SyncState, o SyncStatusOptions) *ui.Element {
|
||||
func SyncStatus(c *ui.Context, state SyncState, o SyncStatusOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
if state < Synced || state > SyncFailed {
|
||||
panic(fmt.Sprintf("files: SyncStatus state %d", state))
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ type TrashOptions struct {
|
||||
}
|
||||
|
||||
type TrashResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Emptied bool
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ type UploadQueueOptions struct {
|
||||
}
|
||||
|
||||
type UploadQueueResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Canceled is the upload whose ✕ was pressed, else -1.
|
||||
Canceled int
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user