You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Merge pull request #91252 from timothyqiu/control-category
Only add warning label for Layout group in Control category
This commit is contained in:
@@ -413,7 +413,15 @@ bool EditorInspectorPluginControl::can_handle(Object *p_object) {
|
|||||||
return Object::cast_to<Control>(p_object) != nullptr;
|
return Object::cast_to<Control>(p_object) != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorInspectorPluginControl::parse_category(Object *p_object, const String &p_category) {
|
||||||
|
inside_control_category = p_category == "Control";
|
||||||
|
}
|
||||||
|
|
||||||
void EditorInspectorPluginControl::parse_group(Object *p_object, const String &p_group) {
|
void EditorInspectorPluginControl::parse_group(Object *p_object, const String &p_group) {
|
||||||
|
if (!inside_control_category) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Control *control = Object::cast_to<Control>(p_object);
|
Control *control = Object::cast_to<Control>(p_object);
|
||||||
if (!control || p_group != "Layout") {
|
if (!control || p_group != "Layout") {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -127,8 +127,11 @@ public:
|
|||||||
class EditorInspectorPluginControl : public EditorInspectorPlugin {
|
class EditorInspectorPluginControl : public EditorInspectorPlugin {
|
||||||
GDCLASS(EditorInspectorPluginControl, EditorInspectorPlugin);
|
GDCLASS(EditorInspectorPluginControl, EditorInspectorPlugin);
|
||||||
|
|
||||||
|
bool inside_control_category = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool can_handle(Object *p_object) override;
|
virtual bool can_handle(Object *p_object) override;
|
||||||
|
virtual void parse_category(Object *p_object, const String &p_category) override;
|
||||||
virtual void parse_group(Object *p_object, const String &p_group) override;
|
virtual void parse_group(Object *p_object, const String &p_group) override;
|
||||||
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;
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user