The manager that holds widgets is the WidgetManager
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
UIManager named the category, not the contents. Every other manager is named after what it registers — ItemManager holds Items, SceneManager holds Scenes — so the one that registers Widgets is the WidgetManager. The alias, the Game field and both manual pages move together. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -1,12 +1,12 @@
|
||||
package inkwell
|
||||
|
||||
// UIManager registers Widget instances. Same shape as every other manager.
|
||||
type UIManager = Manager[Widget]
|
||||
// WidgetManager registers Widget instances. Same shape as every other manager.
|
||||
type WidgetManager = Manager[Widget]
|
||||
|
||||
// reversedWidgets iterates a manager's contents in reverse registration
|
||||
// order — used by the engine for top-down input dispatch (the widget
|
||||
// drawn on top gets the click first).
|
||||
func reversedWidgets(m *UIManager) []Widget {
|
||||
func reversedWidgets(m *WidgetManager) []Widget {
|
||||
all := m.All()
|
||||
out := make([]Widget, len(all))
|
||||
for i, w := range all {
|
||||
@@ -16,4 +16,4 @@ func reversedWidgets(m *UIManager) []Widget {
|
||||
}
|
||||
|
||||
// orderedWidgets iterates in registration order — bottom-up draw.
|
||||
func orderedWidgets(m *UIManager) []Widget { return m.All() }
|
||||
func orderedWidgets(m *WidgetManager) []Widget { return m.All() }
|
||||
|
||||
Reference in New Issue
Block a user