fix(uxassist): respect blueprint text and icon bounds

Account for the native background's trimmed border, keep checkbox captions independently sized, and place Auto-fill after the measured title while reserving the native icon. Limit changes to owned controls.

Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
soarqin committed 2026-11-05 11:41:51 +08:00
1 parent 51af1430bc
commit 19d19ce38d
4 files changed
+108 -40

No files matched your search

+2 -2
View File
@@ -70,9 +70,9 @@ Native research uses the current lab technology's matrix point requirements, wit
## Blueprint descriptions
The shared `UIBlueprintInspector` in browser, copy, and paste modes adds a compact `Auto-fill` entry to the existing description header. Its options panel is an owned child of `inspector.rectTrans`, outside the scroll mask. On opening, actual entry corners and root-canvas bounds are converted into that parent's coordinates. The private placement method in `InspectorControls` prefers a position below the entry with their right edges aligned, flips above when needed, and clamps against canvas bounds; a panel too large for those bounds is closed. A `Canvas.willRenderCanvases` subscription follows the entry after native layout and scrolling only while the options are open; hiding the entry or scrolling it completely outside its viewport closes the popup. Native fields, groups, anchors, and scroll height remain owned by the game. Closing, disabling, and destruction unsubscribe the positioning callback and remove only owned controls as appropriate.
The shared `UIBlueprintInspector` in browser, copy, and paste modes adds a compact `Auto-fill` entry after the measured native description title, with an 8-pixel gap. Reserve the actual native icon button's bounds and another 8-pixel gap even when that icon is inactive; hide the owned entry if it cannot fit. Its options panel is an owned child of `inspector.rectTrans`, outside the scroll mask. On opening, actual entry corners and root-canvas bounds are converted into that parent's coordinates. The private placement method in `InspectorControls` prefers a position below the entry with their right edges aligned, flips above when needed, and clamps against canvas bounds; a panel too large for those bounds is closed. A `Canvas.willRenderCanvases` subscription follows the entry after native layout and scrolling only while the options are open; hiding the entry or scrolling it completely outside its viewport closes the popup. Native fields, groups, anchors, and scroll height remain owned by the game. Closing, disabling, and destruction unsubscribe the positioning callback and remove only owned controls as appropriate.
The options use a title and the actual native X subtree, then a 20-pixel proliferation checkbox row, a 28-pixel production-basis row with help, and one 30-pixel `Generate` action at the lower right. Width is measured from the localized labels and choices. The normal 154-pixel panel gains 54 pixels when the two 24-pixel dropdown rows open, moving the footer below the list. The cloned X must receive a new `Button.ButtonClickedEvent`: its source has a persistent callback to the original inserter window that `RemoveAllListeners` does not remove.
The options use a title and the actual native X subtree, followed by proliferation, production basis with help, and one `Generate` action at the lower right. Content margins start inside the sliced background's visible fill: add `DataUtility.GetPadding(sprite) / image.pixelsPerUnit` to the desired gaps. Keep the 20-pixel checkbox independent of its label's height, at least 26 pixels or preferred glyph height plus padding, with vertical overflow allowed and an 8-pixel horizontal gap. Owned button and combo captions disable inherited best-fit sizing and have explicit text insets. Localized preferred sizes determine row, item, button, and panel dimensions; the footer follows the selector and its expanded list instead of a fixed panel height. The cloned X must receive a new `Button.ButtonClickedEvent`: its source has a persistent callback to the original inserter window that `RemoveAllListeners` does not remove.
The production-basis selector clones the star-detail combo. Disable and remove the clone root's inherited `Localizer` before assigning owned dimensions: that source component writes a star-panel-specific width on enable and language changes. Turn off the clone's `UIComboBox.autoWidth` before populating items, stretch its main button within the owned root, and align its selected and template text to the left. Preserve the native dropdown, content, item-template, and selection anchors; native `UIComboBox.SetState` controls row heights and the native row event selects an item before closing the list. These adjustments belong to this selector rather than the shared combo helper.