keymap_ui: Add context menu for table rows (#33747)
Closes #ISSUE Adds a right click context menu to table rows, refactoring the table API to support more general row rendering in the process, and creating actions for the couple of operations available in the context menu. Additionally includes an only partially related change to the context menu API, which makes it easier to have actions that are disabled based on a boolean value. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -47,12 +47,12 @@ impl Render for ContextMenuStory {
|
||||
.justify_between()
|
||||
.child(
|
||||
right_click_menu("test2")
|
||||
.trigger(|_| Label::new("TOP LEFT"))
|
||||
.trigger(|_, _, _| Label::new("TOP LEFT"))
|
||||
.menu(move |window, cx| build_menu(window, cx, "top left")),
|
||||
)
|
||||
.child(
|
||||
right_click_menu("test1")
|
||||
.trigger(|_| Label::new("BOTTOM LEFT"))
|
||||
.trigger(|_, _, _| Label::new("BOTTOM LEFT"))
|
||||
.anchor(Corner::BottomLeft)
|
||||
.attach(Corner::TopLeft)
|
||||
.menu(move |window, cx| build_menu(window, cx, "bottom left")),
|
||||
@@ -65,13 +65,13 @@ impl Render for ContextMenuStory {
|
||||
.justify_between()
|
||||
.child(
|
||||
right_click_menu("test3")
|
||||
.trigger(|_| Label::new("TOP RIGHT"))
|
||||
.trigger(|_, _, _| Label::new("TOP RIGHT"))
|
||||
.anchor(Corner::TopRight)
|
||||
.menu(move |window, cx| build_menu(window, cx, "top right")),
|
||||
)
|
||||
.child(
|
||||
right_click_menu("test4")
|
||||
.trigger(|_| Label::new("BOTTOM RIGHT"))
|
||||
.trigger(|_, _, _| Label::new("BOTTOM RIGHT"))
|
||||
.anchor(Corner::BottomRight)
|
||||
.attach(Corner::TopRight)
|
||||
.menu(move |window, cx| build_menu(window, cx, "bottom right")),
|
||||
|
||||
Reference in New Issue
Block a user