Connect button centred
This commit is contained in:
		| @@ -478,14 +478,15 @@ public class CompactUi : Window, IDisposable | |||||||
|         string shardConnection = string.Equals(_apiController.ServerInfo.ShardName, "Main", StringComparison.OrdinalIgnoreCase) ? string.Empty : $"Shard: {_apiController.ServerInfo.ShardName}"; |         string shardConnection = string.Equals(_apiController.ServerInfo.ShardName, "Main", StringComparison.OrdinalIgnoreCase) ? string.Empty : $"Shard: {_apiController.ServerInfo.ShardName}"; | ||||||
| #endif | #endif | ||||||
|         var shardTextSize = ImGui.CalcTextSize(shardConnection); |         var shardTextSize = ImGui.CalcTextSize(shardConnection); | ||||||
|  |         var printShard = !string.IsNullOrEmpty(_apiController.ServerInfo.ShardName) && shardConnection != string.Empty; | ||||||
|  |  | ||||||
|         if (_apiController.ServerState is ServerState.Connected) |         if (_apiController.ServerState is ServerState.Connected) | ||||||
|         { |         { | ||||||
|             ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X) / 2 - (userSize.X + textSize.X) / 2); |             ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X) / 2 - (userSize.X + textSize.X) / 2 - ImGui.GetStyle().ItemSpacing.X / 2); | ||||||
|             ImGui.AlignTextToFramePadding(); |             if (!printShard) ImGui.AlignTextToFramePadding(); | ||||||
|             ImGui.TextColored(ImGuiColors.ParsedGreen, userCount); |             ImGui.TextColored(ImGuiColors.ParsedGreen, userCount); | ||||||
|             ImGui.SameLine(); |             ImGui.SameLine(); | ||||||
|             ImGui.AlignTextToFramePadding(); |             if (!printShard) ImGui.AlignTextToFramePadding(); | ||||||
|             ImGui.Text("Users Online"); |             ImGui.Text("Users Online"); | ||||||
|         } |         } | ||||||
|         else |         else | ||||||
| @@ -494,7 +495,18 @@ public class CompactUi : Window, IDisposable | |||||||
|             ImGui.TextColored(ImGuiColors.DalamudRed, "Not connected to any server"); |             ImGui.TextColored(ImGuiColors.DalamudRed, "Not connected to any server"); | ||||||
|         } |         } | ||||||
|          |          | ||||||
|  |         if (printShard) | ||||||
|  |         { | ||||||
|  |             ImGui.SetCursorPosY(ImGui.GetCursorPosY() - ImGui.GetStyle().ItemSpacing.Y); | ||||||
|  |             ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X) / 2 - shardTextSize.X / 2); | ||||||
|  |             ImGui.TextUnformatted(shardConnection); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X); |         ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X); | ||||||
|  |         if (printShard) | ||||||
|  |         { | ||||||
|  |             ImGui.SetCursorPosY(ImGui.GetCursorPosY() - ((userSize.Y + textSize.Y) / 2 + shardTextSize.Y) / 2 - ImGui.GetStyle().ItemSpacing.Y + buttonSize.Y / 2); | ||||||
|  |         } | ||||||
|         var color = UiShared.GetBoolColor(!_configuration.FullPause); |         var color = UiShared.GetBoolColor(!_configuration.FullPause); | ||||||
|         var connectedIcon = !_configuration.FullPause ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink; |         var connectedIcon = !_configuration.FullPause ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink; | ||||||
|  |  | ||||||
| @@ -507,12 +519,6 @@ public class CompactUi : Window, IDisposable | |||||||
|         } |         } | ||||||
|         ImGui.PopStyleColor(); |         ImGui.PopStyleColor(); | ||||||
|         UiShared.AttachToolTip(!_configuration.FullPause ? "Disconnect from " + _apiController.ServerDictionary[_configuration.ApiUri] : "Connect to " + _apiController.ServerDictionary[_configuration.ApiUri]); |         UiShared.AttachToolTip(!_configuration.FullPause ? "Disconnect from " + _apiController.ServerDictionary[_configuration.ApiUri] : "Connect to " + _apiController.ServerDictionary[_configuration.ApiUri]); | ||||||
|  |  | ||||||
|         if (!string.IsNullOrEmpty(_apiController.ServerInfo.ShardName)) |  | ||||||
|         { |  | ||||||
|             ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth()) / 2 - shardTextSize.X / 2); |  | ||||||
|             ImGui.TextUnformatted(shardConnection); |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void DrawTransfers() |     private void DrawTransfers() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xPumaa
					xPumaa