mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-26 11:46:49 -06:00
G4: two windows on one workbook without copying it; Arrange All
- The workbook's active sheet is an atomic set in place (Workbook::active_sheet /
set_active_sheet), so a window swap or sheet switch never clones the
Arc<Workbook> or marks it dirty. Selections already live in DocState and the
window views. Save records the sheet of the most recently active window.
- A dialog taken out of its window while it runs goes back to that window when
a command run from it switched windows (dialogs::show, ui.dialog.confirm).
- view.arrangeAll {arrange?: tiled|horizontal|vertical|cascade, activeWorkbook?}
returns the visible windows, active first; the desktop moves and sizes the
native windows over the main window's monitor. New Window and Arrange All
buttons on the View ribbon; Arrange Windows dialog.
- Docs: ui-parity, hardware-parity, gaps #20, target-app-parity, ROADMAP.
This commit is contained in:
@@ -373,8 +373,8 @@ fn structure_problem(wb: &Workbook, sel: &gridcraft_engine::Selection) -> Option
|
||||
if wb.sheets.is_empty() {
|
||||
return Some("no sheets left".into());
|
||||
}
|
||||
if wb.active_sheet >= wb.sheets.len() {
|
||||
return Some(format!("active sheet {} of {}", wb.active_sheet, wb.sheets.len()));
|
||||
if wb.active_sheet() >= wb.sheets.len() {
|
||||
return Some(format!("active sheet {} of {}", wb.active_sheet(), wb.sheets.len()));
|
||||
}
|
||||
let mut tables = BTreeSet::new();
|
||||
for (i, sh) in wb.sheets.iter().enumerate() {
|
||||
@@ -490,7 +490,7 @@ fn watch_list(wb: &Workbook) -> Option<&str> {
|
||||
/// reset: undo restores view state as it was, but switching sheets isn't an undoable edit.
|
||||
fn canonical(wb: &Workbook) -> Workbook {
|
||||
let mut wb = wb.clone();
|
||||
wb.active_sheet = 0;
|
||||
wb.set_active_sheet(0);
|
||||
wb.names.retain(|n| n.name != WATCH_NAME);
|
||||
for sh in wb.sheets.iter_mut() {
|
||||
let sh = Arc::make_mut(sh);
|
||||
|
||||
Reference in New Issue
Block a user