Skip to content

Tracking issue for cell2 impl  #3

@1024bees

Description

@1024bees

Tracking issue for the cell2 rewrite.

API


let cell = Cell2::with_entries(
    Text::new("Wassup").width(Length::Fill).into(),
    &mut self.cell_state,
    vec![
        Entry::Item(Text::new("Test1").into(), Some(Message::Test1)),
        Entry::Group(
            Text::new("submenu").into(),
            vec![
                Entry::Item(Text::new("Test2").into(), Some(Message::Test2)),
                Entry::Item(Text::new("Test3").into(), Some(Message::Test3)),
                Entry::Group(
                    Text::new("submenu").into(),
                    vec![
                        Entry::Item(Text::new("Test2").into(), Some(Message::Test2)),
                        Entry::Item(Text::new("Test3").into(), Some(Message::Test3)),
                    ],
                ),
            ],
        ),
    ],
)
.set_single_click(|| Message::Toggle);

Blockers

  • Consistent Text API to control sizing per cell instantiation
  • Port over CellList to use cell2

Motivation

The previous implimentation (cell) suffered from two issues: bad test rendering, poor api for nested menus. Cell2 remedies these problems by leveraging Text widgets from iced native to handle rendering and using the Entry API to have a low level API to describe nested menus.

For posterity, the previous effort to handle nested menus was through the implimentation of a CellOption trait that could be derived via proc macro. This approach ultimately failed due to the fact that it created an opaque abstraction that was hard to customize (e.g. toggable entries of menu, mutually exclusive entries of a menu, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    low priolow priority issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions