Skip to content

Commit

Permalink
Merge pull request #72050 from groud/flow_tilemap_toolbar
Browse files Browse the repository at this point in the history
Make TileMap toolbar a FlowContainer
  • Loading branch information
akien-mga committed Jan 26, 2023
2 parents 42424d3 + 156c4cb commit aeac5a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions editor/plugins/tiles/tile_map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3997,7 +3997,7 @@ TileMapEditor::TileMapEditor() {
tabs_bar->connect("tab_changed", callable_mp(this, &TileMapEditor::_tab_changed));

// --- TileMap toolbar ---
tile_map_toolbar = memnew(HBoxContainer);
tile_map_toolbar = memnew(HFlowContainer);
tile_map_toolbar->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(tile_map_toolbar);

Expand All @@ -4012,8 +4012,11 @@ TileMapEditor::TileMapEditor() {
}
}

// Wide empty separation control.
tile_map_toolbar->add_spacer();
// Wide empty separation control. (like BoxContainer::add_spacer())
Control *c = memnew(Control);
c->set_mouse_filter(MOUSE_FILTER_PASS);
c->set_h_size_flags(SIZE_EXPAND_FILL);
tile_map_toolbar->add_child(c);

// Layer selector.
layers_selection_button = memnew(OptionButton);
Expand Down
3 changes: 2 additions & 1 deletion editor/plugins/tiles/tile_map_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "scene/2d/tile_map.h"
#include "scene/gui/box_container.h"
#include "scene/gui/check_box.h"
#include "scene/gui/flow_container.h"
#include "scene/gui/item_list.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/option_button.h"
Expand Down Expand Up @@ -323,7 +324,7 @@ class TileMapEditor : public VBoxContainer {
Vector<TileMapEditorPlugin *> tile_map_editor_plugins;

// Toolbar.
HBoxContainer *tile_map_toolbar = nullptr;
HFlowContainer *tile_map_toolbar = nullptr;

OptionButton *layers_selection_button = nullptr;
Button *toggle_highlight_selected_layer_button = nullptr;
Expand Down

0 comments on commit aeac5a8

Please sign in to comment.