resize console window only once and make sure it has minimum size

This commit is contained in:
iLLiCiTiT 2021-09-15 10:38:50 +02:00
parent 0ff8e4a5ea
commit b12bc7b6a5

View file

@ -387,8 +387,6 @@ class PythonInterpreterWidget(QtWidgets.QWidget):
self.setStyleSheet(load_stylesheet())
self.resize(self.default_width, self.default_height)
self._init_from_registry()
if self._tab_widget.count() < 1:
@ -396,16 +394,23 @@ class PythonInterpreterWidget(QtWidgets.QWidget):
def _init_from_registry(self):
setting_registry = PythonInterpreterRegistry()
width = None
height = None
try:
width = setting_registry.get_item("width")
height = setting_registry.get_item("height")
if width is not None and height is not None:
self.resize(width, height)
except ValueError:
pass
if width is None or width < 200:
width = self.default_width
if height is None or height < 200:
height = self.default_height
self.resize(width, height)
try:
sizes = setting_registry.get_item("splitter_sizes")
if len(sizes) == len(self._widgets_splitter.sizes()):