diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fd208d3..aee1130fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -567,7 +567,7 @@ endif() function(set_citron_qt_components) # Best practice is to ask for all components at once, so they are from the same version -set(CITRON_QT_COMPONENTS2 Core Widgets Concurrent) +set(CITRON_QT_COMPONENTS2 Core Widgets Concurrent Svg) if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") list(APPEND CITRON_QT_COMPONENTS2 DBus GuiPrivate) endif() diff --git a/src/citron/CMakeLists.txt b/src/citron/CMakeLists.txt index b8690a436..cb028c618 100644 --- a/src/citron/CMakeLists.txt +++ b/src/citron/CMakeLists.txt @@ -457,7 +457,7 @@ else() target_link_libraries(citron PRIVATE common core input_common frontend_common network video_core) endif() -target_link_libraries(citron PRIVATE Boost::headers glad Qt6::Widgets Qt6::Network) +target_link_libraries(citron PRIVATE Boost::headers glad Qt6::Widgets Qt6::Network Qt6::Svg) target_link_libraries(citron PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) # Add libarchive for updater functionality diff --git a/src/citron/game_list.cpp b/src/citron/game_list.cpp index 1c01e4111..6320ad473 100644 --- a/src/citron/game_list.cpp +++ b/src/citron/game_list.cpp @@ -892,7 +892,18 @@ play_time_manager{play_time_manager_}, system{system_} { // Surprise Me button - positioned after sort button btn_surprise_me = new QToolButton(toolbar); - btn_surprise_me->setIcon(QIcon(QStringLiteral(":/dist/dice.svg"))); + QIcon surprise_icon(QStringLiteral(":/dist/dice.svg")); + if (surprise_icon.isNull() || surprise_icon.availableSizes().isEmpty()) { + // Fallback to theme icon or standard icon on Windows where SVG may not load + surprise_icon = QIcon::fromTheme(QStringLiteral("media-playlist-shuffle")); + if (surprise_icon.isNull()) { + surprise_icon = QIcon::fromTheme(QStringLiteral("roll")); + } + if (surprise_icon.isNull()) { + surprise_icon = style()->standardIcon(QStyle::SP_BrowserReload); + } + } + btn_surprise_me->setIcon(surprise_icon); btn_surprise_me->setToolTip(tr("Surprise Me! (Choose Random Game)")); btn_surprise_me->setAutoRaise(true); btn_surprise_me->setIconSize(QSize(16, 16));