etui/widgets/popup

Types

Popup configuration. Width/height are in terminal cells.

pub type Popup {
  Popup(
    width: Int,
    height: Int,
    title: String,
    border: block.Border,
    fg: style.Color,
    bg: style.Color,
  )
}

Constructors

Values

pub fn popup_area(
  screen: geometry.Rect,
  p: Popup,
) -> geometry.Rect

Inner content area (inside border and padding) for child widgets.

pub fn popup_new(width: Int, height: Int) -> Popup

New popup with given cell dimensions. Default: Rounded border, default colors.

pub fn popup_rect(
  screen: geometry.Rect,
  p: Popup,
) -> geometry.Rect

Centered rect for this popup within screen.

pub fn render(
  buf: buffer.Buffer,
  screen: geometry.Rect,
  p: Popup,
) -> buffer.Buffer

Render popup overlay. Draw child widgets into popup_area after this.

pub fn with_border(p: Popup, border: block.Border) -> Popup

Set the border style.

pub fn with_colors(
  p: Popup,
  fg: style.Color,
  bg: style.Color,
) -> Popup
pub fn with_style(
  p: Popup,
  fg: style.Color,
  bg: style.Color,
) -> Popup

Set foreground and background colors.

pub fn with_title(p: Popup, title: String) -> Popup

Set the popup title (shown on top border).

Search Document