iced-rs/iced

How to adjust pick_list item border

オープン

#698 opened on 2021/01/13

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (1,572 件のフォーク)batch import
featuregood first issuewidget

Repository metrics

Stars
 (30,491 個のスター)
PR merge metrics
 (平均マージ 24d 11h) (30d で 11 merged PRs)

説明

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

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