fix text alignment
This commit is contained in:
@@ -30,14 +30,12 @@ public abstract class DrawFolderBase : IDrawFolder
|
|||||||
if (!RenderIfEmpty && !_drawPairs.Any()) return;
|
if (!RenderIfEmpty && !_drawPairs.Any()) return;
|
||||||
|
|
||||||
using var id = ImRaii.PushId("folder_" + _id);
|
using var id = ImRaii.PushId("folder_" + _id);
|
||||||
var originalY = ImGui.GetCursorPosY();
|
|
||||||
var pauseIconSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
|
||||||
var textSize = ImGui.CalcTextSize(_id);
|
|
||||||
var textPosY = originalY + pauseIconSize.Y / 2 - textSize.Y / 2;
|
|
||||||
|
|
||||||
// draw opener
|
// draw opener
|
||||||
var icon = _tagHandler.IsTagOpen(_id) ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight;
|
var icon = _tagHandler.IsTagOpen(_id) ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight;
|
||||||
ImGui.SetCursorPosY(textPosY);
|
|
||||||
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
||||||
if (ImGui.IsItemClicked())
|
if (ImGui.IsItemClicked())
|
||||||
{
|
{
|
||||||
@@ -45,14 +43,14 @@ public abstract class DrawFolderBase : IDrawFolder
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var leftSideEnd = DrawIcon(textPosY, originalY);
|
var leftSideEnd = DrawIcon();
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var rightSideStart = DrawRightSide(originalY);
|
var rightSideStart = DrawRightSideInternal();
|
||||||
|
|
||||||
// draw name
|
// draw name
|
||||||
ImGui.SameLine(leftSideEnd);
|
ImGui.SameLine(leftSideEnd);
|
||||||
DrawName(textPosY, rightSideStart - leftSideEnd);
|
DrawName(rightSideStart - leftSideEnd);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
// if opened draw content
|
// if opened draw content
|
||||||
@@ -75,15 +73,15 @@ public abstract class DrawFolderBase : IDrawFolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract float DrawIcon(float textPosY, float originalY);
|
protected abstract float DrawIcon();
|
||||||
|
|
||||||
protected abstract void DrawMenu(float menuWidth);
|
protected abstract void DrawMenu(float menuWidth);
|
||||||
|
|
||||||
protected abstract void DrawName(float originalY, float width);
|
protected abstract void DrawName(float width);
|
||||||
|
|
||||||
protected abstract float DrawRightSide(float originalY, float currentRightSideX);
|
protected abstract float DrawRightSide(float currentRightSideX);
|
||||||
|
|
||||||
private float DrawRightSide(float originalY)
|
private float DrawRightSideInternal()
|
||||||
{
|
{
|
||||||
var barButtonSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
var barButtonSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
||||||
var spacingX = ImGui.GetStyle().ItemSpacing.X;
|
var spacingX = ImGui.GetStyle().ItemSpacing.X;
|
||||||
@@ -114,6 +112,6 @@ public abstract class DrawFolderBase : IDrawFolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DrawRightSide(originalY, rightSideStart);
|
return DrawRightSide(rightSideStart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,9 +36,9 @@ public class DrawFolderGroup : DrawFolderBase
|
|||||||
private bool IsOwner => string.Equals(_groupFullInfoDto.OwnerUID, _apiController.UID, StringComparison.Ordinal);
|
private bool IsOwner => string.Equals(_groupFullInfoDto.OwnerUID, _apiController.UID, StringComparison.Ordinal);
|
||||||
private bool IsPinned => _groupFullInfoDto.GroupUserInfo.IsPinned();
|
private bool IsPinned => _groupFullInfoDto.GroupUserInfo.IsPinned();
|
||||||
|
|
||||||
protected override float DrawIcon(float textPosY, float originalY)
|
protected override float DrawIcon()
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
ImGui.TextUnformatted(_groupFullInfoDto.GroupPermissions.IsDisableInvites() ? FontAwesomeIcon.Lock.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
ImGui.TextUnformatted(_groupFullInfoDto.GroupPermissions.IsDisableInvites() ? FontAwesomeIcon.Lock.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
||||||
@@ -50,7 +50,8 @@ public class DrawFolderGroup : DrawFolderBase
|
|||||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||||
}
|
}
|
||||||
UiSharedService.AttachToolTip(OnlinePairs + " online" + Environment.NewLine + TotalPairs + " total");
|
UiSharedService.AttachToolTip(OnlinePairs + " online" + Environment.NewLine + TotalPairs + " total");
|
||||||
@@ -58,23 +59,21 @@ public class DrawFolderGroup : DrawFolderBase
|
|||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
if (IsOwner)
|
if (IsOwner)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.AlignTextToFramePadding();
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString());
|
ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString());
|
||||||
UiSharedService.AttachToolTip("You are the owner of " + _groupFullInfoDto.GroupAliasOrGID);
|
UiSharedService.AttachToolTip("You are the owner of " + _groupFullInfoDto.GroupAliasOrGID);
|
||||||
}
|
}
|
||||||
else if (IsModerator)
|
else if (IsModerator)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.SetCursorPosY(textPosY);
|
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
ImGui.TextUnformatted(FontAwesomeIcon.UserShield.ToIconString());
|
ImGui.TextUnformatted(FontAwesomeIcon.UserShield.ToIconString());
|
||||||
UiSharedService.AttachToolTip("You are a moderator in " + _groupFullInfoDto.GroupAliasOrGID);
|
UiSharedService.AttachToolTip("You are a moderator in " + _groupFullInfoDto.GroupAliasOrGID);
|
||||||
}
|
}
|
||||||
else if (IsPinned)
|
else if (IsPinned)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.SetCursorPosY(textPosY);
|
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
ImGui.TextUnformatted(FontAwesomeIcon.Thumbtack.ToIconString());
|
ImGui.TextUnformatted(FontAwesomeIcon.Thumbtack.ToIconString());
|
||||||
UiSharedService.AttachToolTip("You are pinned in " + _groupFullInfoDto.GroupAliasOrGID);
|
UiSharedService.AttachToolTip("You are pinned in " + _groupFullInfoDto.GroupAliasOrGID);
|
||||||
@@ -166,12 +165,12 @@ public class DrawFolderGroup : DrawFolderBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void DrawName(float originalY, float width)
|
protected override void DrawName(float width)
|
||||||
{
|
{
|
||||||
_idDisplayHandler.DrawGroupText(_id, _groupFullInfoDto, ImGui.GetCursorPosX(), originalY, () => width);
|
_idDisplayHandler.DrawGroupText(_id, _groupFullInfoDto, ImGui.GetCursorPosX(), () => width);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override float DrawRightSide(float originalY, float currentRightSideX)
|
protected override float DrawRightSide(float currentRightSideX)
|
||||||
{
|
{
|
||||||
var spacingX = ImGui.GetStyle().ItemSpacing.X;
|
var spacingX = ImGui.GetStyle().ItemSpacing.X;
|
||||||
|
|
||||||
@@ -189,6 +188,8 @@ public class DrawFolderGroup : DrawFolderBase
|
|||||||
|
|
||||||
ImGui.SameLine(infoIconPosDist - userCogButtonSize.X);
|
ImGui.SameLine(infoIconPosDist - userCogButtonSize.X);
|
||||||
|
|
||||||
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow,
|
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow,
|
||||||
_groupFullInfoDto.GroupPermissions.IsPreferDisableAnimations() != individualAnimDisabled
|
_groupFullInfoDto.GroupPermissions.IsPreferDisableAnimations() != individualAnimDisabled
|
||||||
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableSounds() != individualSoundsDisabled
|
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableSounds() != individualSoundsDisabled
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
_ => true
|
_ => true
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override float DrawIcon(float textPosY, float originalY)
|
protected override float DrawIcon()
|
||||||
{
|
{
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
_ => FontAwesomeIcon.Folder.ToIconString()
|
_ => FontAwesomeIcon.Folder.ToIconString()
|
||||||
};
|
};
|
||||||
|
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(icon);
|
ImGui.TextUnformatted(icon);
|
||||||
}
|
}
|
||||||
if (RenderCount)
|
if (RenderCount)
|
||||||
@@ -87,7 +87,8 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||||
}
|
}
|
||||||
UiSharedService.AttachToolTip(OnlinePairs + " online" + Environment.NewLine + TotalPairs + " total");
|
UiSharedService.AttachToolTip(OnlinePairs + " online" + Environment.NewLine + TotalPairs + " total");
|
||||||
@@ -112,9 +113,10 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
"Note: this will not unpair with users in this Group.");
|
"Note: this will not unpair with users in this Group.");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void DrawName(float originalY, float width)
|
protected override void DrawName(float width)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
string name = _id switch
|
string name = _id switch
|
||||||
{
|
{
|
||||||
TagHandler.CustomUnpairedTag => "One-sided Individual Pairs",
|
TagHandler.CustomUnpairedTag => "One-sided Individual Pairs",
|
||||||
@@ -129,7 +131,7 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
ImGui.TextUnformatted(name);
|
ImGui.TextUnformatted(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override float DrawRightSide(float originalY, float currentRightSideX)
|
protected override float DrawRightSide(float currentRightSideX)
|
||||||
{
|
{
|
||||||
if (!RenderPause) return currentRightSideX;
|
if (!RenderPause) return currentRightSideX;
|
||||||
|
|
||||||
|
|||||||
@@ -53,12 +53,11 @@ public class DrawUserPair
|
|||||||
var pauseIconSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
var pauseIconSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
||||||
var textSize = ImGui.CalcTextSize(_pair.UserData.AliasOrUID);
|
var textSize = ImGui.CalcTextSize(_pair.UserData.AliasOrUID);
|
||||||
|
|
||||||
var textPosY = originalY + pauseIconSize.Y / 2 - textSize.Y / 2;
|
DrawLeftSide();
|
||||||
DrawLeftSide(textPosY);
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var posX = ImGui.GetCursorPosX();
|
var posX = ImGui.GetCursorPosX();
|
||||||
var rightSide = DrawRightSide(originalY);
|
var rightSide = DrawRightSide();
|
||||||
DrawName(originalY, posX, rightSide);
|
DrawName(posX, rightSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCommonClientMenu()
|
private void DrawCommonClientMenu()
|
||||||
@@ -180,15 +179,16 @@ public class DrawUserPair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawLeftSide(float textPosY)
|
private void DrawLeftSide()
|
||||||
{
|
{
|
||||||
string userPairText = string.Empty;
|
string userPairText = string.Empty;
|
||||||
|
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
if (_pair.IsPaused)
|
if (_pair.IsPaused)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
|
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
ImGui.TextUnformatted(FontAwesomeIcon.PauseCircle.ToIconString());
|
ImGui.TextUnformatted(FontAwesomeIcon.PauseCircle.ToIconString());
|
||||||
@@ -196,7 +196,7 @@ public class DrawUserPair
|
|||||||
}
|
}
|
||||||
else if (!_pair.IsOnline)
|
else if (!_pair.IsOnline)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
|
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
||||||
@@ -205,7 +205,8 @@ public class DrawUserPair
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
||||||
? FontAwesomeIcon.User.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
? FontAwesomeIcon.User.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
||||||
@@ -235,7 +236,7 @@ public class DrawUserPair
|
|||||||
|
|
||||||
if (_pair.UserPair.OwnPermissions.IsSticky())
|
if (_pair.UserPair.OwnPermissions.IsSticky())
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
@@ -249,7 +250,8 @@ public class DrawUserPair
|
|||||||
|
|
||||||
if (_pair.IsVisible)
|
if (_pair.IsVisible)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPosY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
@@ -262,9 +264,9 @@ public class DrawUserPair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawName(float originalY, float leftSide, float rightSide)
|
private void DrawName(float leftSide, float rightSide)
|
||||||
{
|
{
|
||||||
_displayHandler.DrawPairText(_id, _pair, leftSide, originalY, () => rightSide - leftSide);
|
_displayHandler.DrawPairText(_id, _pair, leftSide, () => rightSide - leftSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawPairedClientMenu()
|
private void DrawPairedClientMenu()
|
||||||
@@ -292,7 +294,7 @@ public class DrawUserPair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float DrawRightSide(float originalY)
|
private float DrawRightSide()
|
||||||
{
|
{
|
||||||
var pauseIcon = _pair.UserPair!.OwnPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
var pauseIcon = _pair.UserPair!.OwnPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
||||||
var pauseIconSize = UiSharedService.GetIconButtonSize(pauseIcon);
|
var pauseIconSize = UiSharedService.GetIconButtonSize(pauseIcon);
|
||||||
@@ -318,6 +320,8 @@ public class DrawUserPair
|
|||||||
infoIconDist = iconwidth.X;
|
infoIconDist = iconwidth.X;
|
||||||
ImGui.SameLine(infoIconPosDist - iconwidth.X);
|
ImGui.SameLine(infoIconPosDist - iconwidth.X);
|
||||||
|
|
||||||
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
{
|
{
|
||||||
@@ -378,7 +382,6 @@ public class DrawUserPair
|
|||||||
|
|
||||||
rightSideStart = windowEndX - barButtonSize.X - spacingX * 3 - pauseIconSize.X - infoIconDist;
|
rightSideStart = windowEndX - barButtonSize.X - spacingX * 3 - pauseIconSize.X - infoIconDist;
|
||||||
ImGui.SameLine(windowEndX - barButtonSize.X - spacingX - pauseIconSize.X);
|
ImGui.SameLine(windowEndX - barButtonSize.X - spacingX - pauseIconSize.X);
|
||||||
ImGui.SetCursorPosY(originalY);
|
|
||||||
if (ImGuiComponents.IconButton(pauseIcon))
|
if (ImGuiComponents.IconButton(pauseIcon))
|
||||||
{
|
{
|
||||||
var perm = _pair.UserPair!.OwnPermissions;
|
var perm = _pair.UserPair!.OwnPermissions;
|
||||||
@@ -395,8 +398,7 @@ public class DrawUserPair
|
|||||||
rightSideStart = windowEndX - barButtonSize.X;
|
rightSideStart = windowEndX - barButtonSize.X;
|
||||||
}
|
}
|
||||||
ImGui.SameLine(windowEndX - barButtonSize.X);
|
ImGui.SameLine(windowEndX - barButtonSize.X);
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Bars))
|
if (ImGuiComponents.IconButton(FontAwesomeIcon.Bars))
|
||||||
{
|
{
|
||||||
ImGui.OpenPopup("User Flyout Menu");
|
ImGui.OpenPopup("User Flyout Menu");
|
||||||
|
|||||||
@@ -31,13 +31,14 @@ public class IdDisplayHandler
|
|||||||
_mareConfigService = mareConfigService;
|
_mareConfigService = mareConfigService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawGroupText(string id, GroupFullInfoDto group, float textPosX, float originalY, Func<float> editBoxWidth)
|
public void DrawGroupText(string id, GroupFullInfoDto group, float textPosX, Func<float> editBoxWidth)
|
||||||
{
|
{
|
||||||
ImGui.SameLine(textPosX);
|
ImGui.SameLine(textPosX);
|
||||||
(bool textIsUid, string playerText) = GetGroupText(group);
|
(bool textIsUid, string playerText) = GetGroupText(group);
|
||||||
if (!string.Equals(_editEntry, group.GID, StringComparison.Ordinal))
|
if (!string.Equals(_editEntry, group.GID, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont, textIsUid))
|
using (ImRaii.PushFont(UiBuilder.MonoFont, textIsUid))
|
||||||
ImGui.TextUnformatted(playerText);
|
ImGui.TextUnformatted(playerText);
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ public class IdDisplayHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(editBoxWidth.Invoke());
|
ImGui.SetNextItemWidth(editBoxWidth.Invoke());
|
||||||
if (ImGui.InputTextWithHint("", "Name/Notes", ref _editComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
if (ImGui.InputTextWithHint("", "Name/Notes", ref _editComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
||||||
@@ -86,13 +87,14 @@ public class IdDisplayHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawPairText(string id, Pair pair, float textPosX, float originalY, Func<float> editBoxWidth)
|
public void DrawPairText(string id, Pair pair, float textPosX, Func<float> editBoxWidth)
|
||||||
{
|
{
|
||||||
ImGui.SameLine(textPosX);
|
ImGui.SameLine(textPosX);
|
||||||
(bool textIsUid, string playerText) = GetPlayerText(pair);
|
(bool textIsUid, string playerText) = GetPlayerText(pair);
|
||||||
if (!string.Equals(_editEntry, pair.UserData.UID, StringComparison.Ordinal))
|
if (!string.Equals(_editEntry, pair.UserData.UID, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
if (textIsUid) ImGui.PushFont(UiBuilder.MonoFont);
|
if (textIsUid) ImGui.PushFont(UiBuilder.MonoFont);
|
||||||
ImGui.TextUnformatted(playerText);
|
ImGui.TextUnformatted(playerText);
|
||||||
if (textIsUid) ImGui.PopFont();
|
if (textIsUid) ImGui.PopFont();
|
||||||
@@ -162,7 +164,7 @@ public class IdDisplayHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(editBoxWidth.Invoke());
|
ImGui.SetNextItemWidth(editBoxWidth.Invoke());
|
||||||
if (ImGui.InputTextWithHint("", "Nick/Notes", ref _editComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
if (ImGui.InputTextWithHint("", "Nick/Notes", ref _editComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
||||||
|
|||||||
Reference in New Issue
Block a user