Class HorizontalLabelLayout
Restores a horizontal menu option's label after the width measurement clobbered it (the measurement left-anchors and shrinks the label as a side effect). Shared by the runtime layout builder and the editor View Preview so both produce identical horizontal labels.
Inherited Members
Namespace: Serenity.Menu.Infrastructure.Views.Factories
Assembly: Serenity.UnityMenu.Infrastructure.dll
Syntax
public static class HorizontalLabelLayout
Remarks
For simple labeled buttons (SUBMIT/STRING) the label is stretched to fill the button and the text is aligned within it, so LEFT/CENTER/RIGHT all stay inside the button container with no overflow. For composite rows (slider/toggle/selector/…) the real AlignElements(UiComponentInteractionType, UiComponentAlignmentType) pass is used; RIGHT mirrors normally when every horizontal option shares one column width (MenuHorizontalMirroringPolicy), and falls back to CENTER only for CONTENT, where each option's own content-sized column has no shared width to mirror against.
Methods
Apply(UnityUiInteractableComponent, UiComponentAlignmentType, bool, HorizontalOptionWidthMode)
Applies the option label layout to component for the given option alignment.
Declaration
public static void Apply(UnityUiInteractableComponent component, UiComponentAlignmentType alignment, bool isHorizontal, HorizontalOptionWidthMode widthMode = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityUiInteractableComponent | component | The option component to fix up. |
| UiComponentAlignmentType | alignment | The menu's option alignment. |
| bool | isHorizontal | True for a horizontal menu. Horizontal composite rows apply |
| HorizontalOptionWidthMode | widthMode | The menu's horizontal option width mode. Ignored when |