From f6cca0b8f0a4d1226a9cfbdfc04874bbd71f5310 Mon Sep 17 00:00:00 2001 From: zawwwu <58145197+zawwwu@users.noreply.github.com> Date: Sat, 3 Jul 2021 17:05:53 +0300 Subject: [PATCH] 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. --- Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index 5b7e99c99d..bd1ebe1d9a 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -53,6 +53,10 @@ SpreadsheetWidget::SpreadsheetWidget(NonnullRefPtrVector&& 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()); cell_value_editor.set_enabled(false); current_cell_label.set_enabled(false);