From c771ae6ae5b21d524b10174b027aa0a7187355c5 Mon Sep 17 00:00:00 2001 From: Skrubby Skrub In A Shrub <87662196+SkrubbySkrubInAShrub@users.noreply.github.com> Date: Sun, 17 May 2026 17:50:07 +0200 Subject: [PATCH] fix(weather-editor): size time control buttons from text metrics --- src/WeatherEditor/EditorWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/WeatherEditor/EditorWindow.cpp b/src/WeatherEditor/EditorWindow.cpp index d85bf72f83..7f84372e48 100644 --- a/src/WeatherEditor/EditorWindow.cpp +++ b/src/WeatherEditor/EditorWindow.cpp @@ -1857,8 +1857,11 @@ void EditorWindow::DrawTimeControls() if (!calendar || !calendar->gameHour || !calendar->timeScale) return; - const float scale = Util::GetUIScale(); - float buttonWidth = 120.0f * scale; + const float framePadX = ImGui::GetStyle().FramePadding.x * 2.0f; + const float buttonWidth = std::max({ ImGui::CalcTextSize("Resume Time").x, + ImGui::CalcTextSize("Pause Time").x, + ImGui::CalcTextSize("Reset Speed").x }) + + framePadX; if (ImGui::Button(timePaused ? "Resume Time" : "Pause Time", ImVec2(buttonWidth, 0))) TogglePause(); if (auto _tt = Util::HoverTooltipWrapper())