fixed text editor popout window

master
BodgeMaster 2022-03-28 22:43:30 +02:00
parent 72d30b4688
commit 36fef1cfc1
1 changed files with 2 additions and 18 deletions

View File

@ -68,28 +68,12 @@ class Editor(Window):
#TODO: Figure out a way to do the fucking line numbers
#Text Editor
self.text_edit = QtWidgets.QPlainTextEdit(self)
self.text_edit = QtWidgets.QPlainTextEdit()
self.text_edit.setFrameStyle(QtWidgets.QFrame.NoFrame)
self.setCentralWidget(self.text_edit)
self.set_size(size[0], size[1])
#layout
#FIXME: Somehow this places the editor behind the menu bar so that the
# first couple lines are cut off
layout = QtWidgets.QHBoxLayout()
layout.addChildWidget(self.text_edit)
self.setLayout(layout)
super().on_resize(lambda event: self.set_size(event.size().width(), event.size().height()))
#FIXME: This function is inherently flawed because it doesn't take the
# actual height of the usable area inside the window into account.
# On a side note: This should be taken care of by the toolkit (Qt).
def set_size(self, size_x, size_y):
self.text_edit.resize(size_x, size_y)
self.resize(size_x, size_y)
class Message(QtWidgets.QMessageBox):
def __init__(self, title, text):