Skip to content

Commit

Permalink
CodeView: Add decompilation options toggle, hide by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Feb 23, 2024
1 parent f1370c6 commit 26ff55e
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions angrmanagement/ui/views/code_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
from angr.sim_variable import SimMemoryVariable
from PySide6.QtCore import Qt
from PySide6.QtGui import QTextCursor
from PySide6.QtWidgets import QComboBox, QDockWidget, QFrame, QHBoxLayout, QMainWindow, QTextEdit, QVBoxLayout, QWidget
from PySide6.QtWidgets import (
QComboBox,
QDockWidget,
QFrame,
QHBoxLayout,
QMainWindow,
QTextEdit,
QToolButton,
QVBoxLayout,
QWidget,
)

from angrmanagement.config import Conf
from angrmanagement.data.jobs import DecompileFunctionJob, VariableRecoveryJob
Expand Down Expand Up @@ -450,15 +460,14 @@ def _init_widgets(self):
self._textedit = QCCodeEdit(self)
self._textedit.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
self._textedit.setLineWrapMode(QCCodeEdit.NoWrap)
textedit_dock = QDockWidget("Code", self._textedit)
window.setCentralWidget(textedit_dock)
textedit_dock.setWidget(self._textedit)
window.setCentralWidget(self._textedit)

# decompilation
# decompilation options
self._options = QDecompilationOptions(self, self.instance)
options_dock = QDockWidget("Decompilation Options", self._options)
window.addDockWidget(Qt.RightDockWidgetArea, options_dock)
options_dock.setWidget(self._options)
options_dock.setVisible(False)

# status bar
status_bar = QFrame()
Expand All @@ -471,6 +480,9 @@ def _init_widgets(self):
status_layout = QHBoxLayout()
status_layout.addWidget(self._nav_toolbar.qtoolbar())
status_layout.addStretch(0)
options_toggle_btn = QToolButton()
options_toggle_btn.setDefaultAction(options_dock.toggleViewAction())
status_layout.addWidget(options_toggle_btn)
status_layout.addWidget(self._view_selector)
status_layout.setContentsMargins(3, 3, 3, 3)
status_layout.setSpacing(3)
Expand Down

0 comments on commit 26ff55e

Please sign in to comment.