Skip to main content

Module command_link_button

Module command_link_button 

Source
Expand description

CommandLinkButton — large two-line button with icon, title, and subtitle. Used for wizard landing screens, onboarding choices, and any “card-shaped CTA” pattern.

Modeled on Qt’s QCommandLinkButton. Distinct from a regular Button by its layout (HStack(icon + VStack(title + subtitle))) and default visual variant (Flat — Int UI convention — with an interactive surface tint on hover).

CommandLinkButton::new(tr!(create_new_project()))
    .description(tr!(create_new_project_subtitle()))
    .icon(IconWidget::from_svg(NEW_PROJECT_ICON))
    .on_activate_fn(|ctx| ctx.send_intent(AppIntent::NewProject))

§Touch and pen

Shares build_interaction_handlers with Button; see that module’s “Touch and pen” section. A command link is a tall, wide target by construction, so no hit-widening mechanism is involved.

Structs§

CommandLinkButton
A large two-line CTA button: icon + title + subtitle.

Constants§

COMMAND_LINK_BUTTON_ICON_SIZE
CommandLinkButton design tokens. The widget is a group-4 composite with no dedicated recipe module.
COMMAND_LINK_BUTTON_ICON_TEXT_GAP
COMMAND_LINK_BUTTON_MIN_HEIGHT
COMMAND_LINK_BUTTON_PADDING_HORIZONTAL
COMMAND_LINK_BUTTON_PADDING_VERTICAL
COMMAND_LINK_BUTTON_TITLE_DESCRIPTION_GAP

Functions§

command_link_button_icon_text_gap
COMMAND_LINK_BUTTON_ICON_TEXT_GAP scaled by the density’s spacing_factor (1.00 / 1.15 / 1.30).
command_link_button_min_height
COMMAND_LINK_BUTTON_MIN_HEIGHT raised to the density’s target_size (24 / 32 / 44 dp). The identity at Compact.
command_link_button_padding_horizontal
COMMAND_LINK_BUTTON_PADDING_HORIZONTAL scaled by the density’s spacing_factor (1.00 / 1.15 / 1.30).
command_link_button_padding_vertical
COMMAND_LINK_BUTTON_PADDING_VERTICAL scaled by the density’s spacing_factor (1.00 / 1.15 / 1.30).
command_link_button_title_description_gap
COMMAND_LINK_BUTTON_TITLE_DESCRIPTION_GAP scaled by the density’s spacing_factor (1.00 / 1.15 / 1.30).