Fix text drawing

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2026-02-06 19:17:02 -05:00
parent e638688fcf
commit 8162d97b5e
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
2 changed files with 8 additions and 3 deletions

View File

@ -61,12 +61,17 @@ void GameCard::paint(QPainter* painter, const QStyleOptionViewItem& option,
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
// Put this in a separate thing on the painter stack to prevent clipping the text.
painter->save();
// round image edges
QPainterPath path;
path.addRoundedRect(iconRect, 10, 10);
painter->setClipPath(path);
painter->drawPixmap(iconRect, iconPixmap);
painter->restore();
} else {
// if there is no icon just draw a blank rect
iconRect = QRect(cardRect.left() + padding,
@ -74,7 +79,7 @@ void GameCard::paint(QPainter* painter, const QStyleOptionViewItem& option,
_iconsize, _iconsize);
}
if (UISettings::values.show_game_name) {
if (UISettings::values.show_game_name.GetValue()) {
// if "none" is selected, pretend there's a
_iconsize = _iconsize ? _iconsize : 96;

View File

@ -444,8 +444,8 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid
return;
}
QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier);
QCoreApplication::postEvent(tree_view, event);
QCoreApplication::postEvent(list_view, event);
QCoreApplication::postEvent(m_currentView, event);
});
// We must register all custom types with the Qt Automoc system so that we are able to use