summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.h1
-rw-r--r--scene/gui/control.cpp23
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/flow_container.cpp2
-rw-r--r--scene/gui/flow_container.h2
-rw-r--r--scene/gui/graph_edit.h2
-rw-r--r--scene/gui/link_button.h1
-rw-r--r--scene/gui/popup_menu.cpp1
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/gui/scroll_container.cpp2
10 files changed, 24 insertions, 14 deletions
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index 0bcad4fc0e..6bfffe7575 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -31,6 +31,7 @@
#ifndef BASE_BUTTON_H
#define BASE_BUTTON_H
+#include "core/input/shortcut.h"
#include "scene/gui/control.h"
class ButtonGroup;
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index aa59df6337..943ba8dfb1 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1585,14 +1585,25 @@ void Control::set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos,
}
void Control::_set_anchors_layout_preset(int p_preset) {
- set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS);
+ bool list_changed = false;
+
+ if (has_meta("_edit_layout_mode") && (int)get_meta("_edit_layout_mode") != (int)LayoutMode::LAYOUT_MODE_ANCHORS) {
+ list_changed = true;
+ set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS);
+ }
if (p_preset == -1) {
- set_meta("_edit_use_custom_anchors", true);
- notify_property_list_changed();
+ if (!has_meta("_edit_use_custom_anchors") || !(bool)get_meta("_edit_use_custom_anchors")) {
+ set_meta("_edit_use_custom_anchors", true);
+ notify_property_list_changed();
+ }
return; // Keep settings as is.
}
- set_meta("_edit_use_custom_anchors", false);
+
+ if (!has_meta("_edit_use_custom_anchors") || (bool)get_meta("_edit_use_custom_anchors")) {
+ list_changed = true;
+ set_meta("_edit_use_custom_anchors", false);
+ }
LayoutPreset preset = (LayoutPreset)p_preset;
// Set correct anchors.
@@ -1625,7 +1636,9 @@ void Control::_set_anchors_layout_preset(int p_preset) {
// Select correct grow directions.
set_grow_direction_preset(preset);
- notify_property_list_changed();
+ if (list_changed) {
+ notify_property_list_changed();
+ }
}
int Control::_get_anchors_layout_preset() const {
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 7024164e6c..becb50a118 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -31,12 +31,10 @@
#ifndef CONTROL_H
#define CONTROL_H
-#include "core/input/shortcut.h"
#include "core/math/transform_2d.h"
#include "core/object/gdvirtual.gen.inc"
#include "core/templates/rid.h"
#include "scene/main/canvas_item.h"
-#include "scene/main/node.h"
#include "scene/main/timer.h"
#include "scene/resources/theme.h"
diff --git a/scene/gui/flow_container.cpp b/scene/gui/flow_container.cpp
index ba487b2905..e806a4a8a6 100644
--- a/scene/gui/flow_container.cpp
+++ b/scene/gui/flow_container.cpp
@@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "scene/gui/container.h"
-
#include "flow_container.h"
struct _LineData {
diff --git a/scene/gui/flow_container.h b/scene/gui/flow_container.h
index 84f2ae4ae3..a2da43e071 100644
--- a/scene/gui/flow_container.h
+++ b/scene/gui/flow_container.h
@@ -31,7 +31,7 @@
#ifndef FLOW_CONTAINER_H
#define FLOW_CONTAINER_H
-class Container;
+#include "scene/gui/container.h"
class FlowContainer : public Container {
GDCLASS(FlowContainer, Container);
diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h
index da973b46f0..b0d1944d6e 100644
--- a/scene/gui/graph_edit.h
+++ b/scene/gui/graph_edit.h
@@ -36,9 +36,7 @@
#include "scene/gui/graph_node.h"
#include "scene/gui/label.h"
#include "scene/gui/scroll_bar.h"
-#include "scene/gui/slider.h"
#include "scene/gui/spin_box.h"
-#include "scene/gui/texture_rect.h"
class GraphEdit;
class ViewPanner;
diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h
index 7d302e967d..a455e866b1 100644
--- a/scene/gui/link_button.h
+++ b/scene/gui/link_button.h
@@ -32,7 +32,6 @@
#define LINKBUTTON_H
#include "scene/gui/base_button.h"
-#include "scene/resources/bit_map.h"
#include "scene/resources/text_line.h"
class LinkButton : public BaseButton {
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 61a5fb999c..5c86e1850e 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -30,6 +30,7 @@
#include "popup_menu.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 4d779f51e2..042aec7362 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -514,7 +514,7 @@ void RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
} break;
case ITEM_IMAGE: {
ItemImage *img = (ItemImage *)it;
- l.text_buf->add_object((uint64_t)it, img->image->get_size(), img->inline_align, 1);
+ l.text_buf->add_object((uint64_t)it, img->size, img->inline_align, 1);
text += String::chr(0xfffc);
l.char_count++;
remaining_characters--;
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 5e128d594c..7e69fa09e7 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -29,6 +29,8 @@
/*************************************************************************/
#include "scroll_container.h"
+
+#include "core/config/project_settings.h"
#include "core/os/os.h"
#include "scene/main/window.h"