iced icon indicating copy to clipboard operation
iced copied to clipboard

[Question] Selectable Item List

Open alexxbb opened this issue 3 years ago • 4 comments

Hi, I'm trying to find a widget similar to Qt's QListWidget to display a list of items that can be selected. I assumed such a basic widget would exist in Iced, but I couldn't find it. If it doesn't exist, can anyone give me some hint on how to go about building it? I'm currently having a big list on Text items wrapped in Scrollable, but how do I add selection?

Thanks!

alexxbb avatar Dec 22 '21 19:12 alexxbb

I believe the solution you're looking for is the PickList widget. Example here: https://github.com/iced-rs/iced/tree/master/examples/pick_list Docs: https://docs.rs/iced/latest/iced/widget/pick_list/index.html

atlanticaccent avatar Dec 24 '21 09:12 atlanticaccent

I believe the solution you're looking for is the PickList widget.

Example here: https://github.com/iced-rs/iced/tree/master/examples/pick_list

Docs: https://docs.rs/iced/latest/iced/widget/pick_list/index.html

PickList is a drop down menu (QComboBox in Qt), I'm looking for a scrollable list of selectable items. Basically Scrollable with Rows, but I couldn't figure the selection part.

alexxbb avatar Dec 24 '21 17:12 alexxbb

I'd guess you want either a Checkbox or a Radio, depending on whether you want multiple items to be selectable or not.

brightly-salty avatar Dec 31 '21 21:12 brightly-salty

I'm looking for a scrollable list of selectable items. Basically Scrollable with Rows, but I couldn't figure the selection part.

I'm probably a bit late but I had the exact same need and ended up creating a widget which is simply a Row with a CheckBox and a Text (source code)

Considering PackageRow the name of the widget, I used a Vec<PackageRow> to populate a Column (like this)

Then, once you have a Column you can push into a Scrollable.

0x192 avatar Jan 11 '22 13:01 0x192