diff options
| author | Xusheng <xusheng@vector35.com> | 2025-06-26 14:04:37 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2025-06-26 14:04:37 +0800 |
| commit | f273d760c254176dcfc746deb3a16348fdcea87c (patch) | |
| tree | 270d06e43f96f551459b785688e219e30e540c7b | |
| parent | f96714b2b96d890004e20e027aa5c8ceac7af0e2 (diff) | |
Fold the base structure fields in the create structure dialog by default. Fix https://github.com/Vector35/binaryninja-api/issues/4268
| -rw-r--r-- | ui/createstructdialog.h | 3 | ||||
| -rw-r--r-- | ui/expandablegroup.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ui/createstructdialog.h b/ui/createstructdialog.h index 0e331a2a..8718325f 100644 --- a/ui/createstructdialog.h +++ b/ui/createstructdialog.h @@ -9,6 +9,7 @@ #include <QtWidgets/QComboBox> #include "binaryninjaapi.h" #include "uicontext.h" +#include "expandablegroup.h" /*! @@ -78,6 +79,7 @@ class BINARYNINJAUIAPI CreateStructDialog : public QDialog QPushButton* m_addBase; QCheckBox* m_propagateDataVarRefs; QCheckBox* m_pointer; + ExpandableGroup* m_baseStructGroup; std::optional<BinaryNinja::TypeContainer> m_typeContainer; BinaryNinja::QualifiedName m_resultName; @@ -92,6 +94,7 @@ class BINARYNINJAUIAPI CreateStructDialog : public QDialog std::vector<BinaryNinja::BaseStructure> m_bases; + void saveSettings(); virtual void customEvent(QEvent* event) override; public: diff --git a/ui/expandablegroup.h b/ui/expandablegroup.h index 1591c9a7..974249fa 100644 --- a/ui/expandablegroup.h +++ b/ui/expandablegroup.h @@ -21,13 +21,18 @@ class BINARYNINJAUIAPI ExpandableGroup : public QWidget QParallelAnimationGroup* m_animation; QScrollArea* m_content; int m_duration = 100; + bool m_expanded; private Q_SLOTS: void toggled(bool expanded); + Q_SIGNALS: + void sizeChanged(); + public: explicit ExpandableGroup(QLayout* contentLayout, const QString& title = "", QWidget* parent = nullptr, bool expanded = false); void setupAnimation(QLayout* contentLayout); void setTitle(const QString& title) { m_title->setText(title); } void toggle(bool expanded); + bool expanded() { return m_expanded; } }; |
