mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
f7b6b96aef
commit
92295921d4
@ -77,7 +77,7 @@ from gui.usefulwidget import (
|
|||||||
tabadd_lazy,
|
tabadd_lazy,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
threebuttons,
|
threebuttons,
|
||||||
getsimplekeyseq,
|
FQLineEdit,
|
||||||
getspinbox,
|
getspinbox,
|
||||||
selectcolor,
|
selectcolor,
|
||||||
listediter,
|
listediter,
|
||||||
@ -346,7 +346,7 @@ class TagWidget(QWidget):
|
|||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
self.lineEdit = FocusCombo()
|
self.lineEdit = FocusCombo()
|
||||||
self.lineEdit.setLineEdit(QLineEdit())
|
self.lineEdit.setLineEdit(FQLineEdit())
|
||||||
|
|
||||||
self.lineEdit.lineEdit().returnPressed.connect(
|
self.lineEdit.lineEdit().returnPressed.connect(
|
||||||
lambda: self.linepressedenter.emit(self.lineEdit.currentText())
|
lambda: self.linepressedenter.emit(self.lineEdit.currentText())
|
||||||
|
@ -21,6 +21,8 @@ from gui.usefulwidget import (
|
|||||||
getlineedit,
|
getlineedit,
|
||||||
listediter,
|
listediter,
|
||||||
listediterline,
|
listediterline,
|
||||||
|
FQPlainTextEdit,
|
||||||
|
FQLineEdit,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
makesubtab_lazy,
|
makesubtab_lazy,
|
||||||
getIconButton,
|
getIconButton,
|
||||||
@ -171,9 +173,9 @@ class AnkiWindow(QWidget):
|
|||||||
margin0=True,
|
margin0=True,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.fronttext = QPlainTextEdit1()
|
self.fronttext = FQPlainTextEdit()
|
||||||
self.backtext = QPlainTextEdit1()
|
self.backtext = FQPlainTextEdit()
|
||||||
self.csstext = QPlainTextEdit1()
|
self.csstext = FQPlainTextEdit()
|
||||||
edittemptab.addTab(self.fronttext, "正面")
|
edittemptab.addTab(self.fronttext, "正面")
|
||||||
edittemptab.addTab(self.backtext, "背面")
|
edittemptab.addTab(self.backtext, "背面")
|
||||||
edittemptab.addTab(self.csstext, "样式")
|
edittemptab.addTab(self.csstext, "样式")
|
||||||
@ -375,14 +377,14 @@ class AnkiWindow(QWidget):
|
|||||||
self.editpath.setReadOnly(True)
|
self.editpath.setReadOnly(True)
|
||||||
self.viewimagelabel = QLabel()
|
self.viewimagelabel = QLabel()
|
||||||
self.editpath.textChanged.connect(self.wrappedpixmap)
|
self.editpath.textChanged.connect(self.wrappedpixmap)
|
||||||
self.example = QPlainTextEdit1()
|
self.example = FQPlainTextEdit()
|
||||||
self.example.hiras = None
|
self.example.hiras = None
|
||||||
|
|
||||||
def __():
|
def __():
|
||||||
self.example.hiras = None
|
self.example.hiras = None
|
||||||
|
|
||||||
self.example.textChanged.connect(__)
|
self.example.textChanged.connect(__)
|
||||||
self.remarks = QPlainTextEdit1()
|
self.remarks = FQPlainTextEdit()
|
||||||
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"], colors=["", ""])
|
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"], colors=["", ""])
|
||||||
recordbtn1.statuschanged.connect(
|
recordbtn1.statuschanged.connect(
|
||||||
functools.partial(self.startorendrecord, self.audiopath)
|
functools.partial(self.startorendrecord, self.audiopath)
|
||||||
@ -649,18 +651,6 @@ class CustomTabBar(LTabBar):
|
|||||||
return self.savesizehint
|
return self.savesizehint
|
||||||
|
|
||||||
|
|
||||||
class QLineEdit1(QLineEdit):
|
|
||||||
def mousePressEvent(self, a0: QMouseEvent) -> None:
|
|
||||||
# 点击浏览器后,无法重新获取焦点。
|
|
||||||
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):
|
class searchwordW(closeashidewindow):
|
||||||
search_word = pyqtSignal(str, bool)
|
search_word = pyqtSignal(str, bool)
|
||||||
@ -725,7 +715,7 @@ class searchwordW(closeashidewindow):
|
|||||||
ww.setLayout(self.vboxlayout)
|
ww.setLayout(self.vboxlayout)
|
||||||
self.searchlayout = QHBoxLayout()
|
self.searchlayout = QHBoxLayout()
|
||||||
self.vboxlayout.addLayout(self.searchlayout)
|
self.vboxlayout.addLayout(self.searchlayout)
|
||||||
self.searchtext = QLineEdit1()
|
self.searchtext = FQLineEdit()
|
||||||
self.searchtext.textChanged.connect(self.ankiwindow.reset)
|
self.searchtext.textChanged.connect(self.ankiwindow.reset)
|
||||||
self.history_last_btn = statusbutton(
|
self.history_last_btn = statusbutton(
|
||||||
icons=["fa.arrow-left", "fa.arrow-left"], colors=["", ""]
|
icons=["fa.arrow-left", "fa.arrow-left"], colors=["", ""]
|
||||||
|
@ -2086,3 +2086,17 @@ def clearlayout(ll: QLayout):
|
|||||||
clearlayout(l)
|
clearlayout(l)
|
||||||
l.deleteLater()
|
l.deleteLater()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
class FQPlainTextEdit(QPlainTextEdit):
|
||||||
|
def mousePressEvent(self, a0: QMouseEvent) -> None:
|
||||||
|
# 点击浏览器后,无法重新获取焦点。
|
||||||
|
windows.SetFocus(int(self.winId()))
|
||||||
|
return super().mousePressEvent(a0)
|
||||||
|
|
||||||
|
|
||||||
|
class FQLineEdit(QLineEdit):
|
||||||
|
def mousePressEvent(self, a0: QMouseEvent) -> None:
|
||||||
|
# 点击浏览器后,无法重新获取焦点。
|
||||||
|
windows.SetFocus(int(self.winId()))
|
||||||
|
return super().mousePressEvent(a0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user