R5.5: ElyTable right-click menus, Excel-style; three rounds used, last fixes tested
Grid and header menus share ely_office::menu with ElyDoc. Each item's availability is the kernel's state for the exact command it runs (patch 0045). Patch 0046 lets a header select its row or column while a shape is selected or its text is edited: the view shell ends the drawing edit, keeps the typed text, leaves drawing mode, then marks. Ely no longer sends Esc first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
07c0b43542
commit
87886c8a8d
30 files changed
+1010
-106
No files matched your search
@@ -140,6 +140,12 @@ impl Book {
|
||||
}
|
||||
}
|
||||
|
||||
/// Selects a header's row or column.
|
||||
pub(crate) fn select_header(&mut self, column: bool, index: u32, modifier: &str, cx: &mut Context<Self>) {
|
||||
let id = if column { "select.column" } else { "select.row" };
|
||||
self.run_active(id, &[&index.to_string(), modifier], cx);
|
||||
}
|
||||
|
||||
/// One row or column header with its sizing edge.
|
||||
fn header(
|
||||
&self,
|
||||
@@ -201,13 +207,15 @@ impl Book {
|
||||
.border_color(transparent_black())
|
||||
.focus_ring(cx)
|
||||
.tab_index(0)
|
||||
.on_mouse_down(
|
||||
MouseButton::Right,
|
||||
cx.listener(move |book, event: &MouseDownEvent, _, cx| {
|
||||
cx.stop_propagation();
|
||||
book.header_menu(column, index, event.position, cx);
|
||||
}),
|
||||
)
|
||||
.on_click(cx.listener(move |book, event: &ClickEvent, _, cx| {
|
||||
let id = if column {
|
||||
"select.column"
|
||||
} else {
|
||||
"select.row"
|
||||
};
|
||||
book.run_active(id, &[&index.to_string(), &modifier(&event.modifiers())], cx);
|
||||
book.select_header(column, index, &modifier(&event.modifiers()), cx);
|
||||
}))
|
||||
.child(label);
|
||||
let cell = div()
|
||||
|
||||
Reference in new issue
Block a user