Compare commits
	
		
			No commits in common. "48b969fda157bf453205f5cdc2502dd5c9848612" and "72d30b4688666df6ce11f62fab27714e31295469" have entirely different histories. 
		
	
	
		
			48b969fda1
			...
			72d30b4688
		
	
		|  | @ -68,13 +68,28 @@ class Editor(Window): | ||||||
|         #TODO: Figure out a way to do the fucking line numbers |         #TODO: Figure out a way to do the fucking line numbers | ||||||
| 
 | 
 | ||||||
|         #Text Editor |         #Text Editor | ||||||
|         self.text_edit = QtWidgets.QPlainTextEdit() |         self.text_edit = QtWidgets.QPlainTextEdit(self) | ||||||
|         self.text_edit.setFrameStyle(QtWidgets.QFrame.NoFrame) |         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]) |         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): | class Message(QtWidgets.QMessageBox): | ||||||
|     def __init__(self, title, text): |     def __init__(self, title, text): | ||||||
|  |  | ||||||
		Reference in New Issue