From 70963a434c740f9f33fc29e54b7c0c67a3ca1d83 Mon Sep 17 00:00:00 2001 From: Loporrit <141286461+loporrit@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:31:06 +0000 Subject: [PATCH] Shift the group pause button over to the right --- MareSynchronos/UI/Components/GroupPanel.cs | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/MareSynchronos/UI/Components/GroupPanel.cs b/MareSynchronos/UI/Components/GroupPanel.cs index a8cd1fe..747a27b 100644 --- a/MareSynchronos/UI/Components/GroupPanel.cs +++ b/MareSynchronos/UI/Components/GroupPanel.cs @@ -200,14 +200,6 @@ internal sealed class GroupPanel _expandedGroupState[groupDto.GID] = !_expandedGroupState[groupDto.GID]; } ImGui.PopStyleColor(2); - ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + collapseButton.X); - var pauseIcon = groupDto.GroupUserPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause; - if (ImGuiComponents.IconButton(pauseIcon)) - { - var userPerm = groupDto.GroupUserPermissions ^ GroupUserPermissions.Paused; - _ = ApiController.GroupChangeIndividualPermissionState(new GroupPairUserPermissionDto(groupDto.Group, new UserData(ApiController.UID), userPerm)); - } - UiSharedService.AttachToolTip((groupDto.GroupUserPermissions.IsPaused() ? "Resume" : "Pause") + " pairing with all users in this Syncshell"); ImGui.SameLine(); var textIsGid = true; @@ -494,7 +486,13 @@ internal sealed class GroupPanel var barbuttonSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars); var isOwner = string.Equals(groupDto.OwnerUID, ApiController.UID, StringComparison.Ordinal); - ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth() - barbuttonSize.X - (showInfoIcon ? iconSize.X : 0) - diffLockUnlockIcons - (showInfoIcon ? ImGui.GetStyle().ItemSpacing.X : 0)); + var spacingX = ImGui.GetStyle().ItemSpacing.X; + var windowEndX = ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth(); + var pauseIcon = groupDto.GroupUserPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause; + var pauseIconSize = UiSharedService.GetIconButtonSize(pauseIcon); + + ImGui.SameLine(windowEndX - barbuttonSize.X - (showInfoIcon ? iconSize.X : 0) - diffLockUnlockIcons - (showInfoIcon ? spacingX : 0) - pauseIconSize.X - spacingX); + if (showInfoIcon) { UiSharedService.FontText(infoIcon.ToIconString(), UiBuilder.IconFont); @@ -577,6 +575,14 @@ internal sealed class GroupPanel ImGui.SameLine(); } + if (ImGuiComponents.IconButton(pauseIcon)) + { + var userPerm = groupDto.GroupUserPermissions ^ GroupUserPermissions.Paused; + _ = ApiController.GroupChangeIndividualPermissionState(new GroupPairUserPermissionDto(groupDto.Group, new UserData(ApiController.UID), userPerm)); + } + UiSharedService.AttachToolTip((groupDto.GroupUserPermissions.IsPaused() ? "Resume" : "Pause") + " pairing with all users in this Syncshell"); + ImGui.SameLine(); + ImGui.SetCursorPosX(ImGui.GetCursorPosX() + diffLockUnlockIcons); if (ImGuiComponents.IconButton(FontAwesomeIcon.Bars)) {