Class BackdropPanel
BackdropEffect: a
glass control bar over video, a washed header over a picture, a redacted field. Wraps one child
with insets, like the Padding it extends, and paints the effect under it.
Put it where it will be painted after what it sits over. The effect samples what the frame has already drawn, so a panel is a sibling after the content: in a stack, the layer above; in a column, nothing sits behind it and the effect shows the window's own background, which is a legitimate but very dull result.
Costs a batch break and a copy of its own bounds per frame it paints. That is a control bar's worth of work, not a list row's: a panel per row is the wrong shape for this widget, and a hundred of them will show up in the frame time.
Degrades to a flat panel in the effect's tint where the renderer
has no backdrop support, with the same size, position and corner radius.
Size axis: the corner radius follows the resolved ControlSize row
like every other component's chrome, unless setCornerRadius(float) pins it. The effect's own
dimensions (a rim width, a cell size) are authored in points and do not scale with the step:
they are optical properties of the material, not of the control.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatsetCornerRadius(float)takes this to mean "follow the resolved size row". -
Constructor Summary
ConstructorsConstructorDescriptionBackdropPanel(BackdropEffect effect, Insets insets, Widget child) BackdropPanel(BackdropEffect effect, Widget child) A panel with 12pt of padding aroundchild. -
Method Summary
Modifier and TypeMethodDescriptionfinal BackdropEffecteffect()The first effect painted behind the child; seeeffects()for the whole stack.final List<BackdropEffect> effects()Every effect painted behind the child, in the order they are drawn.protected voidWidget's own background/content, in local coordinates.setCornerRadius(float radius) Pins the corner radius in points, orRADIUS_FROM_TOKENSto follow the resolved size row (the default).setEffect(BackdropEffect newEffect) Replaces the effect.setEffects(BackdropEffect... stack) Replaces the effect with a stack, drawn in order over the same shape.Methods inherited from class limn.scene.layout.Padding
all, insets, onLayout, onMeasure, setInsets, setInsetsSilentlyMethods inherited from class limn.scene.Widget
acceptsTextInput, add, baselineOffset, baselineOffsetOf, caretRect, children, clipboard, clipsChildren, controlSize, cursor, declaredControlSize, declaredLayoutDirection, declaredLocale, focusArrivedByTraversal, height, hitTest, imageCursor, invalidate, invalidate, isEnabled, isFocusable, isFocused, isShowing, isVisible, layoutBox, layoutDirection, locale, localToSceneX, localToSceneY, markNeedsContainedLayout, markNeedsLayout, measure, moveChild, neutralBase, onAttached, onCharTyped, onDetached, onFileDrop, onFocusGained, onFocusLost, onKeyEvent, onMouseEvent, onPaintOverlay, onPreedit, overlayPassesPointer, paintChildren, paintOutset, paintWidget, parent, remove, requestFocus, revealInView, scene, sceneToLocalX, sceneToLocalY, setControlSize, setCursor, setEnabled, setFocusable, setImageCursor, setInheritanceHost, setLayoutDirection, setLocale, setTooltip, setTooltip, setVisible, shapeText, textRuler, tooltip, width, x, y
-
Field Details
-
RADIUS_FROM_TOKENS
public static final float RADIUS_FROM_TOKENSsetCornerRadius(float)takes this to mean "follow the resolved size row".- See Also:
-
-
Constructor Details
-
BackdropPanel
A panel with 12pt of padding aroundchild. -
BackdropPanel
-
-
Method Details
-
effect
The first effect painted behind the child; seeeffects()for the whole stack. -
effects
Every effect painted behind the child, in the order they are drawn. -
setEffects
Replaces the effect with a stack, drawn in order over the same shape.This is how the effects compose, and it needs nothing from the renderer: each one reads the framebuffer and writes it, so the second samples what the first left. It is what makes a frosted pane out of the pieces rather than out of a variant with four parameters, and what makes
BackdropEffect.Bluraffordable, since a separable blur IS two passes.Each pass costs one batch flush and one copy of the panel's own bounds, so a stack of three costs three of each. Over a small panel that is cheap and over a full-window one it is not; the cost is proportional to the shape, not to the window.
- Throws:
IllegalArgumentException- if the stack is empty
-
setEffect
Replaces the effect. UI thread only. -
setCornerRadius
Pins the corner radius in points, orRADIUS_FROM_TOKENSto follow the resolved size row (the default). UI thread only. -
onPaint
Description copied from class:WidgetWidget's own background/content, in local coordinates.
-