- Switch SetTooltip to ImRaii based Tooltip
- Shorter date format for db viewer
This commit is contained in:
@@ -553,7 +553,7 @@ public sealed class ChatLogWindow : Window
|
||||
ImGui.OpenPopup(ChatChannelPicker);
|
||||
|
||||
if (activeTab.Channel is not null && ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(Language.ChatLog_SwitcherDisabled);
|
||||
ImGuiUtil.Tooltip(Language.ChatLog_SwitcherDisabled);
|
||||
|
||||
using (var popup = ImRaii.Popup(ChatChannelPicker))
|
||||
{
|
||||
@@ -1148,11 +1148,11 @@ public sealed class ChatLogWindow : Window
|
||||
ImGui.TextUnformatted(timestamp);
|
||||
|
||||
// We use an IsItemHovered() check here instead of
|
||||
// just calling SetTooltip() to avoid computing the
|
||||
// just calling Tooltip() to avoid computing the
|
||||
// tooltip string for all visible items on every
|
||||
// frame.
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(message.Date.ToLocalTime().ToString("F"));
|
||||
ImGuiUtil.Tooltip(message.Date.ToLocalTime().ToString("F"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1704,7 +1704,7 @@ public sealed class ChatLogWindow : Window
|
||||
ImGui.Dummy(emoteSize);
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(emotePayload.Code);
|
||||
ImGuiUtil.Tooltip(emotePayload.Code);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DbViewer : Window
|
||||
ChatCodes = TabsUtil.MostlyPlayer;
|
||||
|
||||
DateFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
|
||||
DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern;
|
||||
DateTimeFormat = "ddd, dd MMM yyy HH:mm:ss";
|
||||
|
||||
LastProcessed = (AfterDate, BeforeDate, CurrentPage, OnlyCurrentCharacter, ChatCodes.Count);
|
||||
DateReset();
|
||||
@@ -181,7 +181,7 @@ public class DbViewer : Window
|
||||
ImGui.SetCursorPos(pos);
|
||||
ImGui.Dummy(columnWidth);
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(message.Code.Type.Name());
|
||||
ImGuiUtil.Tooltip(message.Code.Type.Name());
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
Plugin.ChatLogWindow.DrawChunks(message.Sender);
|
||||
|
||||
@@ -205,7 +205,7 @@ public partial class InputPreview : Window
|
||||
ImGui.Dummy(emoteSize);
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(emotePayload.Code);
|
||||
ImGuiUtil.Tooltip(emotePayload.Code);
|
||||
|
||||
CursorPosition += emotePayload.Code.Length;
|
||||
return;
|
||||
|
||||
@@ -107,16 +107,16 @@ internal sealed class Database : ISettingsTab
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
ImGui.SetTooltip(Language.Options_Database_Metadata_CopyConfigPath);
|
||||
ImGuiUtil.Tooltip(Language.Options_Database_Metadata_CopyConfigPath);
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_Size, StringUtil.BytesToString(DatabaseSize)));
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(StringUtil.BytesToString(DatabaseSize));
|
||||
ImGuiUtil.Tooltip(StringUtil.BytesToString(DatabaseSize));
|
||||
|
||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_LogSize, StringUtil.BytesToString(DatabaseLogSize)));
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(StringUtil.BytesToString(DatabaseLogSize));
|
||||
ImGuiUtil.Tooltip(StringUtil.BytesToString(DatabaseLogSize));
|
||||
|
||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_MessageCount, DatabaseMessageCount));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab
|
||||
{
|
||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Language_Name, Mutable.LanguageOverride.Name()))
|
||||
{
|
||||
if (combo)
|
||||
if (combo.Success)
|
||||
{
|
||||
foreach (var language in Enum.GetValues<LanguageOverride>())
|
||||
if (ImGui.Selectable(language.Name()))
|
||||
@@ -26,7 +26,7 @@ internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab
|
||||
|
||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_CommandHelpSide_Name, Mutable.CommandHelpSide.Name()))
|
||||
{
|
||||
if (combo)
|
||||
if (combo.Success)
|
||||
{
|
||||
foreach (var side in Enum.GetValues<CommandHelpSide>())
|
||||
if (ImGui.Selectable(side.Name(), Mutable.CommandHelpSide == side))
|
||||
@@ -39,7 +39,7 @@ internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab
|
||||
|
||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_KeybindMode_Name, Mutable.KeybindMode.Name()))
|
||||
{
|
||||
if (combo)
|
||||
if (combo.Success)
|
||||
{
|
||||
foreach (var mode in Enum.GetValues<KeybindMode>())
|
||||
{
|
||||
@@ -47,7 +47,7 @@ internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab
|
||||
Mutable.KeybindMode = mode;
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(mode.Tooltip());
|
||||
ImGuiUtil.Tooltip(mode.Tooltip() ?? "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ internal sealed class Tabs : ISettingsTab
|
||||
tab.UnreadMode = mode;
|
||||
|
||||
if (mode.Tooltip() is { } tooltip && ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(tooltip);
|
||||
ImGuiUtil.Tooltip(tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user