fix: calculate child height correctly

This commit is contained in:
Anna 2024-01-03 23:53:23 -05:00
parent 44375fca25
commit fadfd65b97
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 3 additions and 7 deletions

View File

@ -92,12 +92,8 @@ internal class QuestionsTab {
var label = ImGui.CalcTextSize(pageLabel);
var next = ImGuiHelpers.GetButtonSize(FontAwesomeIcon.ArrowRight.ToIconString());
var heightLeft = ImGui.GetContentRegionAvail().Y;
if (heightLeft > 0) {
heightLeft -= Math.Max(prev.Y, next.Y);
heightLeft -= ImGui.GetStyle().ItemSpacing.Y;
dummyHeight = heightLeft;
}
dummyHeight += Math.Max(prev.Y, next.Y);
dummyHeight += ImGui.GetStyle().ItemSpacing.Y;
pageButtonsWidth = prev.X + label.X + next.X + ImGui.GetStyle().ItemSpacing.X * 2;
}
@ -113,7 +109,7 @@ internal class QuestionsTab {
using var pop = new OnDispose(ImGui.PopTextWrapPos);
if (loading) {
ImGui.TextUnformatted("Loading...");
ImGuiHelpers.CenteredText("Loading...");
ImGui.Spacing();
} else {
foreach (var question in this.Plugin.Manager) {