From 5767479c217a5e33d4b00d10519fe59f69d849fd Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 21 Dec 2025 23:04:13 +0200 Subject: [PATCH] handle mod formatting codes fixes #4535 this changes the info frame to be an actuall scrollbar so if the description is too long the text is not directly cut off, and let's the user to view it all. This is may not be the best ui decssion but feel free to pick this issue up yourself or suggest changes to this PR(the important bit is in the cpp file). Signed-off-by: Trial97 --- launcher/ui/widgets/InfoFrame.cpp | 9 +- launcher/ui/widgets/InfoFrame.ui | 203 +++++++++++++++++------------- 2 files changed, 119 insertions(+), 93 deletions(-) diff --git a/launcher/ui/widgets/InfoFrame.cpp b/launcher/ui/widgets/InfoFrame.cpp index 1e641c4f9..4a71b6650 100644 --- a/launcher/ui/widgets/InfoFrame.cpp +++ b/launcher/ui/widgets/InfoFrame.cpp @@ -88,7 +88,7 @@ void InfoFrame::updateWithMod(Mod const& m) if (m.name().isEmpty()) name = m.internal_id(); else - name = m.name(); + name = renderColorCodes(m.name()); if (link.isEmpty()) text = name; @@ -103,7 +103,7 @@ void InfoFrame::updateWithMod(Mod const& m) if (m.description().isEmpty()) { setDescription(QString()); } else { - setDescription(m.description()); + setDescription(renderColorCodes(m.description())); } setImage(m.icon({ 64, 64 })); @@ -146,11 +146,12 @@ void InfoFrame::updateWithMod(Mod const& m) void InfoFrame::updateWithResource(const Resource& resource) { const QString homepage = resource.homepage(); + auto name = renderColorCodes(resource.name()); if (!homepage.isEmpty()) - setName("" + resource.name() + ""); + setName("" + name + ""); else - setName(resource.name()); + setName(name); setImage(); } diff --git a/launcher/ui/widgets/InfoFrame.ui b/launcher/ui/widgets/InfoFrame.ui index c4d8c83d3..58abcffde 100644 --- a/launcher/ui/widgets/InfoFrame.ui +++ b/launcher/ui/widgets/InfoFrame.ui @@ -7,7 +7,7 @@ 0 0 527 - 113 + 120 @@ -22,7 +22,7 @@ 120 - + 0 @@ -35,7 +35,7 @@ 0 - + @@ -60,95 +60,120 @@ - - - - + + + + + 0 + 0 + - - - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - + true - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - + + + + 0 + 0 + 455 + 118 + + + + + + + + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + +