mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-01 10:14:21 -06:00
Qualify selection mode references
This commit is contained in:
@@ -228,7 +228,7 @@ impl SheetApp {
|
||||
"ui.selectionMode" => {
|
||||
// `{"mode": "extend"}` (F8), `"add"` (Shift+F8) or `"off"`; `{}` reports the mode.
|
||||
match p.get("mode").and_then(Json::as_str) {
|
||||
Some(id) => match grid::SelectionMode::parse(id) {
|
||||
Some(id) => match crate::grid::SelectionMode::parse(id) {
|
||||
Some(mode) => self.grid.set_selection_mode(mode),
|
||||
None => return Some(Err(format!("unknown selection mode {id:?} (use \"extend\", \"add\" or \"off\")"))),
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ impl SheetApp {
|
||||
return;
|
||||
}
|
||||
// Editing a cell ends Extend and Add mode, as in Excel.
|
||||
self.grid.set_selection_mode(grid::SelectionMode::Off);
|
||||
self.grid.set_selection_mode(crate::grid::SelectionMode::Off);
|
||||
let Some(d) = self.session.active() else { return };
|
||||
let Some(sh) = d.wb.active() else { return };
|
||||
let at = sh.merge_at(d.selection.active).map(|m| m.start).unwrap_or(d.selection.active);
|
||||
|
||||
@@ -3,7 +3,7 @@ use super::geo::Geo;
|
||||
use super::interact::{hidden_col_edge, hidden_row_edge};
|
||||
#[cfg(test)]
|
||||
use super::show::hidden_around;
|
||||
use super::{CellRef, Color32, Painter, RangeRef, Rect, Sheet, SheetApp, Stroke, StrokeKind, Tokens, json, pos2, vec2};
|
||||
use super::{CellRef, Color32, Painter, RangeRef, Rect, SelectionMode, Sheet, SheetApp, Stroke, StrokeKind, Tokens, json, pos2, vec2};
|
||||
|
||||
/// Where the active cell is on screen: the whole merged cell when it is part of one.
|
||||
fn active_rect(geo: &Geo, sh: &Sheet, sel: &gridcraft_engine::Selection) -> Rect {
|
||||
|
||||
Reference in New Issue
Block a user