X-Git-Url: https://git.novaco.in/?p=electrum-nvc.git;a=blobdiff_plain;f=gui%2Fqt%2Fpaytoedit.py;h=f3063732d96c7d350337f45bdc4e1e620d06127b;hp=5beefc45413fdb50740129019d8e12951c9a3e4c;hb=c0fe5962ad32ab43d75b9cee124b860c0acbdf24;hpb=769b4002cd0c7e03ca9f490481e7e6d64a323a7d diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py index 5beefc4..f306373 100644 --- a/gui/qt/paytoedit.py +++ b/gui/qt/paytoedit.py @@ -28,7 +28,7 @@ RE_ADDRESS = '[1-9A-HJ-NP-Za-km-z]{26,}' RE_ALIAS = '(.*?)\s*\<([1-9A-HJ-NP-Za-km-z]{26,})\>' frozen_style = "QWidget { background-color:none; border:none;}" -normal_style = "QTextEdit { }" +normal_style = "QPlainTextEdit { }" class PayToEdit(QRTextEdit): @@ -39,8 +39,6 @@ class PayToEdit(QRTextEdit): self.document().contentsChanged.connect(self.update_size) self.heightMin = 0 self.heightMax = 150 - self.setMinimumHeight(27) - self.setMaximumHeight(27) self.c = None self.textChanged.connect(self.check_text) self.outputs = [] @@ -161,9 +159,11 @@ class PayToEdit(QRTextEdit): def update_size(self): docHeight = self.document().size().height() - if self.heightMin <= docHeight <= self.heightMax: - self.setMinimumHeight(docHeight + 2) - self.setMaximumHeight(docHeight + 2) + h = docHeight*17 + 11 + if self.heightMin <= h <= self.heightMax: + self.setMinimumHeight(h) + self.setMaximumHeight(h) + self.verticalScrollBar().hide() def setCompleter(self, completer): @@ -207,7 +207,7 @@ class PayToEdit(QRTextEdit): e.ignore() return - QTextEdit.keyPressEvent(self, e) + QPlainTextEdit.keyPressEvent(self, e) ctrlOrShift = e.modifiers() and (Qt.ControlModifier or Qt.ShiftModifier) if self.c is None or (ctrlOrShift and e.text().isEmpty()):