Skip to content

Commit

Permalink
Fix BottomPanel excessive width.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhalesState committed Oct 6, 2024
1 parent db66bd3 commit 279ef21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions editor/gui/editor_bottom_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ Button *EditorBottomPanel::add_item(String p_text, Control *p_item, const Ref<Sh
tb->set_shortcut(p_shortcut);
tb->set_toggle_mode(true);
tb->set_focus_mode(Control::FOCUS_NONE);

// This was applied to fix BottomPanel excessive width when there are too many buttons.
// Check https://github.com/godotengine/godot/issues/95681.
tb->set_tooltip_text(p_text);
tb->set_custom_minimum_size(Size2(32, 0));
tb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
tb->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);

item_vbox->add_child(p_item);

bottom_hbox->move_to_front();
Expand Down

0 comments on commit 279ef21

Please sign in to comment.