plushie/widget/window

Window widget builder.

Types

Option type for window properties.

pub type Opt {
  Title(String)
  Size(Float, Float)
  Width(length.Length)
  Height(length.Length)
  Position(Float, Float)
  MinSize(Float, Float)
  MaxSize(Float, Float)
  Maximized(Bool)
  Fullscreen(Bool)
  Visible(Bool)
  Resizable(Bool)
  Closeable(Bool)
  Minimizable(Bool)
  Decorations(Bool)
  Transparent(Bool)
  Blur(Bool)
  Level(WindowLevel)
  ExitOnCloseRequest(Bool)
  ScaleFactor(Float)
  WindowTheme(theme.Theme)
  A11y(a11y.A11y)
}

Constructors

  • Title(String)
  • Size(Float, Float)
  • Width(length.Length)
  • Height(length.Length)
  • Position(Float, Float)
  • MinSize(Float, Float)
  • MaxSize(Float, Float)
  • Maximized(Bool)
  • Fullscreen(Bool)
  • Visible(Bool)
  • Resizable(Bool)
  • Closeable(Bool)
  • Minimizable(Bool)
  • Decorations(Bool)
  • Transparent(Bool)
  • Blur(Bool)
  • Level(WindowLevel)
  • ExitOnCloseRequest(Bool)
  • ScaleFactor(Float)
  • WindowTheme(theme.Theme)
  • A11y(a11y.A11y)
pub opaque type Window
pub type WindowLevel {
  Normal
  AlwaysOnTop
  AlwaysOnBottom
}

Constructors

  • Normal
  • AlwaysOnTop
  • AlwaysOnBottom

Values

pub fn a11y(w: Window, a: a11y.A11y) -> Window

Set accessibility properties for this widget.

pub fn blur(w: Window, b: Bool) -> Window

Set whether background blur is enabled.

pub fn build(w: Window) -> node.Node

Build the window into a renderable Node.

pub fn closeable(w: Window, c: Bool) -> Window

Set whether the window has a close button.

pub fn decorations(w: Window, d: Bool) -> Window

Set whether window decorations are shown.

pub fn exit_on_close_request(w: Window, e: Bool) -> Window

Set whether to exit when close is requested.

pub fn extend(w: Window, children: List(node.Node)) -> Window

Add multiple child nodes.

pub fn fullscreen(w: Window, f: Bool) -> Window

Set whether the window is fullscreen.

pub fn height(w: Window, height: length.Length) -> Window

Set the height.

pub fn level(w: Window, l: WindowLevel) -> Window

Set the window stacking level.

pub fn max_size(w: Window, width: Float, height: Float) -> Window

Set the maximum window size.

pub fn maximized(w: Window, m: Bool) -> Window

Set whether the window is maximized.

pub fn min_size(w: Window, width: Float, height: Float) -> Window

Set the minimum window size.

pub fn minimizable(w: Window, m: Bool) -> Window

Set whether the window can be minimized.

pub fn new(id: String) -> Window

Create a new window builder.

pub fn position(w: Window, x: Float, y: Float) -> Window

Set the window position in screen coordinates.

pub fn push(w: Window, child: node.Node) -> Window

Add a child node.

pub fn resizable(w: Window, r: Bool) -> Window

Set whether the window is resizable.

pub fn scale_factor(w: Window, factor: Float) -> Window

Set the DPI scale factor for this window. Overrides the global scale factor from settings. Useful for per-window zoom levels.

pub fn size(w: Window, width: Float, height: Float) -> Window

Set the initial window size in pixels.

pub fn theme(w: Window, t: theme.Theme) -> Window

Set the per-window theme. Overrides the app-level theme from settings for this window only. Accepts built-in themes (e.g. theme.Dark, theme.Nord) or custom palettes via theme.custom().

pub fn title(w: Window, t: String) -> Window

Set the window title.

pub fn transparent(w: Window, t: Bool) -> Window

Set whether the window background is transparent.

pub fn visible(w: Window, v: Bool) -> Window

Set whether the window is visible.

pub fn width(w: Window, width: length.Length) -> Window

Set the width.

pub fn with_opts(w: Window, opts: List(Opt)) -> Window

Apply a list of options to a window builder.

Search Document