Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster 48b969fda1 disable word wrap because why not 2022-03-28 23:04:29 +02:00
BodgeMaster 36fef1cfc1 fixed text editor popout window 2022-03-28 22:44:00 +02:00
1 changed files with 3 additions and 18 deletions

View File

@ -68,28 +68,13 @@ 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.text_edit.setWordWrapMode(QtGui.QTextOption.NoWrap)
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):