fix: fit all buttons on screen

This commit is contained in:
Anna 2024-04-10 21:51:32 -04:00
parent 1760f97697
commit 4552183f6a
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 9 additions and 0 deletions

View File

@ -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);