Skip to content

IconNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for displaying icons with optional click handling.

csharp
public sealed class IconNode : Hex1bNode

Inheritance

ObjectHex1bNodeIconNode

Properties

ClickCallback

Callback for click events.

Returns: Func<InputBindingActionContext, Task>

csharp
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

csharp
public override Rect HitTestBounds { get; }

Icon

Gets or sets the icon to display.

Returns: String

csharp
public string Icon { get; set; }

IsClickable

Gets whether this icon is clickable.

Returns: Boolean

csharp
public bool IsClickable { get; }

IsFocusable

Clickable icons must be focusable to receive mouse input via the focus ring.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

SourceWidget

The source widget for typed event args.

Returns: IconWidget

csharp
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:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

MeasureCore(Constraints)

Measures the size required for the icon.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the icon to the terminal.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

Released under the MIT License.