1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

Spreadsheet: Highlight the source causing an exception in red

This commit makes the cell editor highlight the likely source of the
exception in red.
This commit is contained in:
AnotherTest 2020-12-28 20:46:39 +03:30 committed by Andreas Kling
parent b34b681811
commit aa5b43a2bc
3 changed files with 21 additions and 0 deletions

View file

@ -142,6 +142,7 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
update();
};
m_cell_value_editor->set_enabled(true);
static_cast<CellSyntaxHighlighter*>(const_cast<GUI::SyntaxHighlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(&cell);
return;
}
@ -169,9 +170,11 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
}
};
m_cell_value_editor->set_enabled(true);
static_cast<CellSyntaxHighlighter*>(const_cast<GUI::SyntaxHighlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(cells.first());
};
m_selected_view->on_selection_dropped = [&]() {
m_cell_value_editor->set_enabled(false);
static_cast<CellSyntaxHighlighter*>(const_cast<GUI::SyntaxHighlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(nullptr);
m_cell_value_editor->set_text("");
m_current_cell_label->set_enabled(false);
m_current_cell_label->set_text("");