This commit is contained in:
恍兮惚兮 2024-05-21 12:45:02 +08:00
parent 08025c8ece
commit 9f0b592db0
7 changed files with 11 additions and 25 deletions

View File

@ -1,6 +1,6 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QTextBrowser,
QPlainTextEdit,
QAction,
QMenu,
QHBoxLayout,
@ -32,7 +32,7 @@ class edittext(closeashidewindow):
def setupUi(self):
self.setWindowIcon(qtawesome.icon("fa.edit"))
self.textOutput = QTextBrowser(self)
self.textOutput = QPlainTextEdit(self)
self.textOutput.setContextMenuPolicy(Qt.CustomContextMenu)
@ -42,7 +42,6 @@ class edittext(closeashidewindow):
self.textOutput.setUndoRedoEnabled(True)
self.textOutput.setReadOnly(False)
self.textOutput.setObjectName("textOutput")
qv = QHBoxLayout()
w = QWidget()

View File

@ -419,10 +419,6 @@ class postconfigdialog_(QDialog):
lb.setText(_TR(key))
formLayout.addWidget(lb)
# lines=QTextEdit(self)
# lines.setPlainText('\n'.join(configdict[key]))
# lines.textChanged.connect(lambda :configdict.__setitem__(key,lines.toPlainText().split('\n')))
# formLayout.addWidget(lines)
model = QStandardItemModel(len(configdict[key]), 1, self)
row = 0

View File

@ -2,7 +2,7 @@ import functools
from PyQt5.QtWidgets import (
QHBoxLayout,
QTextEdit,
QPlainTextEdit,
QHBoxLayout,
QWidget,
QMenu,
@ -79,8 +79,8 @@ def setTab7(self):
def getcomparelayout(self):
layout = QHBoxLayout()
fromtext = QTextEdit()
totext = QTextEdit()
fromtext =QPlainTextEdit()
totext = QPlainTextEdit()
solvebutton = getcolorbutton(
globalconfig,
"",

View File

@ -8,7 +8,6 @@ from PyQt5.QtWidgets import (
QFormLayout,
QSizePolicy,
QPushButton,
QTextEdit,
QTabWidget,
QFileDialog,
QTabBar,
@ -459,7 +458,7 @@ class AnkiWindow(QWidget):
self.viewimagelabel = QLabel()
self.editpath.textChanged.connect(self.wrappedpixmap)
self.example = QPlainTextEdit()
self.remarks = QTextEdit()
self.remarks = QPlainTextEdit()
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"], colors=[""])
recordbtn1.statuschanged1.connect(
functools.partial(self.startorendrecord, "1", self.audiopath)

View File

@ -247,7 +247,6 @@ class Textbrowser:
self.jiaming_y_delta = 0
self.setselectable()
self.blockcount = 0
self.needdouble = False
self.iteryinyinglabelsave = {}
def setselectable(self):
@ -331,10 +330,6 @@ class Textbrowser:
self.textbrowser.insertPlainText(text)
def deletebetween(self, p1, p2):
if self.needdouble:
self.textcursorback.setPosition(p1, QTextCursor.MoveAnchor)
self.textcursorback.setPosition(p2, QTextCursor.KeepAnchor)
self.textcursorback.removeSelectedText()
self.textcursor.setPosition(p1, QTextCursor.MoveAnchor)
self.textcursor.setPosition(p2, QTextCursor.KeepAnchor)
self.textcursor.removeSelectedText()

View File

@ -1,5 +1,4 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QTabWidget, QTextBrowser, QAction, QMenu, QFileDialog
from PyQt5.QtWidgets import QPlainTextEdit, QAction, QMenu, QFileDialog
from PyQt5.QtCore import Qt, pyqtSignal
import qtawesome, functools, winsharedutils
from gui.usefulwidget import closeashidewindow
@ -26,14 +25,13 @@ class transhist(closeashidewindow):
self.setWindowIcon(qtawesome.icon("fa.rotate-left"))
def gettb(_type):
textOutput = QTextBrowser()
textOutput = QPlainTextEdit()
textOutput.setContextMenuPolicy(Qt.CustomContextMenu)
textOutput.customContextMenuRequested.connect(
functools.partial(self.showmenu, textOutput, _type)
)
textOutput.setUndoRedoEnabled(False)
textOutput.setReadOnly(True)
textOutput.setObjectName("textOutput")
return textOutput
self.textOutput = gettb(1)
@ -76,14 +74,14 @@ class transhist(closeashidewindow):
def getnewsentence(self, sentence):
sentence = "<hr>" if globalconfig["hist_split"] else "\n" + sentence
sentence = "\n" + sentence
if self.hiderawflag:
sentence = ""
self.textOutput.append(sentence)
self.textOutput.appendPlainText(sentence)
def getnewtrans(self, api, sentence):
if self.hideapiflag:
res = sentence
else:
res = api + " " + sentence
self.textOutput.append(res)
self.textOutput.appendPlainText(res)

View File

@ -68,7 +68,6 @@
"arabic_reshaper": false
},
"uselongtermcache": false,
"hist_split": false,
"fixedheight": false,
"showintab": true,
"remove_useless_hook": false,