summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-10-19 19:34:35 +0300
committerAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-10-19 19:34:35 +0300
commit9c3a33a4e8166f814d58549555e602912ee0d604 (patch)
tree9492f83cd6905e17955ad8bb7d7a676f61459ada /scene/gui
parentb9d48031e843395fd3117af5af1a40cdc5a884c0 (diff)
Fixup `ColorRect` and `TextureRect` renames
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/color_rect.cpp14
-rw-r--r--scene/gui/color_rect.h8
-rw-r--r--scene/gui/nine_patch_rect.h1
-rw-r--r--scene/gui/texture_rect.h7
4 files changed, 13 insertions, 17 deletions
diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp
index 627e589c02..0c38b93c60 100644
--- a/scene/gui/color_rect.cpp
+++ b/scene/gui/color_rect.cpp
@@ -30,12 +30,12 @@
#include "color_rect.h"
-void ColorRect::set_frame_color(const Color &p_color) {
+void ColorRect::set_color(const Color &p_color) {
color = p_color;
update();
}
-Color ColorRect::get_frame_color() const {
+Color ColorRect::get_color() const {
return color;
}
@@ -46,12 +46,8 @@ void ColorRect::_notification(int p_what) {
}
void ColorRect::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_frame_color", "color"), &ColorRect::set_frame_color);
- ClassDB::bind_method(D_METHOD("get_frame_color"), &ColorRect::get_frame_color);
+ ClassDB::bind_method(D_METHOD("set_color", "color"), &ColorRect::set_color);
+ ClassDB::bind_method(D_METHOD("get_color"), &ColorRect::get_color);
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_frame_color", "get_frame_color");
-}
-
-ColorRect::ColorRect() {
- color = Color(1, 1, 1);
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
}
diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h
index 3df44b9334..61d57f7cca 100644
--- a/scene/gui/color_rect.h
+++ b/scene/gui/color_rect.h
@@ -36,17 +36,15 @@
class ColorRect : public Control {
GDCLASS(ColorRect, Control);
- Color color;
+ Color color = Color(1, 1, 1);
protected:
void _notification(int p_what);
static void _bind_methods();
public:
- void set_frame_color(const Color &p_color);
- Color get_frame_color() const;
-
- ColorRect();
+ void set_color(const Color &p_color);
+ Color get_color() const;
};
#endif // COLOR_RECT_H
diff --git a/scene/gui/nine_patch_rect.h b/scene/gui/nine_patch_rect.h
index 487fe4c860..a539ad43c0 100644
--- a/scene/gui/nine_patch_rect.h
+++ b/scene/gui/nine_patch_rect.h
@@ -79,4 +79,5 @@ public:
};
VARIANT_ENUM_CAST(NinePatchRect::AxisStretchMode)
+
#endif // NINE_PATCH_RECT_H
diff --git a/scene/gui/texture_rect.h b/scene/gui/texture_rect.h
index efd3f0698a..e39545f679 100644
--- a/scene/gui/texture_rect.h
+++ b/scene/gui/texture_rect.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef TEXTURE_FRAME_H
-#define TEXTURE_FRAME_H
+#ifndef TEXTURE_RECT_H
+#define TEXTURE_RECT_H
#include "scene/gui/control.h"
@@ -83,4 +83,5 @@ public:
};
VARIANT_ENUM_CAST(TextureRect::StretchMode);
-#endif // TEXTURE_FRAME_H
+
+#endif // TEXTURE_RECT_H