From 3058a4926f3e3fea89166708b54055fd3ed980f3 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 1 Jan 2024 20:35:50 +0100 Subject: [PATCH] Tweak tile atlas help label positions --- editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 9 ++++++--- editor/plugins/tiles/tile_set_atlas_source_editor.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index a3fc6aa5f7ef..2f6600bba4f8 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2644,11 +2644,9 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_atlas_view->connect("transform_changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_atlas_view_transform_changed).unbind(2)); right_panel->add_child(tile_atlas_view); - tile_create_help = memnew(HBoxContainer); + tile_create_help = memnew(VBoxContainer); tile_atlas_view->add_child(tile_create_help); tile_create_help->set_mouse_filter(MOUSE_FILTER_IGNORE); - tile_create_help->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_LEFT, Control::PRESET_MODE_MINSIZE, 30 * EDSCALE); - tile_create_help->add_theme_constant_override("separation", 30 * EDSCALE); Label *help_label = memnew(Label(TTR("Hold Ctrl to create multiple tiles."))); tile_create_help->add_child(help_label); @@ -2656,6 +2654,11 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { help_label = memnew(Label(TTR("Hold Shift to create big tiles."))); tile_create_help->add_child(help_label); + tile_create_help->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_LEFT, Control::PRESET_MODE_MINSIZE); + Vector2 pos = tile_create_help->get_position(); + pos.y -= 8 * EDSCALE; + tile_create_help->set_position(pos); + base_tile_popup_menu = memnew(PopupMenu); base_tile_popup_menu->add_shortcut(ED_SHORTCUT("tiles_editor/delete", TTR("Delete"), Key::KEY_DELETE), TILE_DELETE); base_tile_popup_menu->add_item(TTR("Create an Alternative Tile"), TILE_CREATE_ALTERNATIVE); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h index 7f6bab804d82..a11cb700c5f1 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.h +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h @@ -160,7 +160,7 @@ class TileSetAtlasSourceEditor : public HSplitContainer { // -- Atlas view -- TileAtlasView *tile_atlas_view = nullptr; - HBoxContainer *tile_create_help = nullptr; + VBoxContainer *tile_create_help = nullptr; // Dragging enum DragType {