center shard display, fix order of users in group

This commit is contained in:
Stanley Dimant
2022-10-04 01:18:41 +02:00
parent e984304c1b
commit 7f089f458c
2 changed files with 9 additions and 8 deletions

View File

@@ -437,9 +437,9 @@ public class CompactUi : Window, IDisposable
var userSize = ImGui.CalcTextSize(userCount); var userSize = ImGui.CalcTextSize(userCount);
var textSize = ImGui.CalcTextSize("Users Online"); var textSize = ImGui.CalcTextSize("Users Online");
#if DEBUG #if DEBUG
string shardConnection = $"Connected shard: {_apiController.ServerInfo.ShardName}"; string shardConnection = $"Shard: {_apiController.ServerInfo.ShardName}";
#else #else
string shardConnection = string.Equals(_apiController.ServerInfo.ShardName, "Main", StringComparison.OrdinalIgnoreCase) ? string.Empty : $"Connected 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);
@@ -451,11 +451,6 @@ public class CompactUi : Window, IDisposable
ImGui.SameLine(); ImGui.SameLine();
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Text("Users Online"); ImGui.Text("Users Online");
ImGui.AlignTextToFramePadding();
if (!string.IsNullOrEmpty(shardConnection))
{
ImGui.TextUnformatted(shardConnection);
}
} }
else else
{ {
@@ -476,6 +471,12 @@ 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(shardConnection))
{
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth()) / 2 - shardTextSize.X / 2);
ImGui.TextUnformatted(shardConnection);
}
} }
private void DrawTransfers() private void DrawTransfers()

View File

@@ -270,7 +270,7 @@ namespace MareSynchronos.UI
ImGui.Indent(collapseButton.X); ImGui.Indent(collapseButton.X);
if (ExpandedGroupState[group.GID]) if (ExpandedGroupState[group.GID])
{ {
pairsInGroup = pairsInGroup.OrderBy(p => string.Equals(p.UserUID, group.OwnedBy, StringComparison.Ordinal) ? 0 : 1).ThenBy(p => p.IsPinned ?? false).ThenBy(p => p.UserAlias ?? p.UserUID).ToList(); pairsInGroup = pairsInGroup.OrderBy(p => string.Equals(p.UserUID, group.OwnedBy, StringComparison.Ordinal) ? 0 : 1).ThenBy(p => p.IsPinned ?? false ? 0 : 1).ThenBy(p => p.UserAlias ?? p.UserUID).ToList();
ImGui.Indent(ImGui.GetStyle().ItemSpacing.X / 2); ImGui.Indent(ImGui.GetStyle().ItemSpacing.X / 2);
ImGui.Separator(); ImGui.Separator();
foreach (var pair in pairsInGroup) foreach (var pair in pairsInGroup)