diff --git a/angrmanagement/ui/dialogs/analysis_options.py b/angrmanagement/ui/dialogs/analysis_options.py index 3fa5df1fe..cf90ad405 100644 --- a/angrmanagement/ui/dialogs/analysis_options.py +++ b/angrmanagement/ui/dialogs/analysis_options.py @@ -210,8 +210,10 @@ def __init__(self, analyses: AnalysesConfiguration, workspace: "Workspace", pare self._workspace: Workspace = workspace self._analyses: AnalysesConfiguration = analyses self._mappers: Sequence[AnalysisOptionWidgetMapper] = [] - self.setWindowTitle("Run Analysis") self._init_widgets() + self.setWindowTitle("Run Analysis") + self.setMinimumSize(self.sizeHint()) + self.adjustSize() def sizeHint(self, *args, **kwargs): # pylint: disable=unused-argument,no-self-use return QSize(800, 600) diff --git a/angrmanagement/ui/dialogs/assemble_patch.py b/angrmanagement/ui/dialogs/assemble_patch.py index e900a76e3..49699f323 100644 --- a/angrmanagement/ui/dialogs/assemble_patch.py +++ b/angrmanagement/ui/dialogs/assemble_patch.py @@ -54,9 +54,8 @@ def __init__(self, address: int, instance: "Instance", parent=None): self._init_widgets() self.setWindowTitle(f"Assemble Patch at {self._patch_addr:#x}") - - def sizeHint(self): # pylint:disable=no-self-use - return QSize(400, 150) + self.setMinimumWidth(500) + self.adjustSize() # # Private methods diff --git a/angrmanagement/ui/dialogs/command_palette.py b/angrmanagement/ui/dialogs/command_palette.py index cff848725..4d6149842 100644 --- a/angrmanagement/ui/dialogs/command_palette.py +++ b/angrmanagement/ui/dialogs/command_palette.py @@ -221,13 +221,16 @@ class PaletteDialog(QDialog): def __init__(self, model, delegate=None, parent=None): super().__init__(parent) - self.setWindowTitle("Palette") self._model = model self._delegate = delegate or PaletteItemDelegate() self._init_widgets() self.selected_item = None + self.setWindowTitle("Palette") + self.setMinimumSize(self.sizeHint()) + self.adjustSize() + def sizeHint(self): # pylint:disable=no-self-use return QSize(500, 400) diff --git a/angrmanagement/ui/dialogs/function.py b/angrmanagement/ui/dialogs/function.py index 382d2e5e3..c7a014c24 100644 --- a/angrmanagement/ui/dialogs/function.py +++ b/angrmanagement/ui/dialogs/function.py @@ -29,12 +29,11 @@ def __init__(self, function, parent=None): super().__init__(parent) self.workspace = GlobalInfo.main_window.workspace self.function = function + self._init_widgets() self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) self.setWindowTitle(f"Function {self.function.name}") - self._init_widgets() - - def sizeHint(self, *args, **kwargs): # pylint: disable=unused-argument,no-self-use - return QSize(600, 300) + self.setMinimumWidth(600) + self.adjustSize() def _init_widgets(self): font = QFont(Conf.disasm_font) diff --git a/angrmanagement/ui/dialogs/xref.py b/angrmanagement/ui/dialogs/xref.py index 1b139ee1c..4791d6561 100644 --- a/angrmanagement/ui/dialogs/xref.py +++ b/angrmanagement/ui/dialogs/xref.py @@ -27,8 +27,6 @@ def __init__( ): super().__init__(parent) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint | Qt.WindowCloseButtonHint) - self._variable_manager = variable_manager self._variable = variable self._xrefs_manager = xrefs_manager @@ -54,6 +52,10 @@ def __init__( self._init_widgets() + self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint | Qt.WindowCloseButtonHint) + self.setMinimumSize(self.sizeHint()) + self.adjustSize() + def sizeHint(self, *args, **kwargs): # pylint: disable=unused-argument,no-self-use return QSize(600, 400)