Module: ui.widgets.panel

Source: ./ui/widgets/panel.reef


Overview

ui/widgets/panel.reef - Container widget with background Part of reef-stdlib UI module

The Panel widget is a container that provides a background, border, and optional padding for its child content. It's used to group related UI elements visually.

Panels support:

  • Background colors (solid or from theme)
  • Borders with configurable width and radius
  • Padding around content
  • Shadow effects (visual depth)

Types

PanelStyle (enum)

Variants:

  • Flat
  • Raised
  • Sunken
  • Outlined
  • Card

Objects

Panel

Extends: widget.Widget

Fields:

Name Type
style PanelStyle
padding_top float
padding_right float
padding_bottom float
padding_left float
custom_background core.Color
use_custom_background bool
border_width float
border_radius float
kids [widget.Widget]

proc init(id: widget.WidgetId)

Methods:

override shared fn kind(): string

exclusive proc add(child: widget.Widget)

override exclusive proc paint(surf: surface.Surface, th: theme.Theme)


Functions

fn panel_style_flat(): PanelStyle

fn panel_style_raised(): PanelStyle

fn panel_style_sunken(): PanelStyle

fn panel_style_outlined(): PanelStyle

fn panel_style_card(): PanelStyle

fn is_panel_flat(s: PanelStyle): bool

fn is_panel_raised(s: PanelStyle): bool

fn is_panel_sunken(s: PanelStyle): bool

fn is_panel_outlined(s: PanelStyle): bool

fn is_panel_card(s: PanelStyle): bool

fn panel(): Panel

fn panel_with_style(style: PanelStyle): Panel

fn panel_with_padding(padding: float): Panel

fn panel_child_count(p: Panel): int

fn panel_style(p: Panel): PanelStyle

fn panel_padding(p: Panel): float

fn panel_set_style(p: Panel, style: PanelStyle): Panel

fn panel_set_padding(p: Panel, padding: float): Panel

fn panel_set_padding_each(p: Panel, top: float, right: float, bottom: float, left: float): Panel

fn panel_set_background(p: Panel, color: core.Color): Panel

fn panel_set_border_width(p: Panel, width: float): Panel

fn panel_set_border_radius(p: Panel, radius: float): Panel

fn panel_get_id(p: Panel): widget.WidgetId

fn panel_get_state(p: Panel): widget.WidgetState

fn panel_get_bounds(p: Panel): core.Rect

fn panel_content_bounds(p: Panel): core.Rect

fn panel_preferred_size(p: Panel, content_size: core.Size): core.Size

fn panel_layout(p: Panel, constraints: layout.Constraints): Panel

fn panel_handle_event(p: Panel, e: event.Event): widget.EventResult

fn get_panel_background(p: Panel, colors: theme.ThemeColors): core.Color

fn get_panel_border_color(p: Panel, colors: theme.ThemeColors): core.Color


Procedures

proc panel_add(p: Panel, child: widget.Widget)

proc panel_paint(p: Panel, surf: surface.Surface, th: theme.Theme)

proc draw_shadow(surf: surface.Surface, x: float, y: float, w: float, h: float, offset: float)

proc draw_raised_border(surf: surface.Surface, x: float, y: float, w: float, h: float, colors: theme.ThemeColors)

proc draw_sunken_border(surf: surface.Surface, x: float, y: float, w: float, h: float, colors: theme.ThemeColors)

proc draw_rect_border(surf: surface.Surface, x: float, y: float, w: float, h: float, color: core.Color, width: float)


Generated by reefc doc