summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-03-06 00:57:42 +0100
committerkobewi <kobewi4e@gmail.com>2022-03-06 00:57:42 +0100
commit7d44bb8f0652e0f592030b3e296e835d72edc70f (patch)
treedcadf2b84f904d07951d2083f23d3f486377bcdc
parentd37e8586becf5e3abda5d3b13a06e4fd664364bc (diff)
Remove set_as_minsize()
-rw-r--r--editor/animation_bezier_editor.cpp2
-rw-r--r--editor/animation_track_editor.cpp8
-rw-r--r--editor/editor_node.cpp8
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/editor_properties_array_dict.cpp4
-rw-r--r--editor/editor_resource_picker.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
-rw-r--r--scene/gui/color_picker.cpp2
-rw-r--r--scene/gui/popup.cpp4
-rw-r--r--scene/gui/popup.h2
-rw-r--r--scene/gui/popup_menu.cpp2
11 files changed, 18 insertions, 24 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index c8c8c7d891..0dbe230699 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -946,7 +946,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (menu->get_item_count()) {
- menu->set_as_minsize();
+ menu->reset_size();
menu->set_position(popup_pos);
menu->popup();
}
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 53f585d06b..3970fca3b5 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -2748,7 +2748,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
menu->add_icon_item(get_theme_icon(SNAME("TrackDiscrete"), SNAME("EditorIcons")), TTR("Discrete"), MENU_CALL_MODE_DISCRETE);
menu->add_icon_item(get_theme_icon(SNAME("TrackTrigger"), SNAME("EditorIcons")), TTR("Trigger"), MENU_CALL_MODE_TRIGGER);
menu->add_icon_item(get_theme_icon(SNAME("TrackCapture"), SNAME("EditorIcons")), TTR("Capture"), MENU_CALL_MODE_CAPTURE);
- menu->set_as_minsize();
+ menu->reset_size();
Vector2 popup_pos = get_screen_position() + update_mode_rect.position + Vector2(0, update_mode_rect.size.height);
menu->set_position(popup_pos);
@@ -2766,7 +2766,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
menu->add_icon_item(get_theme_icon(SNAME("InterpRaw"), SNAME("EditorIcons")), TTR("Nearest"), MENU_INTERPOLATION_NEAREST);
menu->add_icon_item(get_theme_icon(SNAME("InterpLinear"), SNAME("EditorIcons")), TTR("Linear"), MENU_INTERPOLATION_LINEAR);
menu->add_icon_item(get_theme_icon(SNAME("InterpCubic"), SNAME("EditorIcons")), TTR("Cubic"), MENU_INTERPOLATION_CUBIC);
- menu->set_as_minsize();
+ menu->reset_size();
Vector2 popup_pos = get_screen_position() + interp_mode_rect.position + Vector2(0, interp_mode_rect.size.height);
menu->set_position(popup_pos);
@@ -2783,7 +2783,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
menu->clear();
menu->add_icon_item(get_theme_icon(SNAME("InterpWrapClamp"), SNAME("EditorIcons")), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP);
menu->add_icon_item(get_theme_icon(SNAME("InterpWrapLoop"), SNAME("EditorIcons")), TTR("Wrap Loop Interp"), MENU_LOOP_WRAP);
- menu->set_as_minsize();
+ menu->reset_size();
Vector2 popup_pos = get_screen_position() + loop_wrap_rect.position + Vector2(0, loop_wrap_rect.size.height);
menu->set_position(popup_pos);
@@ -2885,7 +2885,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
menu->add_separator();
menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete Key(s)"), MENU_KEY_DELETE);
}
- menu->set_as_minsize();
+ menu->reset_size();
menu->set_position(get_screen_position() + get_local_mouse_position());
menu->popup();
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ef744d8ece..33864df7d3 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -732,7 +732,7 @@ void EditorNode::_notification(int p_what) {
}
_update_scene_tabs();
- recent_scenes->set_as_minsize();
+ recent_scenes->reset_size();
// debugger area
if (EditorDebuggerNode::get_singleton()->is_visible()) {
@@ -3791,7 +3791,7 @@ void EditorNode::_update_recent_scenes() {
recent_scenes->add_separator();
recent_scenes->add_shortcut(ED_SHORTCUT("editor/clear_recent", TTR("Clear Recent Scenes")));
- recent_scenes->set_as_minsize();
+ recent_scenes->reset_size();
}
void EditorNode::_quick_opened() {
@@ -5432,7 +5432,7 @@ void EditorNode::remove_tool_menu_item(const String &p_name) {
memdelete(n);
}
tool_menu->remove_item(i);
- tool_menu->set_as_minsize();
+ tool_menu->reset_size();
return;
}
}
@@ -6211,7 +6211,7 @@ EditorNode::EditorNode() {
dock_vb->add_child(dock_float);
- dock_select_popup->set_as_minsize();
+ dock_select_popup->reset_size();
dock_select_rect_over = -1;
dock_popup_selected = -1;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index e0ef592ce7..d93d495ff6 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -1185,7 +1185,7 @@ void EditorPropertyLayers::_button_pressed() {
}
Rect2 gp = button->get_screen_rect();
- layers->set_as_minsize();
+ layers->reset_size();
Vector2 popup_pos = gp.position - Vector2(layers->get_contents_minimum_size().x, 0);
layers->set_position(popup_pos);
layers->popup();
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 61261af608..d354be9af5 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -175,7 +175,7 @@ void EditorPropertyArray::_change_type(Object *p_button, int p_index) {
Button *button = Object::cast_to<Button>(p_button);
changing_type_index = p_index;
Rect2 rect = button->get_screen_rect();
- change_type->set_as_minsize();
+ change_type->reset_size();
change_type->set_position(rect.get_end() - Vector2(change_type->get_contents_minimum_size().x, 0));
change_type->popup();
}
@@ -751,7 +751,7 @@ void EditorPropertyDictionary::_change_type(Object *p_button, int p_index) {
Button *button = Object::cast_to<Button>(p_button);
Rect2 rect = button->get_screen_rect();
- change_type->set_as_minsize();
+ change_type->reset_size();
change_type->set_position(rect.get_end() - Vector2(change_type->get_contents_minimum_size().x, 0));
change_type->popup();
changing_type_index = p_index;
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index fc1e466e9b..e6ff253212 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -149,7 +149,7 @@ void EditorResourcePicker::_update_menu() {
_update_menu_items();
Rect2 gt = edit_button->get_screen_rect();
- edit_menu->set_as_minsize();
+ edit_menu->reset_size();
int ms = edit_menu->get_contents_minimum_size().width;
Vector2 popup_pos = gt.get_end() - Vector2(ms, 0);
edit_menu->set_position(popup_pos);
@@ -476,7 +476,7 @@ void EditorResourcePicker::_button_input(const Ref<InputEvent> &p_event) {
_update_menu_items();
Vector2 pos = get_screen_position() + mb->get_position();
- edit_menu->set_as_minsize();
+ edit_menu->reset_size();
edit_menu->set_position(pos);
edit_menu->popup();
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 827eeababf..43467a6c41 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -682,7 +682,7 @@ void ScriptEditor::_update_recent_scripts() {
recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")));
recent_scripts->set_item_disabled(recent_scripts->get_item_id(recent_scripts->get_item_count() - 1), rc.is_empty());
- recent_scripts->set_as_minsize();
+ recent_scripts->reset_size();
}
void ScriptEditor::_open_recent_script(int p_idx) {
@@ -1635,7 +1635,7 @@ void ScriptEditor::_notification(int p_what) {
filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
- recent_scripts->set_as_minsize();
+ recent_scripts->reset_size();
if (is_inside_tree()) {
_update_script_colors();
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index aa4391e9f1..9f32ac223c 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -1304,7 +1304,7 @@ void ColorPickerButton::pressed() {
Size2 size = get_size() * get_viewport()->get_canvas_transform().get_scale();
- popup->set_as_minsize();
+ popup->reset_size();
picker->_update_presets();
Rect2i usable_rect = popup->get_usable_parent_rect();
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index 24b91cd16a..b9e3e7814e 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -111,10 +111,6 @@ void Popup::_close_pressed() {
call_deferred(SNAME("hide"));
}
-void Popup::set_as_minsize() {
- set_size(get_contents_minimum_size());
-}
-
void Popup::_bind_methods() {
ADD_SIGNAL(MethodInfo("popup_hide"));
}
diff --git a/scene/gui/popup.h b/scene/gui/popup.h
index a3c56c9ff1..c45f4ddc24 100644
--- a/scene/gui/popup.h
+++ b/scene/gui/popup.h
@@ -58,8 +58,6 @@ protected:
static void _bind_methods();
public:
- void set_as_minsize();
-
Popup();
~Popup();
};
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index af2edfa090..840c3d5c31 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -186,7 +186,7 @@ void PopupMenu::_activate_submenu(int p_over) {
float scroll_offset = control->get_position().y;
- submenu_popup->set_as_minsize(); // Shrink the popup size to its contents.
+ submenu_popup->reset_size(); // Shrink the popup size to its contents.
Size2 submenu_size = submenu_popup->get_size();
Point2 submenu_pos;