ClipToBoundsModifier¶
A Modifier.Element marking a node as clipping its subtree for input as well as for rendering: a descendant is hit-testable only where it overlaps this node's own bounds.
Every clipping container (see net.kernelpanicsoft.archie.gui.composables.containers.Scrollable, Collapsible, PannableCanvas) draws its children inside a scissor, but a scissor hides pixels and nothing more - the children keep real absolute coordinates outside the viewport. A scrolled-off row therefore still sits wherever the scroll offset put it, usually on top of whatever the layout placed below the container, and hit-testing a node against its own bounds alone (see net.kernelpanicsoft.archie.gui.layout.LayoutNode.isBounded) hands it clicks and hover the user has no way to see coming. Because a press consumes the event, it does not merely fire in addition to the real target - it takes the click away from it.
Applied by the clipping containers themselves; there is no reason for a leaf to carry it. Multiple elements on one node merge to a single, idempotent clip - the node's own bounds are the clip either way.
Constructors¶
ClipToBoundsModifier¶
constructor()
Functions¶
all¶
open override fun all(predicate: (Modifier.Element<*>) -> Boolean): Boolean
Returns true if predicate returns true for all Elements in this Modifier or if this Modifier contains no Elements.
any¶
open override fun any(predicate: (Modifier.Element<*>) -> Boolean): Boolean
background¶
@Stable
fun Modifier.background(color: Int): Modifier
Fills the composable's background with a solid ARGB integer color.
@Stable
fun Modifier.background(color: KColor): Modifier
Fills the composable's background with a solid color.
@Stable
fun Modifier.background(startColor: Int, endColor: Int): Modifier
Fills the composable's background with a gradient between two ARGB integer colours.
@Stable
fun Modifier.background(startColor: KColor, endColor: KColor): Modifier
Fills the composable's background with a gradient from startColor to endColor going top-to-bottom.
@Stable
fun Modifier.background(
startColor: Int,
endColor: Int,
gradientDirection: GradientDirection = GradientDirection.TOP_TO_BOTTOM
): Modifier
Fills the composable's background with a directional gradient between two ARGB integer colours.
@Stable
fun Modifier.background(
startColor: KColor,
endColor: KColor,
gradientDirection: GradientDirection = GradientDirection.TOP_TO_BOTTOM
): Modifier
Fills the composable's background with a gradient from startColor to endColor in the given gradientDirection.
border¶
Adds a border using a raw ARGB integer color.
clipToBounds¶
fun Modifier.clipToBounds(): Modifier
Restricts hit-testing of this node's descendants to its own bounds - see ClipToBoundsModifier.
combinedClickable¶
@Stable
fun <T : UINode> Modifier.combinedClickable(
onLongClick: (T, PointerEvent) -> Unit? = null,
onDoubleClick: (T, PointerEvent) -> Unit? = null,
onClick: (T, PointerEvent) -> Unit? = null
): Modifier
Adds multiple click-type handlers to a composable in a single modifier.
debug¶
Attaches one or more plain-text debug strings to the composable.
The strings are displayed in the debug overlay when debug mode is active.
Parameters
- strs: The strings to attach.
Attaches one or more formatted Component debug labels to the composable.
Parameters
- comps: The components to attach.
draggable¶
fun Modifier.draggable(
state: DraggableState,
orientation: Orientation,
enabled: Boolean = true,
interactionSource: MutableInteractionSource? = null,
onDragStarted: () -> Unit = {},
onDragStopped: () -> Unit = {}
): Modifier
Recognizes a drag gesture along orientation and reports each movement as a delta to state - the net.kernelpanicsoft.archie equivalent of Compose Foundation's Modifier.draggable(state, orientation, enabled, interactionSource, onDragStarted, onDragStopped) (dropping startDragImmediately/reverseDirection, which have no equivalent concept here).
fillMaxHeight¶
@Stable
fun Modifier.fillMaxHeight(percent: Double = 1.0): Modifier
Forces the node to fill percent of the maximum available height.
Parameters
- percent: Fraction of available height (0.0–1.0). Default
1.0fills all available height.
fillMaxSize¶
@Stable
fun Modifier.fillMaxSize(percent: Double = 1.0): Modifier
Forces the node to fill percent of both the available width and height.
Parameters
- percent: Fraction of available space (0.0–1.0). Default
1.0fills all available space.
fillMaxWidth¶
@Stable
fun Modifier.fillMaxWidth(percent: Double = 1.0): Modifier
Forces the node to fill percent of the maximum available width.
Parameters
- percent: Fraction of available width (0.0–1.0). Default
1.0fills all available width.
focusable¶
@Composable
fun Modifier.focusable(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null): Modifier
Registers this composable as a vanilla keyboard/controller focus-navigation stop - the net.kernelpanicsoft.archie equivalent of Compose Foundation's Modifier.focusable.
foldIn¶
Accumulates a value starting with initial and applying operation to the current value and each element from outside in.
Elements wrap one another in a chain from left to right; an Element that appears to the left of another in a + expression or in operation's parameter order affects all of the elements that appear after it. foldIn may be used to accumulate a value starting from the parent or head of the modifier chain to the final wrapped child.
foldOut¶
Accumulates a value starting with initial and applying operation to the current value and each element from inside out.
Elements wrap one another in a chain from left to right; an Element that appears to the left of another in a + expression or in operation's parameter order affects all of the elements that appear after it. foldOut may be used to accumulate a value starting from the child or tail of the modifier chain up to the parent or head of the chain.
getAll¶
Collects all Modifier.Element instances of type T from this modifier chain.
Return
A list of all modifier elements matching type T, in declaration order.
height¶
Sets an exact fixed height of height pixels (width unconstrained).
hoverable¶
fun Modifier.hoverable(interactionSource: MutableInteractionSource, enabled: Boolean = true): Modifier
Emits HoverInteraction as the pointer enters/exits - matches Compose Foundation's own Modifier.hoverable(interactionSource, enabled) signature exactly. Observe the result via net.kernelpanicsoft.archie.gui.interaction.collectIsHoveredAsState, same as Android; this has no enter/exit callbacks of its own to hook into.
margin¶
Adds a uniform margin on all four sides.
Adds symmetric horizontal and vertical margins.
Adds independent per-side margins around this composable.
mergeWith¶
open override fun mergeWith(other: ClipToBoundsModifier): ClipToBoundsModifier
offset¶
onCharTyped¶
Registers a character-typed handler on this composable.
onDrag¶
Registers a drag event handler on this composable.
onGloballyPositioned¶
fun Modifier.onGloballyPositioned(onGloballyPositioned: (IntCoordinates) -> Unit): Modifier
Registers onGloballyPositioned to be called with the node's absolute screen coordinates every time it is placed (e.g. on layout changes).
onKeyEvent¶
Registers a key-press handler on this composable.
onPointerEvent¶
@Stable
fun <T : UINode> Modifier.onPointerEvent(type: PointerEventType, onEvent: (T, PointerEvent) -> Unit): Modifier
Registers a handler for the given pointer type on this composable.
onScroll¶
Registers a scroll event handler on this composable.
onSizeChanged¶
fun Modifier.onSizeChanged(onSizeChanged: (Size) -> Unit): Modifier
Notifies callback of any size changes to element.
padding¶
Adds uniform padding on all four sides.
Adds symmetric horizontal and vertical padding.
Adds independent per-side padding inside this composable.
pressable¶
Emits PressInteraction and invokes onPress across a press - the net.kernelpanicsoft.archie equivalent of the press-recognition half of Compose Foundation's Modifier.clickable. Observe release via net.kernelpanicsoft.archie.gui.interaction.collectIsPressedAsState rather than a callback - onPress is kept only because, unlike hover, a press is inherently an action (the click itself), not just state to observe.
selectable¶
@Composable
fun Modifier.selectable(
selected: Boolean,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
onClick: () -> Unit
): Modifier
Marks this composable as a selectable option within a mutually exclusive group (radio button/tab) - the net.kernelpanicsoft.archie equivalent of Compose Foundation's Modifier.selectable.
size¶
sizeIn¶
Constrains the node's width and height to be within the given min/max bounds.
Parameters
-
minWidth: Minimum width in pixels.
-
maxWidth: Maximum width in pixels.
-
minHeight: Minimum height in pixels.
-
maxHeight: Maximum height in pixels.
texture¶
Overrides the texture of theme-aware composables with the given ResourceLocation.
then¶
Concatenates this modifier with another.
Returns a Modifier representing this modifier followed by other in sequence.
toComponent¶
open fun toComponent(): Component
Converts this modifier element to a debug Component representation.
toggleable¶
@Composable
fun Modifier.toggleable(
value: Boolean,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
onValueChange: (Boolean) -> Unit
): Modifier
Marks this composable as a togglable boolean control (checkbox/switch) - the net.kernelpanicsoft.archie equivalent of Compose Foundation's Modifier.toggleable.
tooltip¶
tooltip, for lines a caller already holds as a list.
Shows lines as a tooltip while the pointer is over this composable.
unsafeMergeWith¶
open fun unsafeMergeWith(other: Modifier.Element<*>): Self
width¶
Sets an exact fixed width of width pixels (height unconstrained).
zIndex¶
Sets the rendering depth of this composable relative to its siblings.