mirror of
https://github.com/godotengine/godot
synced 2024-09-05 19:39:49 +00:00
Rename Control PRESET_WIDE to PRESET_FULL_RECT
This commit is contained in:
parent
abe8b88702
commit
97dfbea6ad
|
@ -1281,8 +1281,8 @@
|
||||||
<constant name="PRESET_HCENTER_WIDE" value="14" enum="LayoutPreset">
|
<constant name="PRESET_HCENTER_WIDE" value="14" enum="LayoutPreset">
|
||||||
Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset].
|
Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset].
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="PRESET_WIDE" value="15" enum="LayoutPreset">
|
<constant name="PRESET_FULL_RECT" value="15" enum="LayoutPreset">
|
||||||
Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with [method set_anchors_preset].
|
Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. Use with [method set_anchors_preset].
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="PRESET_MODE_MINSIZE" value="0" enum="LayoutPresetMode">
|
<constant name="PRESET_MODE_MINSIZE" value="0" enum="LayoutPresetMode">
|
||||||
The control will be resized to its minimum size.
|
The control will be resized to its minimum size.
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) {
|
||||||
ActionMapEditor::ActionMapEditor() {
|
ActionMapEditor::ActionMapEditor() {
|
||||||
// Main Vbox Container
|
// Main Vbox Container
|
||||||
VBoxContainer *main_vbox = memnew(VBoxContainer);
|
VBoxContainer *main_vbox = memnew(VBoxContainer);
|
||||||
main_vbox->set_anchors_and_offsets_preset(PRESET_WIDE);
|
main_vbox->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
add_child(main_vbox);
|
add_child(main_vbox);
|
||||||
|
|
||||||
HBoxContainer *top_hbox = memnew(HBoxContainer);
|
HBoxContainer *top_hbox = memnew(HBoxContainer);
|
||||||
|
|
|
@ -1593,7 +1593,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() {
|
||||||
play_position = memnew(Control);
|
play_position = memnew(Control);
|
||||||
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
add_child(play_position);
|
add_child(play_position);
|
||||||
play_position->set_anchors_and_offsets_preset(PRESET_WIDE);
|
play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
play_position->connect("draw", callable_mp(this, &AnimationBezierTrackEdit::_play_position_draw));
|
play_position->connect("draw", callable_mp(this, &AnimationBezierTrackEdit::_play_position_draw));
|
||||||
set_focus_mode(FOCUS_CLICK);
|
set_focus_mode(FOCUS_CLICK);
|
||||||
|
|
||||||
|
|
|
@ -1890,7 +1890,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() {
|
||||||
play_position = memnew(Control);
|
play_position = memnew(Control);
|
||||||
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
add_child(play_position);
|
add_child(play_position);
|
||||||
play_position->set_anchors_and_offsets_preset(PRESET_WIDE);
|
play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
play_position->connect("draw", callable_mp(this, &AnimationTimelineEdit::_play_position_draw));
|
play_position->connect("draw", callable_mp(this, &AnimationTimelineEdit::_play_position_draw));
|
||||||
|
|
||||||
add_track = memnew(MenuButton);
|
add_track = memnew(MenuButton);
|
||||||
|
@ -2919,7 +2919,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
|
||||||
add_child(path_popup);
|
add_child(path_popup);
|
||||||
path = memnew(LineEdit);
|
path = memnew(LineEdit);
|
||||||
path_popup->add_child(path);
|
path_popup->add_child(path);
|
||||||
path->set_anchors_and_offsets_preset(PRESET_WIDE);
|
path->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
path->connect("text_submitted", callable_mp(this, &AnimationTrackEdit::_path_submitted));
|
path->connect("text_submitted", callable_mp(this, &AnimationTrackEdit::_path_submitted));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3212,7 +3212,7 @@ AnimationTrackEdit::AnimationTrackEdit() {
|
||||||
play_position = memnew(Control);
|
play_position = memnew(Control);
|
||||||
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
play_position->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
add_child(play_position);
|
add_child(play_position);
|
||||||
play_position->set_anchors_and_offsets_preset(PRESET_WIDE);
|
play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
play_position->connect("draw", callable_mp(this, &AnimationTrackEdit::_play_position_draw));
|
play_position->connect("draw", callable_mp(this, &AnimationTrackEdit::_play_position_draw));
|
||||||
set_focus_mode(FOCUS_CLICK);
|
set_focus_mode(FOCUS_CLICK);
|
||||||
set_mouse_filter(MOUSE_FILTER_PASS); // Scroll has to work too for selection.
|
set_mouse_filter(MOUSE_FILTER_PASS); // Scroll has to work too for selection.
|
||||||
|
@ -6245,7 +6245,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
|
||||||
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||||
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
||||||
info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
info_message->set_anchors_and_offsets_preset(PRESET_FULL_RECT, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
||||||
main_panel->add_child(info_message);
|
main_panel->add_child(info_message);
|
||||||
|
|
||||||
timeline = memnew(AnimationTimelineEdit);
|
timeline = memnew(AnimationTimelineEdit);
|
||||||
|
|
|
@ -393,7 +393,7 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() {
|
||||||
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||||
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
||||||
info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
info_message->set_anchors_and_offsets_preset(PRESET_FULL_RECT, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
||||||
monitor_draw->add_child(info_message);
|
monitor_draw->add_child(info_message);
|
||||||
|
|
||||||
for (int i = 0; i < Performance::MONITOR_MAX; i++) {
|
for (int i = 0; i < Performance::MONITOR_MAX; i++) {
|
||||||
|
|
|
@ -4333,16 +4333,16 @@ void EditorNode::_dock_make_float() {
|
||||||
window->set_title(dock->get_name());
|
window->set_title(dock->get_name());
|
||||||
Panel *p = memnew(Panel);
|
Panel *p = memnew(Panel);
|
||||||
p->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("PanelForeground"), SNAME("EditorStyles")));
|
p->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("PanelForeground"), SNAME("EditorStyles")));
|
||||||
p->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
p->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
window->add_child(p);
|
window->add_child(p);
|
||||||
MarginContainer *margin = memnew(MarginContainer);
|
MarginContainer *margin = memnew(MarginContainer);
|
||||||
margin->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
margin->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
margin->add_theme_constant_override("margin_right", borders.width);
|
margin->add_theme_constant_override("margin_right", borders.width);
|
||||||
margin->add_theme_constant_override("margin_top", borders.height);
|
margin->add_theme_constant_override("margin_top", borders.height);
|
||||||
margin->add_theme_constant_override("margin_left", borders.width);
|
margin->add_theme_constant_override("margin_left", borders.width);
|
||||||
margin->add_theme_constant_override("margin_bottom", borders.height);
|
margin->add_theme_constant_override("margin_bottom", borders.height);
|
||||||
window->add_child(margin);
|
window->add_child(margin);
|
||||||
dock->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
dock->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
margin->add_child(dock);
|
margin->add_child(dock);
|
||||||
window->set_wrap_controls(true);
|
window->set_wrap_controls(true);
|
||||||
window->set_size(dock_size);
|
window->set_size(dock_size);
|
||||||
|
@ -6142,11 +6142,11 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
theme_base = memnew(Control);
|
theme_base = memnew(Control);
|
||||||
add_child(theme_base);
|
add_child(theme_base);
|
||||||
theme_base->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
theme_base->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
gui_base = memnew(Panel);
|
gui_base = memnew(Panel);
|
||||||
theme_base->add_child(gui_base);
|
theme_base->add_child(gui_base);
|
||||||
gui_base->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
gui_base->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
theme_base->set_theme(theme);
|
theme_base->set_theme(theme);
|
||||||
gui_base->set_theme(theme);
|
gui_base->set_theme(theme);
|
||||||
|
@ -6164,7 +6164,7 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
main_vbox = memnew(VBoxContainer);
|
main_vbox = memnew(VBoxContainer);
|
||||||
gui_base->add_child(main_vbox);
|
gui_base->add_child(main_vbox);
|
||||||
main_vbox->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8);
|
main_vbox->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 8);
|
||||||
main_vbox->add_theme_constant_override("separation", 8 * EDSCALE);
|
main_vbox->add_theme_constant_override("separation", 8 * EDSCALE);
|
||||||
|
|
||||||
menu_hb = memnew(HBoxContainer);
|
menu_hb = memnew(HBoxContainer);
|
||||||
|
|
|
@ -198,7 +198,7 @@ EditorPath::EditorPath(EditorSelectionHistory *p_history) {
|
||||||
history = p_history;
|
history = p_history;
|
||||||
|
|
||||||
MarginContainer *main_mc = memnew(MarginContainer);
|
MarginContainer *main_mc = memnew(MarginContainer);
|
||||||
main_mc->set_anchors_and_offsets_preset(PRESET_WIDE);
|
main_mc->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE);
|
main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE);
|
||||||
main_mc->add_theme_constant_override("margin_right", 6 * EDSCALE);
|
main_mc->add_theme_constant_override("margin_right", 6 * EDSCALE);
|
||||||
add_child(main_mc);
|
add_child(main_mc);
|
||||||
|
|
|
@ -879,7 +879,7 @@ EditorResourcePicker::EditorResourcePicker() {
|
||||||
|
|
||||||
preview_rect = memnew(TextureRect);
|
preview_rect = memnew(TextureRect);
|
||||||
preview_rect->set_ignore_texture_size(true);
|
preview_rect->set_ignore_texture_size(true);
|
||||||
preview_rect->set_anchors_and_offsets_preset(PRESET_WIDE);
|
preview_rect->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
preview_rect->set_offset(SIDE_TOP, 1);
|
preview_rect->set_offset(SIDE_TOP, 1);
|
||||||
preview_rect->set_offset(SIDE_BOTTOM, -1);
|
preview_rect->set_offset(SIDE_BOTTOM, -1);
|
||||||
preview_rect->set_offset(SIDE_RIGHT, -1);
|
preview_rect->set_offset(SIDE_RIGHT, -1);
|
||||||
|
|
|
@ -652,7 +652,7 @@ void EditorSpinSlider::_ensure_input_popup() {
|
||||||
value_input = memnew(LineEdit);
|
value_input = memnew(LineEdit);
|
||||||
value_input_popup->add_child(value_input);
|
value_input_popup->add_child(value_input);
|
||||||
value_input_popup->set_wrap_controls(true);
|
value_input_popup->set_wrap_controls(true);
|
||||||
value_input->set_anchors_and_offsets_preset(PRESET_WIDE);
|
value_input->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
value_input_popup->connect("popup_hide", callable_mp(this, &EditorSpinSlider::_value_input_closed));
|
value_input_popup->connect("popup_hide", callable_mp(this, &EditorSpinSlider::_value_input_closed));
|
||||||
value_input->connect("text_submitted", callable_mp(this, &EditorSpinSlider::_value_input_submitted));
|
value_input->connect("text_submitted", callable_mp(this, &EditorSpinSlider::_value_input_submitted));
|
||||||
value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited));
|
value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited));
|
||||||
|
|
|
@ -432,7 +432,7 @@ GroupDialog::GroupDialog() {
|
||||||
|
|
||||||
VBoxContainer *vbc = memnew(VBoxContainer);
|
VBoxContainer *vbc = memnew(VBoxContainer);
|
||||||
add_child(vbc);
|
add_child(vbc);
|
||||||
vbc->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
vbc->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
||||||
|
|
||||||
HBoxContainer *hbc = memnew(HBoxContainer);
|
HBoxContainer *hbc = memnew(HBoxContainer);
|
||||||
vbc->add_child(hbc);
|
vbc->add_child(hbc);
|
||||||
|
@ -562,7 +562,7 @@ GroupDialog::GroupDialog() {
|
||||||
group_empty->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
group_empty->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||||
group_empty->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
group_empty->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
||||||
nodes_to_remove->add_child(group_empty);
|
nodes_to_remove->add_child(group_empty);
|
||||||
group_empty->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
group_empty->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
||||||
|
|
||||||
set_title(TTR("Group Editor"));
|
set_title(TTR("Group Editor"));
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
@ -1969,7 +1969,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
|
||||||
state_machine_play_pos = memnew(Control);
|
state_machine_play_pos = memnew(Control);
|
||||||
state_machine_draw->add_child(state_machine_play_pos);
|
state_machine_draw->add_child(state_machine_play_pos);
|
||||||
state_machine_play_pos->set_mouse_filter(MOUSE_FILTER_PASS); //pass all to parent
|
state_machine_play_pos->set_mouse_filter(MOUSE_FILTER_PASS); //pass all to parent
|
||||||
state_machine_play_pos->set_anchors_and_offsets_preset(PRESET_WIDE);
|
state_machine_play_pos->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
state_machine_play_pos->connect("draw", callable_mp(this, &AnimationNodeStateMachineEditor::_state_machine_pos_draw));
|
state_machine_play_pos->connect("draw", callable_mp(this, &AnimationNodeStateMachineEditor::_state_machine_pos_draw));
|
||||||
|
|
||||||
v_scroll = memnew(VScrollBar);
|
v_scroll = memnew(VScrollBar);
|
||||||
|
@ -2022,7 +2022,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
|
||||||
add_child(name_edit_popup);
|
add_child(name_edit_popup);
|
||||||
name_edit = memnew(LineEdit);
|
name_edit = memnew(LineEdit);
|
||||||
name_edit_popup->add_child(name_edit);
|
name_edit_popup->add_child(name_edit);
|
||||||
name_edit->set_anchors_and_offsets_preset(PRESET_WIDE);
|
name_edit->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
name_edit->connect("text_submitted", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited));
|
name_edit->connect("text_submitted", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited));
|
||||||
name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out));
|
name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out));
|
||||||
|
|
||||||
|
|
|
@ -1616,7 +1616,7 @@ AssetLibraryEditorPlugin::AssetLibraryEditorPlugin() {
|
||||||
addon_library = memnew(EditorAssetLibrary);
|
addon_library = memnew(EditorAssetLibrary);
|
||||||
addon_library->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
addon_library->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
EditorNode::get_singleton()->get_main_control()->add_child(addon_library);
|
EditorNode::get_singleton()->get_main_control()->add_child(addon_library);
|
||||||
addon_library->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
addon_library->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
addon_library->hide();
|
addon_library->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ AudioStreamEditor::AudioStreamEditor() {
|
||||||
add_child(_player);
|
add_child(_player);
|
||||||
|
|
||||||
VBoxContainer *vbox = memnew(VBoxContainer);
|
VBoxContainer *vbox = memnew(VBoxContainer);
|
||||||
vbox->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_MINSIZE, 0);
|
vbox->set_anchors_and_offsets_preset(PRESET_FULL_RECT, PRESET_MODE_MINSIZE, 0);
|
||||||
add_child(vbox);
|
add_child(vbox);
|
||||||
|
|
||||||
_preview = memnew(ColorRect);
|
_preview = memnew(ColorRect);
|
||||||
|
@ -222,7 +222,7 @@ AudioStreamEditor::AudioStreamEditor() {
|
||||||
vbox->add_child(_preview);
|
vbox->add_child(_preview);
|
||||||
|
|
||||||
_indicator = memnew(Control);
|
_indicator = memnew(Control);
|
||||||
_indicator->set_anchors_and_offsets_preset(PRESET_WIDE);
|
_indicator->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
_indicator->connect("draw", callable_mp(this, &AudioStreamEditor::_draw_indicator));
|
_indicator->connect("draw", callable_mp(this, &AudioStreamEditor::_draw_indicator));
|
||||||
_indicator->connect("gui_input", callable_mp(this, &AudioStreamEditor::_on_input_indicator));
|
_indicator->connect("gui_input", callable_mp(this, &AudioStreamEditor::_on_input_indicator));
|
||||||
_preview->add_child(_indicator);
|
_preview->add_child(_indicator);
|
||||||
|
|
|
@ -4981,7 +4981,7 @@ CanvasItemEditor::CanvasItemEditor() {
|
||||||
|
|
||||||
hb = memnew(HBoxContainer);
|
hb = memnew(HBoxContainer);
|
||||||
add_child(hb);
|
add_child(hb);
|
||||||
hb->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
hb->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
bottom_split = memnew(VSplitContainer);
|
bottom_split = memnew(VSplitContainer);
|
||||||
add_child(bottom_split);
|
add_child(bottom_split);
|
||||||
|
@ -5006,7 +5006,7 @@ CanvasItemEditor::CanvasItemEditor() {
|
||||||
SubViewportContainer *scene_tree = memnew(SubViewportContainer);
|
SubViewportContainer *scene_tree = memnew(SubViewportContainer);
|
||||||
viewport_scrollable->add_child(scene_tree);
|
viewport_scrollable->add_child(scene_tree);
|
||||||
scene_tree->set_stretch(true);
|
scene_tree->set_stretch(true);
|
||||||
scene_tree->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
scene_tree->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
scene_tree->add_child(EditorNode::get_singleton()->get_scene_root());
|
scene_tree->add_child(EditorNode::get_singleton()->get_scene_root());
|
||||||
|
|
||||||
controls_vb = memnew(VBoxContainer);
|
controls_vb = memnew(VBoxContainer);
|
||||||
|
@ -5036,7 +5036,7 @@ CanvasItemEditor::CanvasItemEditor() {
|
||||||
viewport = memnew(CanvasItemEditorViewport(this));
|
viewport = memnew(CanvasItemEditorViewport(this));
|
||||||
viewport_scrollable->add_child(viewport);
|
viewport_scrollable->add_child(viewport);
|
||||||
viewport->set_mouse_filter(MOUSE_FILTER_PASS);
|
viewport->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
viewport->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
viewport->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
viewport->set_clip_contents(true);
|
viewport->set_clip_contents(true);
|
||||||
viewport->set_focus_mode(FOCUS_ALL);
|
viewport->set_focus_mode(FOCUS_ALL);
|
||||||
viewport->connect("draw", callable_mp(this, &CanvasItemEditor::_draw_viewport));
|
viewport->connect("draw", callable_mp(this, &CanvasItemEditor::_draw_viewport));
|
||||||
|
@ -5425,7 +5425,7 @@ CanvasItemEditorPlugin::CanvasItemEditorPlugin() {
|
||||||
canvas_item_editor = memnew(CanvasItemEditor);
|
canvas_item_editor = memnew(CanvasItemEditor);
|
||||||
canvas_item_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
canvas_item_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
EditorNode::get_singleton()->get_main_control()->add_child(canvas_item_editor);
|
EditorNode::get_singleton()->get_main_control()->add_child(canvas_item_editor);
|
||||||
canvas_item_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
canvas_item_editor->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
canvas_item_editor->hide();
|
canvas_item_editor->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ void ControlEditorToolbar::_set_anchors_and_offsets_preset(Control::LayoutPreset
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
undo_redo->add_do_method(control, "set_offsets_preset", p_preset, Control::PRESET_MODE_MINSIZE);
|
undo_redo->add_do_method(control, "set_offsets_preset", p_preset, Control::PRESET_MODE_MINSIZE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -689,8 +689,8 @@ void ControlEditorToolbar::_popup_callback(int p_op) {
|
||||||
case ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE: {
|
case ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE: {
|
||||||
_set_anchors_and_offsets_preset(PRESET_HCENTER_WIDE);
|
_set_anchors_and_offsets_preset(PRESET_HCENTER_WIDE);
|
||||||
} break;
|
} break;
|
||||||
case ANCHORS_AND_OFFSETS_PRESET_WIDE: {
|
case ANCHORS_AND_OFFSETS_PRESET_FULL_RECT: {
|
||||||
_set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
_set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
} break;
|
} break;
|
||||||
case ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO: {
|
case ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO: {
|
||||||
_set_anchors_and_offsets_to_keep_ratio();
|
_set_anchors_and_offsets_to_keep_ratio();
|
||||||
|
@ -741,8 +741,8 @@ void ControlEditorToolbar::_popup_callback(int p_op) {
|
||||||
case ANCHORS_PRESET_HCENTER_WIDE: {
|
case ANCHORS_PRESET_HCENTER_WIDE: {
|
||||||
_set_anchors_preset(PRESET_HCENTER_WIDE);
|
_set_anchors_preset(PRESET_HCENTER_WIDE);
|
||||||
} break;
|
} break;
|
||||||
case ANCHORS_PRESET_WIDE: {
|
case ANCHORS_PRESET_FULL_RECT: {
|
||||||
_set_anchors_preset(Control::PRESET_WIDE);
|
_set_anchors_preset(Control::PRESET_FULL_RECT);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case CONTAINERS_H_PRESET_FILL: {
|
case CONTAINERS_H_PRESET_FILL: {
|
||||||
|
@ -840,7 +840,7 @@ void ControlEditorToolbar::_notification(int p_what) {
|
||||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignVCenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE);
|
p->add_icon_item(get_theme_icon(SNAME("ControlAlignVCenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE);
|
||||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignHCenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE);
|
p->add_icon_item(get_theme_icon(SNAME("ControlAlignHCenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE);
|
||||||
p->add_separator();
|
p->add_separator();
|
||||||
p->add_icon_item(get_theme_icon(SNAME("ControlAlignWide"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_AND_OFFSETS_PRESET_WIDE);
|
p->add_icon_item(get_theme_icon(SNAME("ControlAlignFullRect"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_AND_OFFSETS_PRESET_FULL_RECT);
|
||||||
p->add_icon_item(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")), TTR("Keep Current Ratio"), ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO);
|
p->add_icon_item(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")), TTR("Keep Current Ratio"), ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO);
|
||||||
p->set_item_tooltip(19, TTR("Adjust anchors and offsets to match the current rect size."));
|
p->set_item_tooltip(19, TTR("Adjust anchors and offsets to match the current rect size."));
|
||||||
|
|
||||||
|
@ -867,7 +867,7 @@ void ControlEditorToolbar::_notification(int p_what) {
|
||||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignVCenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE);
|
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignVCenterWide"), SNAME("EditorIcons")), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE);
|
||||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignHCenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE);
|
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignHCenterWide"), SNAME("EditorIcons")), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE);
|
||||||
anchors_popup->add_separator();
|
anchors_popup->add_separator();
|
||||||
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignWide"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_PRESET_WIDE);
|
anchors_popup->add_icon_item(get_theme_icon(SNAME("ControlAlignFullRect"), SNAME("EditorIcons")), TTR("Full Rect"), ANCHORS_PRESET_FULL_RECT);
|
||||||
|
|
||||||
anchor_mode_button->set_icon(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
anchor_mode_button->set_icon(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ class ControlEditorToolbar : public HBoxContainer {
|
||||||
ANCHORS_AND_OFFSETS_PRESET_BOTTOM_WIDE,
|
ANCHORS_AND_OFFSETS_PRESET_BOTTOM_WIDE,
|
||||||
ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE,
|
ANCHORS_AND_OFFSETS_PRESET_VCENTER_WIDE,
|
||||||
ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE,
|
ANCHORS_AND_OFFSETS_PRESET_HCENTER_WIDE,
|
||||||
ANCHORS_AND_OFFSETS_PRESET_WIDE,
|
ANCHORS_AND_OFFSETS_PRESET_FULL_RECT,
|
||||||
|
|
||||||
ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO,
|
ANCHORS_AND_OFFSETS_PRESET_KEEP_RATIO,
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ class ControlEditorToolbar : public HBoxContainer {
|
||||||
ANCHORS_PRESET_BOTTOM_WIDE,
|
ANCHORS_PRESET_BOTTOM_WIDE,
|
||||||
ANCHORS_PRESET_VCENTER_WIDE,
|
ANCHORS_PRESET_VCENTER_WIDE,
|
||||||
ANCHORS_PRESET_HCENTER_WIDE,
|
ANCHORS_PRESET_HCENTER_WIDE,
|
||||||
ANCHORS_PRESET_WIDE,
|
ANCHORS_PRESET_FULL_RECT,
|
||||||
|
|
||||||
// Offsets Presets are not currently in use.
|
// Offsets Presets are not currently in use.
|
||||||
OFFSETS_PRESET_TOP_LEFT,
|
OFFSETS_PRESET_TOP_LEFT,
|
||||||
|
@ -184,7 +184,7 @@ class ControlEditorToolbar : public HBoxContainer {
|
||||||
OFFSETS_PRESET_BOTTOM_WIDE,
|
OFFSETS_PRESET_BOTTOM_WIDE,
|
||||||
OFFSETS_PRESET_VCENTER_WIDE,
|
OFFSETS_PRESET_VCENTER_WIDE,
|
||||||
OFFSETS_PRESET_HCENTER_WIDE,
|
OFFSETS_PRESET_HCENTER_WIDE,
|
||||||
OFFSETS_PRESET_WIDE,
|
OFFSETS_PRESET_FULL_RECT,
|
||||||
|
|
||||||
CONTAINERS_H_PRESET_FILL,
|
CONTAINERS_H_PRESET_FILL,
|
||||||
CONTAINERS_H_PRESET_FILL_EXPAND,
|
CONTAINERS_H_PRESET_FILL_EXPAND,
|
||||||
|
|
|
@ -130,7 +130,7 @@ MaterialEditor::MaterialEditor() {
|
||||||
layout_2d = memnew(HBoxContainer);
|
layout_2d = memnew(HBoxContainer);
|
||||||
layout_2d->set_alignment(BoxContainer::ALIGNMENT_CENTER);
|
layout_2d->set_alignment(BoxContainer::ALIGNMENT_CENTER);
|
||||||
add_child(layout_2d);
|
add_child(layout_2d);
|
||||||
layout_2d->set_anchors_and_offsets_preset(PRESET_WIDE);
|
layout_2d->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
|
|
||||||
rect_instance = memnew(ColorRect);
|
rect_instance = memnew(ColorRect);
|
||||||
layout_2d->add_child(rect_instance);
|
layout_2d->add_child(rect_instance);
|
||||||
|
@ -143,7 +143,7 @@ MaterialEditor::MaterialEditor() {
|
||||||
vc = memnew(SubViewportContainer);
|
vc = memnew(SubViewportContainer);
|
||||||
vc->set_stretch(true);
|
vc->set_stretch(true);
|
||||||
add_child(vc);
|
add_child(vc);
|
||||||
vc->set_anchors_and_offsets_preset(PRESET_WIDE);
|
vc->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
viewport = memnew(SubViewport);
|
viewport = memnew(SubViewport);
|
||||||
Ref<World3D> world_3d;
|
Ref<World3D> world_3d;
|
||||||
world_3d.instantiate();
|
world_3d.instantiate();
|
||||||
|
@ -190,7 +190,7 @@ MaterialEditor::MaterialEditor() {
|
||||||
|
|
||||||
layout_3d = memnew(HBoxContainer);
|
layout_3d = memnew(HBoxContainer);
|
||||||
add_child(layout_3d);
|
add_child(layout_3d);
|
||||||
layout_3d->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 2);
|
layout_3d->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 2);
|
||||||
|
|
||||||
VBoxContainer *vb_shape = memnew(VBoxContainer);
|
VBoxContainer *vb_shape = memnew(VBoxContainer);
|
||||||
layout_3d->add_child(vb_shape);
|
layout_3d->add_child(vb_shape);
|
||||||
|
|
|
@ -137,7 +137,7 @@ MeshEditor::MeshEditor() {
|
||||||
|
|
||||||
HBoxContainer *hb = memnew(HBoxContainer);
|
HBoxContainer *hb = memnew(HBoxContainer);
|
||||||
add_child(hb);
|
add_child(hb);
|
||||||
hb->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 2);
|
hb->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 2);
|
||||||
|
|
||||||
hb->add_spacer();
|
hb->add_spacer();
|
||||||
|
|
||||||
|
|
|
@ -4494,7 +4494,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
|
||||||
subviewport_container = c;
|
subviewport_container = c;
|
||||||
c->set_stretch(true);
|
c->set_stretch(true);
|
||||||
add_child(c);
|
add_child(c);
|
||||||
c->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
c->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
viewport = memnew(SubViewport);
|
viewport = memnew(SubViewport);
|
||||||
viewport->set_disable_input(true);
|
viewport->set_disable_input(true);
|
||||||
|
|
||||||
|
@ -4502,7 +4502,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
|
||||||
surface = memnew(Control);
|
surface = memnew(Control);
|
||||||
surface->set_drag_forwarding(this);
|
surface->set_drag_forwarding(this);
|
||||||
add_child(surface);
|
add_child(surface);
|
||||||
surface->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
surface->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
surface->set_clip_contents(true);
|
surface->set_clip_contents(true);
|
||||||
camera = memnew(Camera3D);
|
camera = memnew(Camera3D);
|
||||||
camera->set_disable_gizmos(true);
|
camera->set_disable_gizmos(true);
|
||||||
|
@ -7233,7 +7233,7 @@ void Node3DEditor::_toggle_maximize_view(Object *p_viewport) {
|
||||||
if (!maximized) {
|
if (!maximized) {
|
||||||
for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) {
|
for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) {
|
||||||
if (i == (uint32_t)index) {
|
if (i == (uint32_t)index) {
|
||||||
viewports[i]->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
viewports[i]->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
} else {
|
} else {
|
||||||
viewports[i]->hide();
|
viewports[i]->hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ ReplicationEditor::ReplicationEditor() {
|
||||||
drop_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
drop_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
drop_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
drop_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
||||||
tree->add_child(drop_label);
|
tree->add_child(drop_label);
|
||||||
drop_label->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
drop_label->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
tree->set_drag_forwarding(this);
|
tree->set_drag_forwarding(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1821,7 +1821,7 @@ void ScriptTextEditor::_enable_code_editor() {
|
||||||
|
|
||||||
VSplitContainer *editor_box = memnew(VSplitContainer);
|
VSplitContainer *editor_box = memnew(VSplitContainer);
|
||||||
add_child(editor_box);
|
add_child(editor_box);
|
||||||
editor_box->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
editor_box->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
editor_box->set_v_size_flags(SIZE_EXPAND_FILL);
|
editor_box->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
||||||
editor_box->add_child(code_editor);
|
editor_box->add_child(code_editor);
|
||||||
|
@ -1958,7 +1958,7 @@ void ScriptTextEditor::_enable_code_editor() {
|
||||||
ScriptTextEditor::ScriptTextEditor() {
|
ScriptTextEditor::ScriptTextEditor() {
|
||||||
code_editor = memnew(CodeTextEditor);
|
code_editor = memnew(CodeTextEditor);
|
||||||
code_editor->add_theme_constant_override("separation", 2);
|
code_editor->add_theme_constant_override("separation", 2);
|
||||||
code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
code_editor->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
code_editor->set_code_complete_func(_code_complete_scripts, this);
|
code_editor->set_code_complete_func(_code_complete_scripts, this);
|
||||||
code_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
code_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
||||||
|
|
|
@ -706,7 +706,7 @@ ShaderEditor::ShaderEditor() {
|
||||||
shader_editor = memnew(ShaderTextEditor);
|
shader_editor = memnew(ShaderTextEditor);
|
||||||
shader_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
shader_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
shader_editor->add_theme_constant_override("separation", 0);
|
shader_editor->add_theme_constant_override("separation", 0);
|
||||||
shader_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
shader_editor->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
shader_editor->connect("show_warnings_panel", callable_mp(this, &ShaderEditor::_show_warnings_panel));
|
shader_editor->connect("show_warnings_panel", callable_mp(this, &ShaderEditor::_show_warnings_panel));
|
||||||
shader_editor->connect("script_changed", callable_mp(this, &ShaderEditor::apply_shaders));
|
shader_editor->connect("script_changed", callable_mp(this, &ShaderEditor::apply_shaders));
|
||||||
|
@ -797,7 +797,7 @@ ShaderEditor::ShaderEditor() {
|
||||||
|
|
||||||
VSplitContainer *editor_box = memnew(VSplitContainer);
|
VSplitContainer *editor_box = memnew(VSplitContainer);
|
||||||
main_container->add_child(editor_box);
|
main_container->add_child(editor_box);
|
||||||
editor_box->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
editor_box->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
editor_box->set_v_size_flags(SIZE_EXPAND_FILL);
|
editor_box->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
editor_box->add_child(shader_editor);
|
editor_box->add_child(shader_editor);
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ StyleBoxPreview::StyleBoxPreview() {
|
||||||
preview->set_clip_contents(true);
|
preview->set_clip_contents(true);
|
||||||
preview->connect("draw", callable_mp(this, &StyleBoxPreview::_redraw));
|
preview->connect("draw", callable_mp(this, &StyleBoxPreview::_redraw));
|
||||||
checkerboard->add_child(preview);
|
checkerboard->add_child(preview);
|
||||||
preview->set_anchors_and_offsets_preset(PRESET_WIDE);
|
preview->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
|
|
||||||
add_margin_child(TTR("Preview:"), checkerboard);
|
add_margin_child(TTR("Preview:"), checkerboard);
|
||||||
grid_preview = memnew(TextureButton);
|
grid_preview = memnew(TextureButton);
|
||||||
|
|
|
@ -524,7 +524,7 @@ TextEditor::TextEditor() {
|
||||||
code_editor->add_theme_constant_override("separation", 0);
|
code_editor->add_theme_constant_override("separation", 0);
|
||||||
code_editor->connect("load_theme_settings", callable_mp(this, &TextEditor::_load_theme_settings));
|
code_editor->connect("load_theme_settings", callable_mp(this, &TextEditor::_load_theme_settings));
|
||||||
code_editor->connect("validate_script", callable_mp(this, &TextEditor::_validate_script));
|
code_editor->connect("validate_script", callable_mp(this, &TextEditor::_validate_script));
|
||||||
code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
code_editor->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
code_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
code_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
code_editor->show_toggle_scripts_button();
|
code_editor->show_toggle_scripts_button();
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) {
|
||||||
|
|
||||||
texture_display = memnew(TextureRect);
|
texture_display = memnew(TextureRect);
|
||||||
texture_display->set_texture(p_texture);
|
texture_display->set_texture(p_texture);
|
||||||
texture_display->set_anchors_preset(TextureRect::PRESET_WIDE);
|
texture_display->set_anchors_preset(TextureRect::PRESET_FULL_RECT);
|
||||||
texture_display->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
|
texture_display->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
|
||||||
texture_display->set_ignore_texture_size(true);
|
texture_display->set_ignore_texture_size(true);
|
||||||
add_child(texture_display);
|
add_child(texture_display);
|
||||||
|
|
|
@ -2017,7 +2017,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito
|
||||||
edit_items_tree->connect("button_clicked", callable_mp(this, &ThemeItemEditorDialog::_item_tree_button_pressed));
|
edit_items_tree->connect("button_clicked", callable_mp(this, &ThemeItemEditorDialog::_item_tree_button_pressed));
|
||||||
|
|
||||||
edit_items_message = memnew(Label);
|
edit_items_message = memnew(Label);
|
||||||
edit_items_message->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
edit_items_message->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
edit_items_message->set_mouse_filter(Control::MOUSE_FILTER_STOP);
|
edit_items_message->set_mouse_filter(Control::MOUSE_FILTER_STOP);
|
||||||
edit_items_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
edit_items_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
edit_items_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
edit_items_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
||||||
|
|
|
@ -246,7 +246,7 @@ ThemeEditorPreview::ThemeEditorPreview() {
|
||||||
preview_root->set_h_size_flags(SIZE_EXPAND_FILL);
|
preview_root->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
||||||
preview_bg = memnew(ColorRect);
|
preview_bg = memnew(ColorRect);
|
||||||
preview_bg->set_anchors_and_offsets_preset(PRESET_WIDE);
|
preview_bg->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
preview_bg->set_color(GLOBAL_GET("rendering/environment/defaults/default_clear_color"));
|
preview_bg->set_color(GLOBAL_GET("rendering/environment/defaults/default_clear_color"));
|
||||||
preview_root->add_child(preview_bg);
|
preview_root->add_child(preview_bg);
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,7 @@ TileAtlasView::TileAtlasView() {
|
||||||
Panel *panel = memnew(Panel);
|
Panel *panel = memnew(Panel);
|
||||||
panel->set_clip_contents(true);
|
panel->set_clip_contents(true);
|
||||||
panel->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
panel->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
panel->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
panel->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
panel->set_h_size_flags(SIZE_EXPAND_FILL);
|
panel->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
panel->set_v_size_flags(SIZE_EXPAND_FILL);
|
panel->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
add_child(panel);
|
add_child(panel);
|
||||||
|
@ -613,32 +613,32 @@ TileAtlasView::TileAtlasView() {
|
||||||
|
|
||||||
background_left = memnew(Control);
|
background_left = memnew(Control);
|
||||||
background_left->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
background_left->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
background_left->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
background_left->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
background_left->set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED);
|
background_left->set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED);
|
||||||
background_left->connect("draw", callable_mp(this, &TileAtlasView::_draw_background_left));
|
background_left->connect("draw", callable_mp(this, &TileAtlasView::_draw_background_left));
|
||||||
base_tiles_root_control->add_child(background_left);
|
base_tiles_root_control->add_child(background_left);
|
||||||
|
|
||||||
base_tiles_drawing_root = memnew(Control);
|
base_tiles_drawing_root = memnew(Control);
|
||||||
base_tiles_drawing_root->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
base_tiles_drawing_root->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
base_tiles_drawing_root->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tiles_drawing_root->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
base_tiles_drawing_root->set_texture_filter(TEXTURE_FILTER_NEAREST);
|
base_tiles_drawing_root->set_texture_filter(TEXTURE_FILTER_NEAREST);
|
||||||
base_tiles_root_control->add_child(base_tiles_drawing_root);
|
base_tiles_root_control->add_child(base_tiles_drawing_root);
|
||||||
|
|
||||||
base_tiles_draw = memnew(Control);
|
base_tiles_draw = memnew(Control);
|
||||||
base_tiles_draw->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
base_tiles_draw->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
base_tiles_draw->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tiles_draw->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
base_tiles_draw->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles));
|
base_tiles_draw->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles));
|
||||||
base_tiles_drawing_root->add_child(base_tiles_draw);
|
base_tiles_drawing_root->add_child(base_tiles_draw);
|
||||||
|
|
||||||
base_tiles_texture_grid = memnew(Control);
|
base_tiles_texture_grid = memnew(Control);
|
||||||
base_tiles_texture_grid->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
base_tiles_texture_grid->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
base_tiles_texture_grid->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tiles_texture_grid->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
base_tiles_texture_grid->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles_texture_grid));
|
base_tiles_texture_grid->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles_texture_grid));
|
||||||
base_tiles_drawing_root->add_child(base_tiles_texture_grid);
|
base_tiles_drawing_root->add_child(base_tiles_texture_grid);
|
||||||
|
|
||||||
base_tiles_shape_grid = memnew(Control);
|
base_tiles_shape_grid = memnew(Control);
|
||||||
base_tiles_shape_grid->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
base_tiles_shape_grid->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
base_tiles_shape_grid->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tiles_shape_grid->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
base_tiles_shape_grid->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles_shape_grid));
|
base_tiles_shape_grid->connect("draw", callable_mp(this, &TileAtlasView::_draw_base_tiles_shape_grid));
|
||||||
base_tiles_drawing_root->add_child(base_tiles_shape_grid);
|
base_tiles_drawing_root->add_child(base_tiles_shape_grid);
|
||||||
|
|
||||||
|
|
|
@ -803,13 +803,13 @@ GenericTilePolygonEditor::GenericTilePolygonEditor() {
|
||||||
add_child(root);
|
add_child(root);
|
||||||
|
|
||||||
panel = memnew(Panel);
|
panel = memnew(Panel);
|
||||||
panel->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
panel->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
panel->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
panel->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
root->add_child(panel);
|
root->add_child(panel);
|
||||||
|
|
||||||
base_control = memnew(Control);
|
base_control = memnew(Control);
|
||||||
base_control->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
|
base_control->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
|
||||||
base_control->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_control->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
base_control->connect("draw", callable_mp(this, &GenericTilePolygonEditor::_base_control_draw));
|
base_control->connect("draw", callable_mp(this, &GenericTilePolygonEditor::_base_control_draw));
|
||||||
base_control->connect("gui_input", callable_mp(this, &GenericTilePolygonEditor::_base_control_gui_input));
|
base_control->connect("gui_input", callable_mp(this, &GenericTilePolygonEditor::_base_control_gui_input));
|
||||||
base_control->set_clip_contents(true);
|
base_control->set_clip_contents(true);
|
||||||
|
|
|
@ -2370,7 +2370,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
||||||
|
|
||||||
tile_data_editors_tree = memnew(Tree);
|
tile_data_editors_tree = memnew(Tree);
|
||||||
tile_data_editors_tree->set_hide_root(true);
|
tile_data_editors_tree->set_hide_root(true);
|
||||||
tile_data_editors_tree->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
tile_data_editors_tree->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
tile_data_editors_tree->set_h_scroll_enabled(false);
|
tile_data_editors_tree->set_h_scroll_enabled(false);
|
||||||
tile_data_editors_tree->set_v_scroll_enabled(false);
|
tile_data_editors_tree->set_v_scroll_enabled(false);
|
||||||
tile_data_editors_tree->connect("item_selected", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected));
|
tile_data_editors_tree->connect("item_selected", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected));
|
||||||
|
@ -2509,7 +2509,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
||||||
tile_atlas_view->add_control_over_atlas_tiles(tile_atlas_control);
|
tile_atlas_view->add_control_over_atlas_tiles(tile_atlas_control);
|
||||||
|
|
||||||
tile_atlas_control_unscaled = memnew(Control);
|
tile_atlas_control_unscaled = memnew(Control);
|
||||||
tile_atlas_control_unscaled->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
tile_atlas_control_unscaled->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
tile_atlas_control_unscaled->connect("draw", callable_mp(this, &TileSetAtlasSourceEditor::_tile_atlas_control_unscaled_draw));
|
tile_atlas_control_unscaled->connect("draw", callable_mp(this, &TileSetAtlasSourceEditor::_tile_atlas_control_unscaled_draw));
|
||||||
tile_atlas_view->add_control_over_atlas_tiles(tile_atlas_control_unscaled, false);
|
tile_atlas_view->add_control_over_atlas_tiles(tile_atlas_control_unscaled, false);
|
||||||
tile_atlas_control_unscaled->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
tile_atlas_control_unscaled->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
|
@ -2526,7 +2526,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
||||||
tile_atlas_view->add_control_over_alternative_tiles(alternative_tiles_control);
|
tile_atlas_view->add_control_over_alternative_tiles(alternative_tiles_control);
|
||||||
|
|
||||||
alternative_tiles_control_unscaled = memnew(Control);
|
alternative_tiles_control_unscaled = memnew(Control);
|
||||||
alternative_tiles_control_unscaled->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
alternative_tiles_control_unscaled->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
alternative_tiles_control_unscaled->connect("draw", callable_mp(this, &TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw));
|
alternative_tiles_control_unscaled->connect("draw", callable_mp(this, &TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw));
|
||||||
tile_atlas_view->add_control_over_alternative_tiles(alternative_tiles_control_unscaled, false);
|
tile_atlas_view->add_control_over_alternative_tiles(alternative_tiles_control_unscaled, false);
|
||||||
alternative_tiles_control_unscaled->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
alternative_tiles_control_unscaled->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||||
|
|
|
@ -50,7 +50,7 @@ void BackgroundProgress::_add_task(const String &p_task, const String &p_label,
|
||||||
Control *ec = memnew(Control);
|
Control *ec = memnew(Control);
|
||||||
ec->set_h_size_flags(SIZE_EXPAND_FILL);
|
ec->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
ec->set_v_size_flags(SIZE_EXPAND_FILL);
|
ec->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
t.progress->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
t.progress->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
ec->add_child(t.progress);
|
ec->add_child(t.progress);
|
||||||
ec->set_custom_minimum_size(Size2(80, 5) * EDSCALE);
|
ec->set_custom_minimum_size(Size2(80, 5) * EDSCALE);
|
||||||
t.hb->add_child(ec);
|
t.hb->add_child(ec);
|
||||||
|
@ -235,7 +235,7 @@ void ProgressDialog::_bind_methods() {
|
||||||
ProgressDialog::ProgressDialog() {
|
ProgressDialog::ProgressDialog() {
|
||||||
main = memnew(VBoxContainer);
|
main = memnew(VBoxContainer);
|
||||||
add_child(main);
|
add_child(main);
|
||||||
main->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
main->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
set_exclusive(true);
|
set_exclusive(true);
|
||||||
last_progress_tick = 0;
|
last_progress_tick = 0;
|
||||||
singleton = this;
|
singleton = this;
|
||||||
|
|
|
@ -2562,19 +2562,19 @@ ProjectManager::ProjectManager() {
|
||||||
|
|
||||||
EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
|
EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
|
||||||
|
|
||||||
set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
set_theme(create_custom_theme());
|
set_theme(create_custom_theme());
|
||||||
|
|
||||||
set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
Panel *panel = memnew(Panel);
|
Panel *panel = memnew(Panel);
|
||||||
add_child(panel);
|
add_child(panel);
|
||||||
panel->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
panel->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
|
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
|
||||||
|
|
||||||
VBoxContainer *vb = memnew(VBoxContainer);
|
VBoxContainer *vb = memnew(VBoxContainer);
|
||||||
panel->add_child(vb);
|
panel->add_child(vb);
|
||||||
vb->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8 * EDSCALE);
|
vb->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 8 * EDSCALE);
|
||||||
|
|
||||||
Control *center_box = memnew(Control);
|
Control *center_box = memnew(Control);
|
||||||
center_box->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
center_box->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
|
@ -2582,7 +2582,7 @@ ProjectManager::ProjectManager() {
|
||||||
|
|
||||||
tabs = memnew(TabContainer);
|
tabs = memnew(TabContainer);
|
||||||
center_box->add_child(tabs);
|
center_box->add_child(tabs);
|
||||||
tabs->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
tabs->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
tabs->connect("tab_changed", callable_mp(this, &ProjectManager::_on_tab_changed));
|
tabs->connect("tab_changed", callable_mp(this, &ProjectManager::_on_tab_changed));
|
||||||
|
|
||||||
local_projects_hb = memnew(HBoxContainer);
|
local_projects_hb = memnew(HBoxContainer);
|
||||||
|
|
|
@ -1826,7 +1826,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
|
||||||
|
|
||||||
text_edit = memnew(TextEdit);
|
text_edit = memnew(TextEdit);
|
||||||
value_vbox->add_child(text_edit);
|
value_vbox->add_child(text_edit);
|
||||||
text_edit->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5);
|
text_edit->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 5);
|
||||||
text_edit->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
text_edit->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
text_edit->set_offset(SIDE_BOTTOM, -30);
|
text_edit->set_offset(SIDE_BOTTOM, -30);
|
||||||
|
|
||||||
|
@ -1882,12 +1882,12 @@ CustomPropertyEditor::CustomPropertyEditor() {
|
||||||
|
|
||||||
spinbox = memnew(SpinBox);
|
spinbox = memnew(SpinBox);
|
||||||
value_vbox->add_child(spinbox);
|
value_vbox->add_child(spinbox);
|
||||||
spinbox->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5);
|
spinbox->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 5);
|
||||||
spinbox->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified));
|
spinbox->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified));
|
||||||
|
|
||||||
slider = memnew(HSlider);
|
slider = memnew(HSlider);
|
||||||
value_vbox->add_child(slider);
|
value_vbox->add_child(slider);
|
||||||
slider->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5);
|
slider->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 5);
|
||||||
slider->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified));
|
slider->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified));
|
||||||
|
|
||||||
action_hboxes = memnew(HBoxContainer);
|
action_hboxes = memnew(HBoxContainer);
|
||||||
|
|
|
@ -171,7 +171,7 @@ Node *SceneCreateDialog::create_scene_root() {
|
||||||
break;
|
break;
|
||||||
case ROOT_USER_INTERFACE: {
|
case ROOT_USER_INTERFACE: {
|
||||||
Control *gui = memnew(Control);
|
Control *gui = memnew(Control);
|
||||||
gui->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
gui->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
root = gui;
|
root = gui;
|
||||||
} break;
|
} break;
|
||||||
case ROOT_OTHER:
|
case ROOT_OTHER:
|
||||||
|
|
|
@ -1122,7 +1122,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
||||||
break;
|
break;
|
||||||
case TOOL_CREATE_USER_INTERFACE: {
|
case TOOL_CREATE_USER_INTERFACE: {
|
||||||
Control *node = memnew(Control);
|
Control *node = memnew(Control);
|
||||||
node->set_anchors_and_offsets_preset(PRESET_WIDE); //more useful for resizable UIs.
|
node->set_anchors_and_offsets_preset(PRESET_FULL_RECT); //more useful for resizable UIs.
|
||||||
new_node = node;
|
new_node = node;
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
|
@ -1262,7 +1262,7 @@ GridMapEditor::GridMapEditor() {
|
||||||
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
info_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||||
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
|
||||||
info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
info_message->set_anchors_and_offsets_preset(PRESET_FULL_RECT, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE);
|
||||||
mesh_library_palette->add_child(info_message);
|
mesh_library_palette->add_child(info_message);
|
||||||
|
|
||||||
edit_axis = Vector3::AXIS_Y;
|
edit_axis = Vector3::AXIS_Y;
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
set_custom_minimum_size(Size2(0, EDSCALE * PREVIEW_HEIGHT));
|
set_custom_minimum_size(Size2(0, EDSCALE * PREVIEW_HEIGHT));
|
||||||
|
|
||||||
_texture_rect = memnew(TextureRect);
|
_texture_rect = memnew(TextureRect);
|
||||||
_texture_rect->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
_texture_rect->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
_texture_rect->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_COVERED);
|
_texture_rect->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_COVERED);
|
||||||
add_child(_texture_rect);
|
add_child(_texture_rect);
|
||||||
|
|
||||||
|
|
|
@ -4628,7 +4628,7 @@ VisualScriptEditor::VisualScriptEditor() {
|
||||||
graph = memnew(GraphEdit);
|
graph = memnew(GraphEdit);
|
||||||
add_child(graph);
|
add_child(graph);
|
||||||
graph->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
graph->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
graph->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
graph->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
graph->set_show_zoom_label(true);
|
graph->set_show_zoom_label(true);
|
||||||
graph->connect("node_selected", callable_mp(this, &VisualScriptEditor::_node_selected));
|
graph->connect("node_selected", callable_mp(this, &VisualScriptEditor::_node_selected));
|
||||||
graph->connect("begin_node_move", callable_mp(this, &VisualScriptEditor::_begin_node_move));
|
graph->connect("begin_node_move", callable_mp(this, &VisualScriptEditor::_begin_node_move));
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ void ColorPicker::_screen_pick_pressed() {
|
||||||
screen = memnew(Control);
|
screen = memnew(Control);
|
||||||
r->add_child(screen);
|
r->add_child(screen);
|
||||||
screen->set_as_top_level(true);
|
screen->set_as_top_level(true);
|
||||||
screen->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
screen->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
screen->set_default_cursor_shape(CURSOR_POINTING_HAND);
|
screen->set_default_cursor_shape(CURSOR_POINTING_HAND);
|
||||||
screen->connect("gui_input", callable_mp(this, &ColorPicker::_screen_input));
|
screen->connect("gui_input", callable_mp(this, &ColorPicker::_screen_input));
|
||||||
// It immediately toggles off in the first press otherwise.
|
// It immediately toggles off in the first press otherwise.
|
||||||
|
@ -1456,7 +1456,7 @@ void ColorPickerButton::_update_picker() {
|
||||||
popup = memnew(PopupPanel);
|
popup = memnew(PopupPanel);
|
||||||
popup->set_wrap_controls(true);
|
popup->set_wrap_controls(true);
|
||||||
picker = memnew(ColorPicker);
|
picker = memnew(ColorPicker);
|
||||||
picker->set_anchors_and_offsets_preset(PRESET_WIDE);
|
picker->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
popup->add_child(picker);
|
popup->add_child(picker);
|
||||||
add_child(popup, false, INTERNAL_MODE_FRONT);
|
add_child(popup, false, INTERNAL_MODE_FRONT);
|
||||||
picker->connect("color_changed", callable_mp(this, &ColorPickerButton::_color_changed));
|
picker->connect("color_changed", callable_mp(this, &ColorPickerButton::_color_changed));
|
||||||
|
|
|
@ -1642,7 +1642,7 @@ void Control::_set_anchors_layout_preset(int p_preset) {
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_offsets_preset(preset, LayoutPresetMode::PRESET_MODE_MINSIZE);
|
set_offsets_preset(preset, LayoutPresetMode::PRESET_MODE_MINSIZE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1718,7 +1718,7 @@ int Control::_get_anchors_layout_preset() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
|
if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
|
||||||
return (int)LayoutPreset::PRESET_WIDE;
|
return (int)LayoutPreset::PRESET_FULL_RECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does not match any preset, return "Custom".
|
// Does not match any preset, return "Custom".
|
||||||
|
@ -1737,7 +1737,7 @@ void Control::set_anchors_preset(LayoutPreset p_preset, bool p_keep_offsets) {
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_LEFT_WIDE:
|
case PRESET_LEFT_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_anchor(SIDE_LEFT, ANCHOR_BEGIN, p_keep_offsets);
|
set_anchor(SIDE_LEFT, ANCHOR_BEGIN, p_keep_offsets);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1765,7 +1765,7 @@ void Control::set_anchors_preset(LayoutPreset p_preset, bool p_keep_offsets) {
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_TOP_WIDE:
|
case PRESET_TOP_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_anchor(SIDE_TOP, ANCHOR_BEGIN, p_keep_offsets);
|
set_anchor(SIDE_TOP, ANCHOR_BEGIN, p_keep_offsets);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1807,7 +1807,7 @@ void Control::set_anchors_preset(LayoutPreset p_preset, bool p_keep_offsets) {
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_anchor(SIDE_RIGHT, ANCHOR_END, p_keep_offsets);
|
set_anchor(SIDE_RIGHT, ANCHOR_END, p_keep_offsets);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1835,7 +1835,7 @@ void Control::set_anchors_preset(LayoutPreset p_preset, bool p_keep_offsets) {
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_anchor(SIDE_BOTTOM, ANCHOR_END, p_keep_offsets);
|
set_anchor(SIDE_BOTTOM, ANCHOR_END, p_keep_offsets);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1870,7 +1870,7 @@ void Control::set_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resiz
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_LEFT_WIDE:
|
case PRESET_LEFT_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
data.offset[0] = x * (0.0 - data.anchor[0]) + p_margin + parent_rect.position.x;
|
data.offset[0] = x * (0.0 - data.anchor[0]) + p_margin + parent_rect.position.x;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1898,7 +1898,7 @@ void Control::set_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resiz
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_TOP_WIDE:
|
case PRESET_TOP_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
data.offset[1] = parent_rect.size.y * (0.0 - data.anchor[1]) + p_margin + parent_rect.position.y;
|
data.offset[1] = parent_rect.size.y * (0.0 - data.anchor[1]) + p_margin + parent_rect.position.y;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1940,7 +1940,7 @@ void Control::set_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resiz
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
data.offset[2] = x * (1.0 - data.anchor[2]) - p_margin + parent_rect.position.x;
|
data.offset[2] = x * (1.0 - data.anchor[2]) - p_margin + parent_rect.position.x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1968,7 +1968,7 @@ void Control::set_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resiz
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
data.offset[3] = parent_rect.size.y * (1.0 - data.anchor[3]) - p_margin + parent_rect.position.y;
|
data.offset[3] = parent_rect.size.y * (1.0 - data.anchor[3]) - p_margin + parent_rect.position.y;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2003,7 +2003,7 @@ void Control::set_grow_direction_preset(LayoutPreset p_preset) {
|
||||||
case PRESET_BOTTOM_WIDE:
|
case PRESET_BOTTOM_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_h_grow_direction(GrowDirection::GROW_DIRECTION_BOTH);
|
set_h_grow_direction(GrowDirection::GROW_DIRECTION_BOTH);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2031,7 +2031,7 @@ void Control::set_grow_direction_preset(LayoutPreset p_preset) {
|
||||||
case PRESET_RIGHT_WIDE:
|
case PRESET_RIGHT_WIDE:
|
||||||
case PRESET_VCENTER_WIDE:
|
case PRESET_VCENTER_WIDE:
|
||||||
case PRESET_HCENTER_WIDE:
|
case PRESET_HCENTER_WIDE:
|
||||||
case PRESET_WIDE:
|
case PRESET_FULL_RECT:
|
||||||
set_v_grow_direction(GrowDirection::GROW_DIRECTION_BOTH);
|
set_v_grow_direction(GrowDirection::GROW_DIRECTION_BOTH);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3408,7 +3408,7 @@ void Control::_bind_methods() {
|
||||||
BIND_ENUM_CONSTANT(PRESET_BOTTOM_WIDE);
|
BIND_ENUM_CONSTANT(PRESET_BOTTOM_WIDE);
|
||||||
BIND_ENUM_CONSTANT(PRESET_VCENTER_WIDE);
|
BIND_ENUM_CONSTANT(PRESET_VCENTER_WIDE);
|
||||||
BIND_ENUM_CONSTANT(PRESET_HCENTER_WIDE);
|
BIND_ENUM_CONSTANT(PRESET_HCENTER_WIDE);
|
||||||
BIND_ENUM_CONSTANT(PRESET_WIDE);
|
BIND_ENUM_CONSTANT(PRESET_FULL_RECT);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(PRESET_MODE_MINSIZE);
|
BIND_ENUM_CONSTANT(PRESET_MODE_MINSIZE);
|
||||||
BIND_ENUM_CONSTANT(PRESET_MODE_KEEP_WIDTH);
|
BIND_ENUM_CONSTANT(PRESET_MODE_KEEP_WIDTH);
|
||||||
|
|
|
@ -116,7 +116,7 @@ public:
|
||||||
PRESET_BOTTOM_WIDE,
|
PRESET_BOTTOM_WIDE,
|
||||||
PRESET_VCENTER_WIDE,
|
PRESET_VCENTER_WIDE,
|
||||||
PRESET_HCENTER_WIDE,
|
PRESET_HCENTER_WIDE,
|
||||||
PRESET_WIDE
|
PRESET_FULL_RECT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LayoutPresetMode {
|
enum LayoutPresetMode {
|
||||||
|
|
|
@ -1060,7 +1060,7 @@ FileDialog::FileDialog() {
|
||||||
|
|
||||||
message = memnew(Label);
|
message = memnew(Label);
|
||||||
message->hide();
|
message->hide();
|
||||||
message->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
message->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
||||||
tree->add_child(message);
|
tree->add_child(message);
|
||||||
|
|
|
@ -2376,7 +2376,7 @@ GraphEdit::GraphEdit() {
|
||||||
top_layer = memnew(GraphEditFilter(this));
|
top_layer = memnew(GraphEditFilter(this));
|
||||||
add_child(top_layer, false, INTERNAL_MODE_BACK);
|
add_child(top_layer, false, INTERNAL_MODE_BACK);
|
||||||
top_layer->set_mouse_filter(MOUSE_FILTER_PASS);
|
top_layer->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
top_layer->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
top_layer->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
top_layer->connect("draw", callable_mp(this, &GraphEdit::_top_layer_draw));
|
top_layer->connect("draw", callable_mp(this, &GraphEdit::_top_layer_draw));
|
||||||
top_layer->connect("gui_input", callable_mp(this, &GraphEdit::_top_layer_input));
|
top_layer->connect("gui_input", callable_mp(this, &GraphEdit::_top_layer_input));
|
||||||
top_layer->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
|
top_layer->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
|
||||||
|
|
|
@ -1909,7 +1909,7 @@ void PopupMenu::popup(const Rect2 &p_bounds) {
|
||||||
PopupMenu::PopupMenu() {
|
PopupMenu::PopupMenu() {
|
||||||
// Margin Container
|
// Margin Container
|
||||||
margin_container = memnew(MarginContainer);
|
margin_container = memnew(MarginContainer);
|
||||||
margin_container->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
margin_container->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
add_child(margin_container, false, INTERNAL_MODE_FRONT);
|
add_child(margin_container, false, INTERNAL_MODE_FRONT);
|
||||||
margin_container->connect("draw", callable_mp(this, &PopupMenu::_draw_background));
|
margin_container->connect("draw", callable_mp(this, &PopupMenu::_draw_background));
|
||||||
|
|
||||||
|
@ -1921,7 +1921,7 @@ PopupMenu::PopupMenu() {
|
||||||
// The control which will display the items
|
// The control which will display the items
|
||||||
control = memnew(Control);
|
control = memnew(Control);
|
||||||
control->set_clip_contents(false);
|
control->set_clip_contents(false);
|
||||||
control->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
control->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
control->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
control->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
control->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
control->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
scroll_container->add_child(control, false, INTERNAL_MODE_FRONT);
|
scroll_container->add_child(control, false, INTERNAL_MODE_FRONT);
|
||||||
|
|
|
@ -319,7 +319,7 @@ SpinBox::SpinBox() {
|
||||||
line_edit = memnew(LineEdit);
|
line_edit = memnew(LineEdit);
|
||||||
add_child(line_edit, false, INTERNAL_MODE_FRONT);
|
add_child(line_edit, false, INTERNAL_MODE_FRONT);
|
||||||
|
|
||||||
line_edit->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
line_edit->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
line_edit->set_mouse_filter(MOUSE_FILTER_PASS);
|
line_edit->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||||
line_edit->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
|
line_edit->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ void TabContainer::_repaint() {
|
||||||
|
|
||||||
if (i == current) {
|
if (i == current) {
|
||||||
c->show();
|
c->show();
|
||||||
c->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
c->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
if (tabs_visible) {
|
if (tabs_visible) {
|
||||||
c->set_offset(SIDE_TOP, _get_top_margin());
|
c->set_offset(SIDE_TOP, _get_top_margin());
|
||||||
|
|
|
@ -5018,7 +5018,7 @@ Tree::Tree() {
|
||||||
popup_editor_vb = memnew(VBoxContainer);
|
popup_editor_vb = memnew(VBoxContainer);
|
||||||
popup_editor->add_child(popup_editor_vb);
|
popup_editor->add_child(popup_editor_vb);
|
||||||
popup_editor_vb->add_theme_constant_override("separation", 0);
|
popup_editor_vb->add_theme_constant_override("separation", 0);
|
||||||
popup_editor_vb->set_anchors_and_offsets_preset(PRESET_WIDE);
|
popup_editor_vb->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||||
text_editor = memnew(LineEdit);
|
text_editor = memnew(LineEdit);
|
||||||
popup_editor_vb->add_child(text_editor);
|
popup_editor_vb->add_child(text_editor);
|
||||||
text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
|
@ -1215,7 +1215,7 @@ void Viewport::_gui_show_tooltip() {
|
||||||
panel->connect("mouse_entered", callable_mp(this, &Viewport::_gui_cancel_tooltip));
|
panel->connect("mouse_entered", callable_mp(this, &Viewport::_gui_cancel_tooltip));
|
||||||
}
|
}
|
||||||
|
|
||||||
base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||||
|
|
||||||
panel->set_transient(true);
|
panel->set_transient(true);
|
||||||
panel->set_flag(Window::FLAG_NO_FOCUS, true);
|
panel->set_flag(Window::FLAG_NO_FOCUS, true);
|
||||||
|
|
Loading…
Reference in a new issue