diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index 42fa375c..49335be9 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -171,9 +171,9 @@ class AnkiWindow(QWidget): margin0=True, ) ) - self.fronttext = QPlainTextEdit() - self.backtext = QPlainTextEdit() - self.csstext = QPlainTextEdit() + self.fronttext = QPlainTextEdit1() + self.backtext = QPlainTextEdit1() + self.csstext = QPlainTextEdit1() edittemptab.addTab(self.fronttext, "正面") edittemptab.addTab(self.backtext, "背面") edittemptab.addTab(self.csstext, "样式") @@ -375,14 +375,14 @@ class AnkiWindow(QWidget): self.editpath.setReadOnly(True) self.viewimagelabel = QLabel() self.editpath.textChanged.connect(self.wrappedpixmap) - self.example = QPlainTextEdit() + self.example = QPlainTextEdit1() self.example.hiras = None def __(): self.example.hiras = None self.example.textChanged.connect(__) - self.remarks = QPlainTextEdit() + self.remarks = QPlainTextEdit1() recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"], colors=["", ""]) recordbtn1.statuschanged.connect( functools.partial(self.startorendrecord, self.audiopath) @@ -655,6 +655,12 @@ class QLineEdit1(QLineEdit): windows.SetFocus(int(self.winId())) return super().mousePressEvent(a0) +class QPlainTextEdit1(QPlainTextEdit): + def mousePressEvent(self, a0: QMouseEvent) -> None: + # 点击浏览器后,无法重新获取焦点。 + windows.SetFocus(int(self.winId())) + return super().mousePressEvent(a0) + class searchwordW(closeashidewindow): search_word = pyqtSignal(str, bool)