Spreadsheet: Move down a cell when Return is pressed in the cell editor

If Return key is pressed when using cell value editor in a top bar,
cursor is automatically moved one line down. Fixes #8287.
This commit is contained in:
zawwwu 2021-07-03 17:05:53 +03:00 committed by Ali Mohammad Pur
parent cf91815654
commit f6cca0b8f0
Notes: sideshowbarker 2024-07-18 10:29:37 +09:00

View File

@ -53,6 +53,10 @@ SpreadsheetWidget::SpreadsheetWidget(NonnullRefPtrVector<Sheet>&& sheets, bool s
cell_value_editor.set_font(Gfx::FontDatabase::default_fixed_width_font());
cell_value_editor.set_scrollbars_enabled(false);
cell_value_editor.on_return_pressed = [this]() {
m_selected_view->move_cursor(GUI::AbstractView::CursorMovement::Down);
};
cell_value_editor.set_syntax_highlighter(make<CellSyntaxHighlighter>());
cell_value_editor.set_enabled(false);
current_cell_label.set_enabled(false);