feat: clickable URLs in chat log
Adds a parsing step when constructing `Message` objects that scans the message content for anything that looks URL-like, and inserts new `TextChunk`s into the message content with a URIPayload set. Hovering over a URL shows an on-hover effect. Clicking a URL opens it in the default browser. Right clicking shows the hostname, with an option to open and an option to copy the URL to the clipboard.
This commit is contained in:
@@ -197,16 +197,16 @@ internal static class ImGuiUtil {
|
||||
}
|
||||
}
|
||||
|
||||
internal static void WarningText(string text) {
|
||||
internal static void WarningText(string text, bool wrap = true) {
|
||||
var style = StyleModel.GetConfiguredStyle() ?? StyleModel.GetFromCurrent();
|
||||
var dalamudOrange = style.BuiltInColors?.DalamudOrange;
|
||||
if (dalamudOrange != null) {
|
||||
ImGui.PushStyleColor(ImGuiCol.Text, dalamudOrange.Value);
|
||||
}
|
||||
|
||||
ImGui.PushTextWrapPos();
|
||||
if (wrap) ImGui.PushTextWrapPos();
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.PopTextWrapPos();
|
||||
if (wrap) ImGui.PopTextWrapPos();
|
||||
|
||||
if (dalamudOrange != null) {
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
Reference in New Issue
Block a user