Skip to main content

Module group_box

Module group_box 

Source
Expand description

GroupBox — titled cluster of controls in Int UI / Jewel style.

A bold title (optionally preceded by a checkbox) sits above an indented content area. No border, no frame — pure composition. The standard use is grouping related settings controls on a preferences sheet or form — the IntelliJ “group” pattern.

In checkable mode, unchecking disables event dispatch to every descendant of the content area (via ctx.enabled_when with ancestor propagation) AND paints a translucent surface overlay over the content so it reads as greyed-out. The title checkbox itself stays interactive.

§When to use

  • GroupBox — logical cluster with a title; optional enable/disable toggle for the whole cluster. Use for settings sections.
  • GroupHeader — lighter-weight “soft divider + caption” without a content slot; use to label regions that are not collapsed or disabled as a unit.

§Accessibility

The box node carries Role::Group and its name is set to the title string. When checkable and unchecked, set_disabled() is set on the group node so assistive technology announces the cluster as unavailable.

let _w = GroupBox::new(lit!("Indentation"))
    .child(TextWidget::new(lit!("Tab width: 4")));

Structs§

GroupBox
A titled cluster of controls with optional enable/disable toggle.

Constants§

GROUP_BOX_CHECKBOX_GAP
Gap between the checkbox and the adjacent title label in checkable mode (dp).
GROUP_BOX_CONTENT_INDENT
Horizontal indent of the content area below the title (dp).
GROUP_BOX_TITLE_CONTENT_SPACING
Vertical gap between the title row and the content area (dp).