Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs: Call setMinimumSize and adjustSize #1140

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion angrmanagement/ui/dialogs/analysis_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions angrmanagement/ui/dialogs/assemble_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from typing import TYPE_CHECKING, Optional

from PySide6.QtCore import QSize
from PySide6.QtGui import QFont
from PySide6.QtWidgets import (
QCheckBox,
Expand Down Expand Up @@ -54,9 +53,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
Expand Down
5 changes: 4 additions & 1 deletion angrmanagement/ui/dialogs/command_palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 4 additions & 5 deletions angrmanagement/ui/dialogs/function.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pygments.lexers.c_cpp import CLexer
from pyqodeng.core.api import CodeEdit
from pyqodeng.core.modes import PygmentsSyntaxHighlighter
from PySide6.QtCore import QSize, Qt
from PySide6.QtCore import Qt
from PySide6.QtGui import QFont
from PySide6.QtWidgets import (
QCheckBox,
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions angrmanagement/ui/dialogs/xref.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
Loading