瀏覽代碼

LibGUI: Disable editing cell when ctrl key is pressed

Disable cell editing when the ctrl key is pressed. This fixes a bug
where when doing ctrl+z (undo) and there are no more undo actions
on the undo_stack, then a "z" is entered into the cell.
martinfalisse 3 年之前
父節點
當前提交
daaa8a57f0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Userland/Libraries/LibGUI/TableView.cpp

+ 2 - 1
Userland/Libraries/LibGUI/TableView.cpp

@@ -174,7 +174,8 @@ void TableView::keydown_event(KeyEvent& event)
     auto is_delete = event.key() == Key_Delete;
     auto is_backspace = event.key() == Key_Backspace;
     auto is_clear = is_delete || is_backspace;
-    if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear)) {
+    auto has_ctrl = event.modifiers() & KeyModifier::Mod_Ctrl;
+    if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear) && !has_ctrl) {
         begin_editing(cursor_index());
         if (m_editing_delegate) {
             if (is_delete) {