mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:17:36 +00:00
Spreadsheet: Disable cut/copy if no cell is selected
This resolves #12766 which occurred when the user tried to use either the cut or copy action before selecting a cell.
This commit is contained in:
parent
fe67fe3791
commit
3c01ef1c23
1 changed files with 7 additions and 0 deletions
|
@ -237,6 +237,9 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
toolbar.add_action(*m_paste_action);
|
||||
toolbar.add_action(*m_undo_action);
|
||||
toolbar.add_action(*m_redo_action);
|
||||
|
||||
m_cut_action->set_enabled(false);
|
||||
m_copy_action->set_enabled(false);
|
||||
}
|
||||
|
||||
void SpreadsheetWidget::resize_event(GUI::ResizeEvent& event)
|
||||
|
@ -278,6 +281,8 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
|
|||
m_cell_value_editor->on_focusout = nullptr;
|
||||
m_cell_value_editor->set_text("");
|
||||
m_cell_value_editor->set_enabled(false);
|
||||
m_cut_action->set_enabled(false);
|
||||
m_copy_action->set_enabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -299,6 +304,8 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
|
|||
update();
|
||||
};
|
||||
m_cell_value_editor->set_enabled(true);
|
||||
m_cut_action->set_enabled(true);
|
||||
m_copy_action->set_enabled(true);
|
||||
static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(&cell);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue