From 4552183f6a8332ea595241874894333932b5e0eb Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 10 Apr 2024 21:51:32 -0400 Subject: [PATCH] fix: fit all buttons on screen --- client/EorzeaVotes/Ui/Tabs/Questions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/EorzeaVotes/Ui/Tabs/Questions.cs b/client/EorzeaVotes/Ui/Tabs/Questions.cs index 6962a9a..7b84a1e 100644 --- a/client/EorzeaVotes/Ui/Tabs/Questions.cs +++ b/client/EorzeaVotes/Ui/Tabs/Questions.cs @@ -39,6 +39,15 @@ internal class QuestionsTab { ImGui.SameLine(); } + var label = active.Answers[i]; + var buttonSize = ImGuiHelpers.GetButtonSize(label); + var xPosAfter = ImGui.GetCursorPosX() + + buttonSize.X + + ImGui.GetStyle().ItemSpacing.X; + if (i != 0 && xPosAfter > ImGui.GetContentRegionAvail().X) { + ImGui.Dummy(Vector2.Zero); + } + var disabled = this._voting || active is FullQuestion; using var endDisabled = ImGuiHelper.WithDisabled(disabled);