diff options
Diffstat (limited to 'editor/progress_dialog.cpp')
-rw-r--r-- | editor/progress_dialog.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 541cba836b..0b6a3798b3 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ #include "progress_dialog.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "core/os/os.h" #include "editor_scale.h" #include "main/main.h" @@ -50,7 +50,7 @@ void BackgroundProgress::_add_task(const String &p_task, const String &p_label, Control *ec = memnew(Control); ec->set_h_size_flags(SIZE_EXPAND_FILL); ec->set_v_size_flags(SIZE_EXPAND_FILL); - t.progress->set_anchors_and_margins_preset(Control::PRESET_WIDE); + t.progress->set_anchors_and_offsets_preset(Control::PRESET_WIDE); ec->add_child(t.progress); ec->set_custom_minimum_size(Size2(80, 5) * EDSCALE); t.hb->add_child(ec); @@ -111,7 +111,7 @@ void BackgroundProgress::task_step(const String &p_task, int p_step) { bool no_updates = true; { _THREAD_SAFE_METHOD_ - no_updates = updates.empty(); + no_updates = updates.is_empty(); } if (no_updates) { @@ -141,10 +141,10 @@ void ProgressDialog::_popup() { Ref<StyleBox> style = main->get_theme_stylebox("panel", "PopupMenu"); ms += style->get_minimum_size(); - main->set_margin(MARGIN_LEFT, style->get_margin(MARGIN_LEFT)); - main->set_margin(MARGIN_RIGHT, -style->get_margin(MARGIN_RIGHT)); - main->set_margin(MARGIN_TOP, style->get_margin(MARGIN_TOP)); - main->set_margin(MARGIN_BOTTOM, -style->get_margin(MARGIN_BOTTOM)); + main->set_offset(SIDE_LEFT, style->get_margin(SIDE_LEFT)); + main->set_offset(SIDE_RIGHT, -style->get_margin(SIDE_RIGHT)); + main->set_offset(SIDE_TOP, style->get_margin(SIDE_TOP)); + main->set_offset(SIDE_BOTTOM, -style->get_margin(SIDE_BOTTOM)); //raise(); popup_centered(ms); @@ -218,7 +218,7 @@ void ProgressDialog::end_task(const String &p_task) { memdelete(t.vb); tasks.erase(p_task); - if (tasks.empty()) { + if (tasks.is_empty()) { hide(); } else { _popup(); @@ -235,7 +235,7 @@ void ProgressDialog::_bind_methods() { ProgressDialog::ProgressDialog() { main = memnew(VBoxContainer); add_child(main); - main->set_anchors_and_margins_preset(Control::PRESET_WIDE); + main->set_anchors_and_offsets_preset(Control::PRESET_WIDE); set_exclusive(true); last_progress_tick = 0; singleton = this; |