Skip to content

SizeHintExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for setting size hints on widgets. These enable a fluent API: ctx.Text("Hello").Height(SizeHint.Fill)

csharp
public static class SizeHintExtensions

Inheritance

ObjectSizeHintExtensions

Methods

ContentHeight<TWidget>(TWidget)

Sets this widget to size to its content height.

Parameters:

  • widget (<TWidget>):

Returns: <TWidget>

csharp
public static TWidget ContentHeight<TWidget>(this TWidget widget) where TWidget : Hex1bWidget

ContentWidth<TWidget>(TWidget)

Sets this widget to size to its content width.

Parameters:

  • widget (<TWidget>):

Returns: <TWidget>

csharp
public static TWidget ContentWidth<TWidget>(this TWidget widget) where TWidget : Hex1bWidget

Fill<TWidget>(TWidget)

Sets this widget to fill available space in both dimensions.

Parameters:

  • widget (<TWidget>):

Returns: <TWidget>

csharp
public static TWidget Fill<TWidget>(this TWidget widget) where TWidget : Hex1bWidget

FillHeight<TWidget>(TWidget, int)

Sets this widget to fill available height with a weight.

Parameters:

  • widget (<TWidget>):
  • weight (Int32):

Returns: <TWidget>

csharp
public static TWidget FillHeight<TWidget>(this TWidget widget, int weight) where TWidget : Hex1bWidget

FillHeight<TWidget>(TWidget)

Sets this widget to fill available height.

Parameters:

  • widget (<TWidget>):

Returns: <TWidget>

csharp
public static TWidget FillHeight<TWidget>(this TWidget widget) where TWidget : Hex1bWidget

FillWidth<TWidget>(TWidget, int)

Sets this widget to fill available width with a weight.

Parameters:

  • widget (<TWidget>):
  • weight (Int32):

Returns: <TWidget>

csharp
public static TWidget FillWidth<TWidget>(this TWidget widget, int weight) where TWidget : Hex1bWidget

FillWidth<TWidget>(TWidget)

Sets this widget to fill available width.

Parameters:

  • widget (<TWidget>):

Returns: <TWidget>

csharp
public static TWidget FillWidth<TWidget>(this TWidget widget) where TWidget : Hex1bWidget

FixedHeight<TWidget>(TWidget, int)

Sets this widget to a fixed height.

Parameters:

  • widget (<TWidget>):
  • height (Int32):

Returns: <TWidget>

csharp
public static TWidget FixedHeight<TWidget>(this TWidget widget, int height) where TWidget : Hex1bWidget

FixedWidth<TWidget>(TWidget, int)

Sets this widget to a fixed width.

Parameters:

  • widget (<TWidget>):
  • width (Int32):

Returns: <TWidget>

csharp
public static TWidget FixedWidth<TWidget>(this TWidget widget, int width) where TWidget : Hex1bWidget

Height<TWidget>(TWidget, SizeHint)

Sets the height hint for this widget.

Parameters:

Returns: <TWidget>

csharp
public static TWidget Height<TWidget>(this TWidget widget, SizeHint hint) where TWidget : Hex1bWidget

Width<TWidget>(TWidget, SizeHint)

Sets the width hint for this widget.

Parameters:

Returns: <TWidget>

csharp
public static TWidget Width<TWidget>(this TWidget widget, SizeHint hint) where TWidget : Hex1bWidget

Released under the MIT License.