Plus button + bar button are now correctly shown for moderators

This commit is contained in:
xPumaa
2022-10-07 21:01:41 +02:00
parent b776f754f0
commit 7ae308fd4e

View File

@@ -629,7 +629,10 @@ namespace MareSynchronos.UI
if (plusButtonShown)
{
ImGui.SetCursorPosY(originalY);
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - plusButtonSize.X - (isOwner ? barButtonSize.X + ImGui.GetStyle().ItemSpacing.X : 0));
var barWidth = isOwner || (isModerator && !userIsMod && !userIsOwner)
? barButtonSize.X + ImGui.GetStyle().ItemSpacing.X
: 0;
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - plusButtonSize.X - barWidth);
if (ImGuiComponents.IconButton(FontAwesomeIcon.Plus))
{
@@ -641,7 +644,6 @@ namespace MareSynchronos.UI
if (isOwner || (isModerator && !userIsMod && !userIsOwner))
{
ImGui.SetCursorPosY(originalY);
var subtractedWidth = plusButtonShown ? (plusButtonSize.X) : 0;
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - barButtonSize.X);
if (ImGuiComponents.IconButton(FontAwesomeIcon.Bars))