Skip to content

Commit

Permalink
Improved row selection in main table
Browse files Browse the repository at this point in the history
  • Loading branch information
dkratzert committed Jan 23, 2024
1 parent 25d8183 commit 2e7357c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion finalcif/gui/plaintextedit.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from enum import IntEnum
from typing import TYPE_CHECKING

from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSignal, Qt, QObject, QEvent, QSize
from PyQt5.QtGui import QTextOption, QFontMetrics, QContextMenuEvent, QFont, QColor
from PyQt5.QtWidgets import QPlainTextEdit, QFrame, QApplication, QAbstractScrollArea
from PyQt5.QtWidgets import QPlainTextEdit, QFrame, QAbstractScrollArea

from finalcif.gui.edit_button import FloatingButtonWidget
from finalcif.gui.new_key_dialog import NewKey
Expand Down Expand Up @@ -143,6 +144,11 @@ def enterEvent(self, a0):
self.edit_button.update_position()
self.edit_button.show()

def event(self, e: QtCore.QEvent):
if e.type() == QtCore.QEvent.InputMethodQuery:
self.parent.setCurrentCell(self.row, self.column)
return super().event(e)

def leaveEvent(self, a0: QEvent) -> None:
super().leaveEvent(a0)
if self.edit_button and self.column == Column.EDIT:
Expand Down

0 comments on commit 2e7357c

Please sign in to comment.