Skip to content

Commit 78f03f8

Browse files
committed
Merge pull request #91252 from timothyqiu/control-category
Only add warning label for Layout group in Control category
2 parents 947f5a8 + bd716a6 commit 78f03f8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

editor/plugins/control_editor_plugin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,15 @@ bool EditorInspectorPluginControl::can_handle(Object *p_object) {
413413
return Object::cast_to<Control>(p_object) != nullptr;
414414
}
415415

416+
void EditorInspectorPluginControl::parse_category(Object *p_object, const String &p_category) {
417+
inside_control_category = p_category == "Control";
418+
}
419+
416420
void EditorInspectorPluginControl::parse_group(Object *p_object, const String &p_group) {
421+
if (!inside_control_category) {
422+
return;
423+
}
424+
417425
Control *control = Object::cast_to<Control>(p_object);
418426
if (!control || p_group != "Layout") {
419427
return;

editor/plugins/control_editor_plugin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ class EditorPropertySizeFlags : public EditorProperty {
127127
class EditorInspectorPluginControl : public EditorInspectorPlugin {
128128
GDCLASS(EditorInspectorPluginControl, EditorInspectorPlugin);
129129

130+
bool inside_control_category = false;
131+
130132
public:
131133
virtual bool can_handle(Object *p_object) override;
134+
virtual void parse_category(Object *p_object, const String &p_category) override;
132135
virtual void parse_group(Object *p_object, const String &p_group) override;
133136
virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField<PropertyUsageFlags> p_usage, const bool p_wide = false) override;
134137
};

0 commit comments

Comments
 (0)