Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to customize the handle of a pick_list #1562

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

casperstorm
Copy link
Member

This PR adds the ability to control the accessory content to the right of pick_list.
Currently in master it is only possible to change the icon size. This PR aims to add a little more customization options:

  • Size
  • Font
  • Content
  • Color

This gives the ability to add your own icons/text from your own font packs in various sizes. Example:

let accessory_content = pick_list::AccessoryContent::Custom { 
    font: FONT_ICONS,
    content: String::from('\u{f1a7}'),
    size: Some(14),
};

let pick_list = pick_list(..).accessory_content(accessory_content);

Screenshot 2022-11-29 at 12 01 04 PM

Breaking changes

  1. icon_size has been removed from Appearance.
  2. accessory_content_color has been added to Appearance.

@hecrj hecrj added the feature New feature or request label Nov 29, 2022
@hecrj hecrj added this to the 0.6.0 milestone Nov 29, 2022
@hecrj hecrj added the widget label Nov 29, 2022
@hecrj hecrj modified the milestones: 0.6.0, 0.7.0 Dec 7, 2022
... and rename `Default` variant to `Arrow`.
@hecrj hecrj force-pushed the feat/custom-accessory-content branch from b580dec to 39f4918 Compare December 14, 2022 02:31
@hecrj hecrj changed the title Added ability to customize accessory content in a pick_list. Added ability to customize the handle of a pick_list. Dec 14, 2022
@hecrj hecrj changed the title Added ability to customize the handle of a pick_list. Added ability to customize the handle of a pick_list Dec 14, 2022
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

I have just renamed AccessoryContent to Handle and the Default variant to Arrow in 39f4918. I think they are more intuitive!

Let me know what you think, and we can merge!

@casperstorm
Copy link
Member Author

Awesome!

I have just renamed AccessoryContent to Handle and the Default variant to Arrow in 39f4918. I think they are more intuitive!

Let me know what you think, and we can merge!

Great names, thanks. LGTM.

@hecrj hecrj added the styling label Dec 15, 2022
@hecrj hecrj merged commit da1b375 into iced-rs:master Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request styling widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants