Fix stack-overflow when auto-sizing dropdowns.

Fix combobox button click not closing the popup listbox when clicking the button with a visible popup listbox.
Fix some incorrect size policies in UIFileDialog.
This commit is contained in:
Martín Lucas Golini
2026-08-20 14:01:42 -03:00
parent 503cd890a5
commit f193047f1e
8 changed files with 46 additions and 16 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ class EE_API UIComboBox : public UIWidget {
UIDropDownList* getDropDownList() const { return mDropDownList; }
UINode* getButton() const { return mButton; }
UIWidget* getButton() const { return mButton; }
const String& getText();
@@ -38,7 +38,7 @@ class EE_API UIComboBox : public UIWidget {
protected:
UIDropDownList* mDropDownList;
UINode* mButton;
UIWidget* mButton;
UIComboBox();
+10 -1
View File
@@ -51,15 +51,24 @@ class EE_API UIDropDown : public UITextInput {
const Uint32& propertyIndex = 0 ) const;
virtual std::vector<PropertyId> getPropertiesImplemented() const;
void addRelatedWidget( UIWidget* widget ) { mRelatedWidgets.push_back( widget ); }
void removeRelatedWidget( UIWidget* widget ) {
mRelatedWidgets.erase(
std::find( mRelatedWidgets.begin(), mRelatedWidgets.end(), widget ) );
}
protected:
StyleConfig mStyleConfig;
UINode* mFriendNode{ nullptr };
Uint64 mLastFocusLoss{ 0 };
std::vector<UIWidget*> mRelatedWidgets;
UIDropDown( const std::string& tag );
virtual UIWidget* getPopUpWidget() const;
void onPopUpFocusLoss( const Event* Event );
virtual void onPopUpFocusLoss();
virtual void onItemSelected( const Event* Event );
virtual void show();
+1
View File
@@ -47,6 +47,7 @@ enum UIFlag : Int64 {
UI_HTML_ELEMENT = ( 1ULL << 31 ),
UI_CREATING_NODE = ( 1ULL << 32 ),
UI_IGNORE_GLOBAL_CSS = ( 1ULL << 33 ),
UI_AUTO_SIZING = ( 1ULL << 34 ),
};
enum UINodeType {