Resize main window when toggling expert mode

This commit is contained in:
Piotr Dobrowolski 2018-08-28 15:10:35 +02:00
parent df6f0808a3
commit d6335e69bb

View File

@ -74,6 +74,7 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
def __init__(self, parent=None, app=None):
super(MainWindow, self).__init__(parent)
self.setWindowFlags(QtCore.Qt.Dialog)
# FIXME: dirty hack to solve relative paths in *.ui
oldcwd = os.getcwd()
@ -272,6 +273,8 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
@QtCore.Slot()
def on_expertModeBox_clicked(self):
self.expertForm.setVisible(self.expertModeBox.checkState())
self.centralwidget.setFixedHeight(self.centralwidget.sizeHint().height())
self.setFixedHeight(self.sizeHint().height())
if __name__ == "__main__":