iced-rs/iced

How to adjust pick_list item border

Open

#698 opened on Jan 13, 2021

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (1,572 forks)batch import
featuregood first issuewidget

Repository metrics

Stars
 (30,491 stars)
PR merge metrics
 (Avg merge 24d 11h) (11 merged PRs in 30d)

Description

As this image shows, I would like to adjust the pick_list item border to patch that of the dropdown menu itself:

image

Currently, I have the following code to implement picklist::StyleSheet

impl pick_list::StyleSheet for DropDown {
    fn menu(&self) -> Menu {
        Menu {
            text_color: WHITE.into(),
            background: DARK_BG.into(),
            border_width: BUTTON_RADIUS,
            border_color: WHITE.into(),
            selected_text_color: WHITE.into(),
            selected_background: GREY.into()
        }
    }

    fn active(&self) -> pick_list::Style {
        match super::get_theme() {
            super::Style::Light => pick_list::Style {
                text_color: DARK_BG.into(),
                background: WHITE.into(),
                border_radius: BUTTON_RADIUS,
                border_width: 1.0,
                border_color: DARK_BG.into(),
                icon_size: 0.5
            },
            super::Style::Dark => pick_list::Style {
                text_color: WHITE.into(),
                background: DARK_BG.into(),
                border_radius: BUTTON_RADIUS,
                border_width: 1.0,
                border_color: WHITE.into(),
                icon_size: 0.5
            }
        }
    }

    fn hovered(&self) -> pick_list::Style {
        pick_list::Style {
            text_color: WHITE.into(),
            background: GREY.into(),
            border_radius: BUTTON_RADIUS,
            border_width: 1.0,
            border_color: WHITE.into(),
            icon_size: 0.5
        }
    }
}

There does not seem to be an adjustment option for the pick_lists item view border radius

Contributor guide