UI icon refactoring stuff

minor refactoring

add mouseover in main ui

fix icon font issues

fix uploads/downloads icon alignment

fix code dupe

use fixed width icon handle, update deps

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
Loporrit
2025-02-18 10:38:41 +00:00
parent 9bf36765e4
commit d48dcaf555
28 changed files with 504 additions and 545 deletions

View File

@@ -11,13 +11,15 @@ namespace MareSynchronos.UI.Components.Popup;
public class BanUserPopupHandler : IPopupHandler
{
private readonly ApiController _apiController;
private readonly UiSharedService _uiSharedService;
private string _banReason = string.Empty;
private GroupFullInfoDto _group = null!;
private Pair _reportedPair = null!;
public BanUserPopupHandler(ApiController apiController)
public BanUserPopupHandler(ApiController apiController, UiSharedService uiSharedService)
{
_apiController = apiController;
_uiSharedService = uiSharedService;
}
public Vector2 PopupSize => new(500, 250);
@@ -29,7 +31,7 @@ public class BanUserPopupHandler : IPopupHandler
UiSharedService.TextWrapped("User " + (_reportedPair.UserData.AliasOrUID) + " will be banned and removed from this Syncshell.");
ImGui.InputTextWithHint("##banreason", "Ban Reason", ref _banReason, 255);
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.UserSlash, "Ban User"))
if (_uiSharedService.IconTextButton(FontAwesomeIcon.UserSlash, "Ban User"))
{
ImGui.CloseCurrentPopup();
var reason = _banReason;

View File

@@ -13,10 +13,11 @@ public class PopupHandler : WindowMediatorSubscriberBase
{
protected bool _openPopup = false;
private readonly HashSet<IPopupHandler> _handlers;
private readonly UiSharedService _uiSharedService;
private IPopupHandler? _currentHandler = null;
public PopupHandler(ILogger<PopupHandler> logger, MareMediator mediator, IEnumerable<IPopupHandler> popupHandlers,
PerformanceCollectorService performanceCollectorService)
PerformanceCollectorService performanceCollectorService, UiSharedService uiSharedService)
: base(logger, mediator, "MarePopupHandler", performanceCollectorService)
{
Flags = ImGuiWindowFlags.NoBringToFrontOnFocus
@@ -48,6 +49,7 @@ public class PopupHandler : WindowMediatorSubscriberBase
((BanUserPopupHandler)_currentHandler).Open(msg);
IsOpen = true;
});
_uiSharedService = uiSharedService;
}
protected override void DrawInternal()
@@ -69,7 +71,7 @@ public class PopupHandler : WindowMediatorSubscriberBase
if (_currentHandler.ShowClose)
{
ImGui.Separator();
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.Times, "Close"))
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Times, "Close"))
{
ImGui.CloseCurrentPopup();
}

View File

@@ -41,7 +41,7 @@ internal class ReportPopupHandler : IPopupHandler
using (ImRaii.Disabled(string.IsNullOrEmpty(_reportReason)))
{
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.ExclamationTriangle, "Send Report"))
if (_uiSharedService.IconTextButton(FontAwesomeIcon.ExclamationTriangle, "Send Report"))
{
ImGui.CloseCurrentPopup();
var reason = _reportReason;