diff --git a/Dalamud/Interface/ImGuiNotification/Internal/NotificationConstants.cs b/Dalamud/Interface/ImGuiNotification/NotificationConstants.cs similarity index 66% rename from Dalamud/Interface/ImGuiNotification/Internal/NotificationConstants.cs rename to Dalamud/Interface/ImGuiNotification/NotificationConstants.cs index 1da979430..62d288836 100644 --- a/Dalamud/Interface/ImGuiNotification/Internal/NotificationConstants.cs +++ b/Dalamud/Interface/ImGuiNotification/NotificationConstants.cs @@ -2,10 +2,10 @@ using System.Numerics; using Dalamud.Interface.Utility; -namespace Dalamud.Interface.ImGuiNotification.Internal; +namespace Dalamud.Interface.ImGuiNotification; /// Constants for drawing notification windows. -internal static class NotificationConstants +public static class NotificationConstants { // .............................[..] // ..when.......................[XX] @@ -19,47 +19,47 @@ internal static class NotificationConstants // .. action buttons .. // ................................. - /// The string to show in place of this_plugin if the notification is shown by Dalamud. - public const string DefaultInitiator = "Dalamud"; - - /// The size of the icon. - public const float IconSize = 32; - - /// The background opacity of a notification window. - public const float BackgroundOpacity = 0.82f; - - /// The duration of indeterminate progress bar loop in milliseconds. - public const float IndeterminateProgressbarLoopDuration = 2000f; - - /// Duration of show animation. - public static readonly TimeSpan ShowAnimationDuration = TimeSpan.FromMilliseconds(300); - /// Default duration of the notification. public static readonly TimeSpan DefaultDisplayDuration = TimeSpan.FromSeconds(3); - /// Default duration of the notification. + /// Default duration of the notification, after the mouse cursor leaves the notification window. public static readonly TimeSpan DefaultHoverExtendDuration = TimeSpan.FromSeconds(3); - /// Duration of hide animation. - public static readonly TimeSpan HideAnimationDuration = TimeSpan.FromMilliseconds(300); + /// The string to show in place of this_plugin if the notification is shown by Dalamud. + internal const string DefaultInitiator = "Dalamud"; + + /// The size of the icon. + internal const float IconSize = 32; + + /// The background opacity of a notification window. + internal const float BackgroundOpacity = 0.82f; + + /// The duration of indeterminate progress bar loop in milliseconds. + internal const float IndeterminateProgressbarLoopDuration = 2000f; + + /// Duration of show animation. + internal static readonly TimeSpan ShowAnimationDuration = TimeSpan.FromMilliseconds(300); /// Duration of hide animation. - public static readonly TimeSpan ProgressAnimationDuration = TimeSpan.FromMilliseconds(200); + internal static readonly TimeSpan HideAnimationDuration = TimeSpan.FromMilliseconds(300); + + /// Duration of hide animation. + internal static readonly TimeSpan ProgressAnimationDuration = TimeSpan.FromMilliseconds(200); /// Text color for the when. - public static readonly Vector4 WhenTextColor = new(0.8f, 0.8f, 0.8f, 1f); + internal static readonly Vector4 WhenTextColor = new(0.8f, 0.8f, 0.8f, 1f); /// Text color for the close button [X]. - public static readonly Vector4 CloseTextColor = new(0.8f, 0.8f, 0.8f, 1f); + internal static readonly Vector4 CloseTextColor = new(0.8f, 0.8f, 0.8f, 1f); /// Text color for the title. - public static readonly Vector4 TitleTextColor = new(1f, 1f, 1f, 1f); + internal static readonly Vector4 TitleTextColor = new(1f, 1f, 1f, 1f); /// Text color for the name of the initiator. - public static readonly Vector4 BlameTextColor = new(0.8f, 0.8f, 0.8f, 1f); + internal static readonly Vector4 BlameTextColor = new(0.8f, 0.8f, 0.8f, 1f); /// Text color for the body. - public static readonly Vector4 BodyTextColor = new(0.9f, 0.9f, 0.9f, 1f); + internal static readonly Vector4 BodyTextColor = new(0.9f, 0.9f, 0.9f, 1f); /// Gets the relative time format strings. private static readonly (TimeSpan MinSpan, string? FormatString)[] RelativeFormatStrings = @@ -77,32 +77,32 @@ internal static class NotificationConstants }; /// Gets the scaled padding of the window (dot(.) in the above diagram). - public static float ScaledWindowPadding => MathF.Round(16 * ImGuiHelpers.GlobalScale); + internal static float ScaledWindowPadding => MathF.Round(16 * ImGuiHelpers.GlobalScale); /// Gets the distance from the right bottom border of the viewport /// to the right bottom border of a notification window. /// - public static float ScaledViewportEdgeMargin => MathF.Round(20 * ImGuiHelpers.GlobalScale); + internal static float ScaledViewportEdgeMargin => MathF.Round(20 * ImGuiHelpers.GlobalScale); /// Gets the scaled gap between two notification windows. - public static float ScaledWindowGap => MathF.Round(10 * ImGuiHelpers.GlobalScale); + internal static float ScaledWindowGap => MathF.Round(10 * ImGuiHelpers.GlobalScale); /// Gets the scaled gap between components. - public static float ScaledComponentGap => MathF.Round(5 * ImGuiHelpers.GlobalScale); + internal static float ScaledComponentGap => MathF.Round(5 * ImGuiHelpers.GlobalScale); /// Gets the scaled size of the icon. - public static float ScaledIconSize => MathF.Round(IconSize * ImGuiHelpers.GlobalScale); + internal static float ScaledIconSize => MathF.Round(IconSize * ImGuiHelpers.GlobalScale); /// Gets the height of the expiry progress bar. - public static float ScaledExpiryProgressBarHeight => MathF.Round(2 * ImGuiHelpers.GlobalScale); + internal static float ScaledExpiryProgressBarHeight => MathF.Round(2 * ImGuiHelpers.GlobalScale); /// Gets the string format of the initiator name field, if the initiator is unloaded. - public static string UnloadedInitiatorNameFormat => "{0} (unloaded)"; + internal static string UnloadedInitiatorNameFormat => "{0} (unloaded)"; /// Formats an instance of as a relative time. /// When. /// The formatted string. - public static string FormatRelativeDateTime(this DateTime when) + internal static string FormatRelativeDateTime(this DateTime when) { var ts = DateTime.Now - when; foreach (var (minSpan, formatString) in RelativeFormatStrings) @@ -120,5 +120,5 @@ internal static class NotificationConstants /// Formats an instance of as an absolute time. /// When. /// The formatted string. - public static string FormatAbsoluteDateTime(this DateTime when) => $"{when:G}"; + internal static string FormatAbsoluteDateTime(this DateTime when) => $"{when:G}"; } diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs index 6239c9749..65418cdbe 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Dalamud.Game.Text; +using Dalamud.Interface.ImGuiNotification; using Dalamud.Interface.ImGuiNotification.IconSource; using Dalamud.Interface.ImGuiNotification.Internal; using Dalamud.Interface.Internal.Notifications;