Skip to main content

selectable_row_style

Function selectable_row_style 

Source
pub fn selectable_row_style(
    theme: &Theme,
    status: Status,
    selected: bool,
) -> Style
Expand description

A clickable row’s look: the accent when selected, a plain elevation step when merely hovered, nothing otherwise.

Hover must never share the selected colour: a row the pointer happens to be over looking like the one you picked makes “is this selected?” ambiguous the instant the mouse moves. tests::only_the_selected_row_ever_uses_the_accent_colour pins this.

One function for every list of rows — Files’ sidebar, its entry list, its application chooser, and Settings’ sidebar — because it is one rule, and two copies of “purple means selected” is two places for it to stop being true.