diff --git a/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp b/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp index 6eb81febb..0803fd8bf 100644 --- a/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp +++ b/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp @@ -33,7 +33,7 @@ TabPublicDecks::TabPublicDecks(TabSupervisor *_tabSupervisor, AbstractClient *_c model = new RemotePublicDecksModel(client, this); cardSize = SettingsCache::instance().cardsDisplay().getVisualDeckStorageCardSize(); - titleLabel = new QLabel(tr("Public decks of %1").arg(userName), this); + titleLabel = new QLabel(tr("Public decks of %1").arg(userName.toHtmlEscaped()), this); QFont titleFont = titleLabel->font(); titleFont.setBold(true); titleLabel->setFont(titleFont); @@ -116,7 +116,8 @@ QString TabPublicDecks::getTabText() const void TabPublicDecks::retranslateUi() { - titleLabel->setText(tr("Public decks of %1").arg(userName)); + // The username is another user's data, so escape it for the AutoText QLabel. + titleLabel->setText(tr("Public decks of %1").arg(userName.toHtmlEscaped())); emptyLabel->setText(tr("This user has not published any decks.")); refreshButton->setToolTip(tr("Refresh")); quickSettingsWidget->setToolTip(tr("Public Decks Settings")); diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/public_deck_preview_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/public_deck_preview_widget.cpp index c076c7525..2825fab25 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/public_deck_preview_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/public_deck_preview_widget.cpp @@ -96,7 +96,10 @@ void PublicDeckPreviewWidget::setEntry(const RemotePublicDecksModel::DeckEntry & // The deck name is the overlay text on the banner, like the local preview. bannerCardDisplayWidget->setOverlayText(entry.name); - setToolTip(entry.name); + // The deck name comes from another user's record, and Qt tooltips are + // rendered as AutoText, so escape and bound it to keep it readable text + // (the overlay painted onto the banner is already a plain painter draw). + setToolTip(entry.name.left(200).toHtmlEscaped()); setBaseAccessibleName(entry.name); tagsFlowWidget->clearLayout();