IconNode
Namespace: Hex1b
Assembly: Hex1b.dll
Render node for displaying icons with optional click handling.
public sealed class IconNode : Hex1bNodeInheritance
Properties
ClickCallback
Callback for click events.
Returns: Func<InputBindingActionContext, Task>
public Func<InputBindingActionContext, Task>? ClickCallback { get; set; }HitTestBounds
Gets the bounds used for mouse hit testing. By default, returns the full Bounds. Override in nodes where only a portion of the bounds should respond to clicks (e.g., SplitterNode's divider).
Returns: Rect
public override Rect HitTestBounds { get; }Icon
Gets or sets the icon to display.
Returns: String
public string Icon { get; set; }IsClickable
Gets whether this icon is clickable.
Returns: Boolean
public bool IsClickable { get; }IsFocusable
Clickable icons must be focusable to receive mouse input via the focus ring.
Returns: Boolean
public override bool IsFocusable { get; }SourceWidget
The source widget for typed event args.
Returns: IconWidget
public IconWidget? SourceWidget { get; set; }Methods
ConfigureDefaultBindings(InputBindingsBuilder)
Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.
Parameters:
bindings(InputBindingsBuilder): The builder to add bindings to.
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)MeasureCore(Constraints)
Measures the size required for the icon.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the icon to the terminal.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)