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
+1
-1
@@ -25,7 +25,7 @@ type BidTickerOptions struct {
|
||||
}
|
||||
|
||||
// BidTicker lists bids, newest first, crowning the highest.
|
||||
func BidTicker(c *ui.Context, text string, bids []Bid, o BidTickerOptions) *ui.Element {
|
||||
func BidTicker(c *ui.Context, text string, bids []Bid, o BidTickerOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
top := -1
|
||||
for i, b := range bids {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ type CartOptions struct {
|
||||
}
|
||||
|
||||
type CartResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Changed bool
|
||||
// Removed is the line whose ✕ was pressed, else -1.
|
||||
Removed int
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ type CheckoutOptions struct {
|
||||
}
|
||||
|
||||
type CheckoutResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Done reports the order placed this frame.
|
||||
Changed, Done bool
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ type CouponOptions struct {
|
||||
}
|
||||
|
||||
type CouponResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Copied bool
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ type CurrencyConvertOptions struct {
|
||||
}
|
||||
|
||||
type CurrencyConvertResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Converted is the gems bought this frame.
|
||||
Converted int
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ type DailyRewardOptions struct {
|
||||
}
|
||||
|
||||
type DailyRewardResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Claimed bool
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ type PriceTagOptions struct {
|
||||
}
|
||||
|
||||
// PriceTag is a coin and amount; sales strike the old.
|
||||
func PriceTag(c *ui.Context, price int, o PriceTagOptions) *ui.Element {
|
||||
func PriceTag(c *ui.Context, price int, o PriceTagOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
sp, word := coin(k, o.Currency)
|
||||
now, was := amount("PriceTag", price), amount("PriceTag Was", o.Was)
|
||||
|
||||
@@ -23,7 +23,7 @@ type PricingTiersOptions struct {
|
||||
}
|
||||
|
||||
type PricingTiersResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Changed bool
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ func PricingTiers(c *ui.Context, text string, tiers [3]Tier, chosen *int, o Pric
|
||||
name, price := k.Msg(metals[i]), strconv.Itoa(t.Price)
|
||||
sel := *chosen
|
||||
// The shell draws the card; the radio stays bare.
|
||||
shell, base, st := pixel.Shell(c, func() *ui.Element {
|
||||
shell, base, st := pixel.Shell(c, func() ui.Element {
|
||||
return ui.RadioBase(c, &sel, i).Label(name + ", " + price + " " + word).Disabled(o.Disabled)
|
||||
})
|
||||
// The radio picks before it is told it is off.
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ type QuantityOptions struct {
|
||||
}
|
||||
|
||||
type QuantityResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Changed bool
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func Quantity(c *ui.Context, text string, value *int, o QuantityOptions) Quantit
|
||||
if lo < 0 || hi < lo || *value < lo || *value > hi {
|
||||
panic(fmt.Sprintf("shop: Quantity %d outside %d to %d", *value, lo, hi))
|
||||
}
|
||||
shell, base, st := pixel.Shell(c, func() *ui.Element {
|
||||
shell, base, st := pixel.Shell(c, func() ui.Element {
|
||||
return ui.Box(c).Focusable().Role(ui.RoleStepper).Label(text).Disabled(o.Disabled)
|
||||
})
|
||||
old, nw := *value, pixel.Measure(strconv.Itoa(hi))+6
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ type ReceiptOptions struct {
|
||||
}
|
||||
|
||||
// Receipt prints lines dot-matrix style, perforated down the sides.
|
||||
func Receipt(c *ui.Context, shop string, lines []ReceiptLine, o ReceiptOptions) *ui.Element {
|
||||
func Receipt(c *ui.Context, shop string, lines []ReceiptLine, o ReceiptOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
if shop == "" {
|
||||
panic("shop: Receipt has no shop name")
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ var (
|
||||
)
|
||||
|
||||
// SaleBadge is a SALE -n% starburst whose rim flashes.
|
||||
func SaleBadge(c *ui.Context, percent int, o SaleBadgeOptions) *ui.Element {
|
||||
func SaleBadge(c *ui.Context, percent int, o SaleBadgeOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
if percent < 1 || percent > 99 {
|
||||
panic(fmt.Sprintf("shop: SaleBadge of %d%%", percent))
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ func amount(name string, n int) string {
|
||||
}
|
||||
|
||||
// money draws a currency icon and amount, named for readers.
|
||||
func money(c *ui.Context, k pixel.Kit, cur Currency, n int, slot pixel.Slot) *ui.Element {
|
||||
func money(c *ui.Context, k pixel.Kit, cur Currency, n int, slot pixel.Slot) ui.Element {
|
||||
sp, word := coin(k, cur)
|
||||
s := amount("money", n)
|
||||
return ui.Box(c).Size(k.D(14+pixel.Measure(s)), k.D(pixel.LineHeight)).Role(ui.RoleText).Label(s + " " + word).Draw(func(p *ui.Painter, r ui.Rect) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ type ShopItemOptions struct {
|
||||
}
|
||||
|
||||
type ShopItemResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Bought bool
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ type TradeWindowOptions struct {
|
||||
}
|
||||
|
||||
type TradeWindowResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
Changed bool
|
||||
// Traded reports both confirms landing this frame.
|
||||
Traded bool
|
||||
|
||||
@@ -26,7 +26,7 @@ type VendingMachineOptions struct {
|
||||
}
|
||||
|
||||
type VendingMachineResult struct {
|
||||
Element *ui.Element
|
||||
Element ui.Element
|
||||
// Vended is the slot dropped this frame, else -1.
|
||||
Vended int
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ type WalletOptions struct {
|
||||
}
|
||||
|
||||
// Wallet shows gold and gem balances that roll on change.
|
||||
func Wallet(c *ui.Context, gold, gems int, o WalletOptions) *ui.Element {
|
||||
func Wallet(c *ui.Context, gold, gems int, o WalletOptions) ui.Element {
|
||||
k := pixel.K(c)
|
||||
g, m := amount("Wallet gold", gold), amount("Wallet gems", gems)
|
||||
_, gw := coin(k, Gold)
|
||||
|
||||
Reference in new issue
Block a user