Make Vector2i values paired with EDSCALE be just Vector2

This commit is contained in:
Michael Alexsander 2022-08-13 14:22:07 -03:00
parent c50febf5ef
commit c4c9e41073
17 changed files with 29 additions and 29 deletions

View File

@ -972,7 +972,7 @@
<member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false"> <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false">
Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input.
</member> </member>
<member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> <member name="custom_minimum_size" type="Vector2i" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2i(0, 0)">
The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.
</member> </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0">

View File

@ -349,7 +349,7 @@
The width all columns will be adjusted to. The width all columns will be adjusted to.
A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width.
</member> </member>
<member name="fixed_icon_size" type="Vector2" setter="set_fixed_icon_size" getter="get_fixed_icon_size" default="Vector2(0, 0)"> <member name="fixed_icon_size" type="Vector2i" setter="set_fixed_icon_size" getter="get_fixed_icon_size" default="Vector2i(0, 0)">
The size all icons will be adjusted to. The size all icons will be adjusted to.
If either X or Y component is not greater than zero, icon size won't be affected. If either X or Y component is not greater than zero, icon size won't be affected.
</member> </member>

View File

@ -1602,7 +1602,7 @@ void EditorInspectorArray::_rmb_popup_id_pressed(int p_id) {
case OPTION_RESIZE_ARRAY: case OPTION_RESIZE_ARRAY:
new_size_spin_box->set_value(count); new_size_spin_box->set_value(count);
resize_dialog->get_ok_button()->set_disabled(true); resize_dialog->get_ok_button()->set_disabled(true);
resize_dialog->popup_centered(Size2i(250, 0) * EDSCALE); resize_dialog->popup_centered(Size2(250, 0) * EDSCALE);
new_size_spin_box->get_line_edit()->grab_focus(); new_size_spin_box->get_line_edit()->grab_focus();
new_size_spin_box->get_line_edit()->select_all(); new_size_spin_box->get_line_edit()->select_all();
break; break;

View File

@ -8148,7 +8148,7 @@ Node3DEditor::Node3DEditor() {
CenterContainer *sun_direction_center = memnew(CenterContainer); CenterContainer *sun_direction_center = memnew(CenterContainer);
sun_direction = memnew(Control); sun_direction = memnew(Control);
sun_direction->set_custom_minimum_size(Size2i(128, 128) * EDSCALE); sun_direction->set_custom_minimum_size(Size2(128, 128) * EDSCALE);
sun_direction_center->add_child(sun_direction); sun_direction_center->add_child(sun_direction);
sun_vb->add_margin_child(TTR("Sun Direction"), sun_direction_center); sun_vb->add_margin_child(TTR("Sun Direction"), sun_direction_center);
sun_direction->connect("gui_input", callable_mp(this, &Node3DEditor::_sun_direction_input)); sun_direction->connect("gui_input", callable_mp(this, &Node3DEditor::_sun_direction_input));

View File

@ -1186,7 +1186,7 @@ ThemeItemImportTree::ThemeItemImportTree() {
void ThemeItemEditorDialog::ok_pressed() { void ThemeItemEditorDialog::ok_pressed() {
if (import_default_theme_items->has_selected_items() || import_editor_theme_items->has_selected_items() || import_other_theme_items->has_selected_items()) { if (import_default_theme_items->has_selected_items() || import_editor_theme_items->has_selected_items() || import_other_theme_items->has_selected_items()) {
confirm_closing_dialog->set_text(TTR("Import Items tab has some items selected. Selection will be lost upon closing this window.\nClose anyway?")); confirm_closing_dialog->set_text(TTR("Import Items tab has some items selected. Selection will be lost upon closing this window.\nClose anyway?"));
confirm_closing_dialog->popup_centered(Size2i(380, 120) * EDSCALE); confirm_closing_dialog->popup_centered(Size2(380, 120) * EDSCALE);
return; return;
} }

View File

@ -269,7 +269,7 @@ AtlasMergingDialog::AtlasMergingDialog() {
// Atlas sources item list. // Atlas sources item list.
atlas_merging_atlases_list = memnew(ItemList); atlas_merging_atlases_list = memnew(ItemList);
atlas_merging_atlases_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); atlas_merging_atlases_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
atlas_merging_atlases_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); atlas_merging_atlases_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
atlas_merging_atlases_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); atlas_merging_atlases_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
atlas_merging_atlases_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); atlas_merging_atlases_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);

View File

@ -2170,7 +2170,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
split_container_left_side->set_h_size_flags(Control::SIZE_EXPAND_FILL); split_container_left_side->set_h_size_flags(Control::SIZE_EXPAND_FILL);
split_container_left_side->set_v_size_flags(Control::SIZE_EXPAND_FILL); split_container_left_side->set_v_size_flags(Control::SIZE_EXPAND_FILL);
split_container_left_side->set_stretch_ratio(0.25); split_container_left_side->set_stretch_ratio(0.25);
split_container_left_side->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); split_container_left_side->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
atlas_sources_split_container->add_child(split_container_left_side); atlas_sources_split_container->add_child(split_container_left_side);
HBoxContainer *sources_bottom_actions = memnew(HBoxContainer); HBoxContainer *sources_bottom_actions = memnew(HBoxContainer);
@ -2190,11 +2190,11 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
sources_bottom_actions->add_child(source_sort_button); sources_bottom_actions->add_child(source_sort_button);
sources_list = memnew(ItemList); sources_list = memnew(ItemList);
sources_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
sources_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); sources_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
sources_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); sources_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
sources_list->set_stretch_ratio(0.25); sources_list->set_stretch_ratio(0.25);
sources_list->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); sources_list->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
sources_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); sources_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_fix_selected_and_hovered).unbind(1)); sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_fix_selected_and_hovered).unbind(1));
sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_source_display).unbind(1)); sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_source_display).unbind(1));
@ -3323,7 +3323,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
terrains_tree = memnew(Tree); terrains_tree = memnew(Tree);
terrains_tree->set_h_size_flags(Control::SIZE_EXPAND_FILL); terrains_tree->set_h_size_flags(Control::SIZE_EXPAND_FILL);
terrains_tree->set_stretch_ratio(0.25); terrains_tree->set_stretch_ratio(0.25);
terrains_tree->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
terrains_tree->set_hide_root(true); terrains_tree->set_hide_root(true);
terrains_tree->connect("item_selected", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_tiles_list)); terrains_tree->connect("item_selected", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_tiles_list));

View File

@ -2342,7 +2342,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
// Middle panel. // Middle panel.
ScrollContainer *middle_panel = memnew(ScrollContainer); ScrollContainer *middle_panel = memnew(ScrollContainer);
middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); middle_panel->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
split_container_right_side->add_child(middle_panel); split_container_right_side->add_child(middle_panel);
VBoxContainer *middle_vbox_container = memnew(VBoxContainer); VBoxContainer *middle_vbox_container = memnew(VBoxContainer);

View File

@ -690,7 +690,7 @@ TileSetEditor::TileSetEditor() {
split_container_left_side->set_h_size_flags(SIZE_EXPAND_FILL); split_container_left_side->set_h_size_flags(SIZE_EXPAND_FILL);
split_container_left_side->set_v_size_flags(SIZE_EXPAND_FILL); split_container_left_side->set_v_size_flags(SIZE_EXPAND_FILL);
split_container_left_side->set_stretch_ratio(0.25); split_container_left_side->set_stretch_ratio(0.25);
split_container_left_side->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); split_container_left_side->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
split_container->add_child(split_container_left_side); split_container->add_child(split_container_left_side);
source_sort_button = memnew(MenuButton); source_sort_button = memnew(MenuButton);
@ -706,7 +706,7 @@ TileSetEditor::TileSetEditor() {
p->set_item_checked(TilesEditorPlugin::SOURCE_SORT_ID, true); p->set_item_checked(TilesEditorPlugin::SOURCE_SORT_ID, true);
sources_list = memnew(ItemList); sources_list = memnew(ItemList);
sources_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
sources_list->set_h_size_flags(SIZE_EXPAND_FILL); sources_list->set_h_size_flags(SIZE_EXPAND_FILL);
sources_list->set_v_size_flags(SIZE_EXPAND_FILL); sources_list->set_v_size_flags(SIZE_EXPAND_FILL);
sources_list->connect("item_selected", callable_mp(this, &TileSetEditor::_source_selected)); sources_list->connect("item_selected", callable_mp(this, &TileSetEditor::_source_selected));

View File

@ -463,7 +463,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
// Middle panel. // Middle panel.
ScrollContainer *middle_panel = memnew(ScrollContainer); ScrollContainer *middle_panel = memnew(ScrollContainer);
middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); middle_panel->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
split_container_right_side->add_child(middle_panel); split_container_right_side->add_child(middle_panel);
VBoxContainer *middle_vbox_container = memnew(VBoxContainer); VBoxContainer *middle_vbox_container = memnew(VBoxContainer);

View File

@ -5693,7 +5693,7 @@ VisualShaderEditor::VisualShaderEditor() {
graph_plugin->set_editor(this); graph_plugin->set_editor(this);
property_editor_popup = memnew(PopupPanel); property_editor_popup = memnew(PopupPanel);
property_editor_popup->set_min_size(Size2i(180, 0) * EDSCALE); property_editor_popup->set_min_size(Size2(180, 0) * EDSCALE);
add_child(property_editor_popup); add_child(property_editor_popup);
edited_property_holder.instantiate(); edited_property_holder.instantiate();

View File

@ -141,7 +141,7 @@ private:
install_status_rect->set_texture(new_icon); install_status_rect->set_texture(new_icon);
} }
set_size(Size2i(500, 0) * EDSCALE); set_size(Size2(500, 0) * EDSCALE);
} }
String _test_path() { String _test_path() {
@ -761,7 +761,7 @@ public:
_test_path(); _test_path();
} }
popup_centered(Size2i(500, 0) * EDSCALE); popup_centered(Size2(500, 0) * EDSCALE);
} }
ProjectDialog() { ProjectDialog() {

View File

@ -122,7 +122,7 @@ namespace GodotTools.Build
{ {
base._Ready(); base._Ready();
CustomMinimumSize = new Vector2(0, 228) * EditorScale; CustomMinimumSize = new Vector2i(0, (int)(228 * EditorScale));
SizeFlagsVertical = (int)SizeFlags.ExpandFill; SizeFlagsVertical = (int)SizeFlags.ExpandFill;
var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill }; var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill };

View File

@ -1564,7 +1564,7 @@ Size2 Control::get_minimum_size() const {
return Vector2(); return Vector2();
} }
void Control::set_custom_minimum_size(const Size2 &p_custom) { void Control::set_custom_minimum_size(const Size2i &p_custom) {
if (p_custom == data.custom_minimum_size) { if (p_custom == data.custom_minimum_size) {
return; return;
} }
@ -1572,7 +1572,7 @@ void Control::set_custom_minimum_size(const Size2 &p_custom) {
update_minimum_size(); update_minimum_size();
} }
Size2 Control::get_custom_minimum_size() const { Size2i Control::get_custom_minimum_size() const {
return data.custom_minimum_size; return data.custom_minimum_size;
} }
@ -3132,7 +3132,7 @@ void Control::_bind_methods() {
ADD_GROUP("Layout", ""); ADD_GROUP("Layout", "");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_contents"), "set_clip_contents", "is_clipping_contents"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_contents"), "set_clip_contents", "is_clipping_contents");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "custom_minimum_size", PROPERTY_HINT_NONE, "suffix:px"), "set_custom_minimum_size", "get_custom_minimum_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "custom_minimum_size", PROPERTY_HINT_NONE, "suffix:px"), "set_custom_minimum_size", "get_custom_minimum_size");
ADD_PROPERTY(PropertyInfo(Variant::INT, "layout_direction", PROPERTY_HINT_ENUM, "Inherited,Locale,Left-to-Right,Right-to-Left"), "set_layout_direction", "get_layout_direction"); ADD_PROPERTY(PropertyInfo(Variant::INT, "layout_direction", PROPERTY_HINT_ENUM, "Inherited,Locale,Left-to-Right,Right-to-Left"), "set_layout_direction", "get_layout_direction");
ADD_PROPERTY(PropertyInfo(Variant::INT, "layout_mode", PROPERTY_HINT_ENUM, "Position,Anchors,Container,Uncontrolled", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "_set_layout_mode", "_get_layout_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "layout_mode", PROPERTY_HINT_ENUM, "Position,Anchors,Container,Uncontrolled", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "_set_layout_mode", "_get_layout_mode");
ADD_PROPERTY_DEFAULT("layout_mode", LayoutMode::LAYOUT_MODE_POSITION); ADD_PROPERTY_DEFAULT("layout_mode", LayoutMode::LAYOUT_MODE_POSITION);

View File

@ -200,7 +200,7 @@ private:
int h_size_flags = SIZE_FILL; int h_size_flags = SIZE_FILL;
int v_size_flags = SIZE_FILL; int v_size_flags = SIZE_FILL;
real_t expand = 1.0; real_t expand = 1.0;
Point2 custom_minimum_size; Point2i custom_minimum_size;
// Input events and rendering. // Input events and rendering.
@ -460,8 +460,8 @@ public:
virtual Size2 get_minimum_size() const; virtual Size2 get_minimum_size() const;
virtual Size2 get_combined_minimum_size() const; virtual Size2 get_combined_minimum_size() const;
void set_custom_minimum_size(const Size2 &p_custom); void set_custom_minimum_size(const Size2i &p_custom);
Size2 get_custom_minimum_size() const; Size2i get_custom_minimum_size() const;
// Container sizing. // Container sizing.

View File

@ -596,7 +596,7 @@ ItemList::IconMode ItemList::get_icon_mode() const {
return icon_mode; return icon_mode;
} }
void ItemList::set_fixed_icon_size(const Size2 &p_size) { void ItemList::set_fixed_icon_size(const Size2i &p_size) {
if (fixed_icon_size == p_size) { if (fixed_icon_size == p_size) {
return; return;
} }
@ -605,7 +605,7 @@ void ItemList::set_fixed_icon_size(const Size2 &p_size) {
queue_redraw(); queue_redraw();
} }
Size2 ItemList::get_fixed_icon_size() const { Size2i ItemList::get_fixed_icon_size() const {
return fixed_icon_size; return fixed_icon_size;
} }
@ -1830,7 +1830,7 @@ void ItemList::_bind_methods() {
ADD_GROUP("Icon", ""); ADD_GROUP("Icon", "");
ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_mode", PROPERTY_HINT_ENUM, "Top,Left"), "set_icon_mode", "get_icon_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_mode", PROPERTY_HINT_ENUM, "Top,Left"), "set_icon_mode", "get_icon_mode");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "icon_scale"), "set_icon_scale", "get_icon_scale"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "icon_scale"), "set_icon_scale", "get_icon_scale");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "fixed_icon_size", PROPERTY_HINT_NONE, "suffix:px"), "set_fixed_icon_size", "get_fixed_icon_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "fixed_icon_size", PROPERTY_HINT_NONE, "suffix:px"), "set_fixed_icon_size", "get_fixed_icon_size");
BIND_ENUM_CONSTANT(ICON_MODE_TOP); BIND_ENUM_CONSTANT(ICON_MODE_TOP);
BIND_ENUM_CONSTANT(ICON_MODE_LEFT); BIND_ENUM_CONSTANT(ICON_MODE_LEFT);

View File

@ -244,8 +244,8 @@ public:
void set_icon_mode(IconMode p_mode); void set_icon_mode(IconMode p_mode);
IconMode get_icon_mode() const; IconMode get_icon_mode() const;
void set_fixed_icon_size(const Size2 &p_size); void set_fixed_icon_size(const Size2i &p_size);
Size2 get_fixed_icon_size() const; Size2i get_fixed_icon_size() const;
void set_allow_rmb_select(bool p_allow); void set_allow_rmb_select(bool p_allow);
bool get_allow_rmb_select() const; bool get_allow_rmb_select() const;