diff --git a/source/main/gui/panels/GUI_TopMenubar.cpp b/source/main/gui/panels/GUI_TopMenubar.cpp index bdbe8c0423..846d9ca17c 100644 --- a/source/main/gui/panels/GUI_TopMenubar.cpp +++ b/source/main/gui/panels/GUI_TopMenubar.cpp @@ -1611,7 +1611,7 @@ void TopMenubar::Draw(float dt) { for (size_t i = 0; i < tuning_addonparts.size(); i++) { - CacheEntryPtr& addonpart_entry = tuning_addonparts[i]; + const CacheEntryPtr& addonpart_entry = tuning_addonparts[i]; ImGui::PushID(addonpart_entry->fname.c_str()); const bool conflict_w_hovered = tuning_hovered_addonpart @@ -1660,11 +1660,19 @@ void TopMenubar::Draw(float dt) { tuning_hovered_addonpart = nullptr; } - // Reload button + // Reload button (right-aligned) ImGui::SameLine(); - ImGui::Dummy(ImVec2(10.f, 1.f)); - ImGui::SameLine(); - if (ImGui::SmallButton(_LC("Tuning", "Reload"))) + if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button + tuning_rwidget_cursorx_min = ImGui::GetCursorPosX(); + ImGui::AlignTextToFramePadding(); + std::string reloadbtn_text = _LC("Tuning", "Reload"); + float delbtn_w = ImGui::CalcTextSize(reloadbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2; + float delbtn_cursorx = ImGui::GetWindowContentRegionWidth() - delbtn_w; + if (delbtn_cursorx < tuning_rwidget_cursorx_min) + delbtn_cursorx = tuning_rwidget_cursorx_min; + ImGui::SetCursorPosX(delbtn_cursorx); + bool reloadbtn_pressed = ImGui::SmallButton(reloadbtn_text.c_str()); + if (reloadbtn_pressed) { // Create spawn request while actor still exists // Note we don't use `ActorModifyRequest::Type::RELOAD` because we don't need the bundle reloaded.