Skip to content

Commit f273d76

Browse files
committed
Fold the base structure fields in the create structure dialog by default. Fix #4268
1 parent f96714b commit f273d76

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ui/createstructdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <QtWidgets/QComboBox>
1010
#include "binaryninjaapi.h"
1111
#include "uicontext.h"
12+
#include "expandablegroup.h"
1213

1314
/*!
1415
@@ -78,6 +79,7 @@ class BINARYNINJAUIAPI CreateStructDialog : public QDialog
7879
QPushButton* m_addBase;
7980
QCheckBox* m_propagateDataVarRefs;
8081
QCheckBox* m_pointer;
82+
ExpandableGroup* m_baseStructGroup;
8183

8284
std::optional<BinaryNinja::TypeContainer> m_typeContainer;
8385
BinaryNinja::QualifiedName m_resultName;
@@ -92,6 +94,7 @@ class BINARYNINJAUIAPI CreateStructDialog : public QDialog
9294

9395
std::vector<BinaryNinja::BaseStructure> m_bases;
9496

97+
void saveSettings();
9598
virtual void customEvent(QEvent* event) override;
9699

97100
public:

ui/expandablegroup.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ class BINARYNINJAUIAPI ExpandableGroup : public QWidget
2121
QParallelAnimationGroup* m_animation;
2222
QScrollArea* m_content;
2323
int m_duration = 100;
24+
bool m_expanded;
2425

2526
private Q_SLOTS:
2627
void toggled(bool expanded);
2728

29+
Q_SIGNALS:
30+
void sizeChanged();
31+
2832
public:
2933
explicit ExpandableGroup(QLayout* contentLayout, const QString& title = "", QWidget* parent = nullptr, bool expanded = false);
3034
void setupAnimation(QLayout* contentLayout);
3135
void setTitle(const QString& title) { m_title->setText(title); }
3236
void toggle(bool expanded);
37+
bool expanded() { return m_expanded; }
3338
};

0 commit comments

Comments
 (0)