From f273d760c254176dcfc746deb3a16348fdcea87c Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 26 Jun 2025 14:04:37 +0800 Subject: Fold the base structure fields in the create structure dialog by default. Fix https://github.com/Vector35/binaryninja-api/issues/4268 --- ui/createstructdialog.h | 3 +++ ui/expandablegroup.h | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'ui') 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 #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 m_typeContainer; BinaryNinja::QualifiedName m_resultName; @@ -92,6 +94,7 @@ class BINARYNINJAUIAPI CreateStructDialog : public QDialog std::vector 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; } }; -- cgit v1.3.1