iced-rs/iced

How to adjust pick_list item border

Open

#698 opened on 2021年1月13日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)Rust (30,491 stars) (1,572 forks)batch import
featuregood first issuewidget

説明

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

コントリビューターガイド