mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
fix(ui): Add SVG support and fallback icons for Surprise Me button
Added Qt6::Svg to CMake configuration and implemented fallback icon chain. Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user