diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index e3a0a4a46910a5e069d0da1eb0d86a0d2f6f6a82..fcc8e3b9e9be284327b1be37f1f2897480cacc57 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -332,6 +332,8 @@ libqt_plugin_la_SOURCES = \ util/model_recovery_agent.hpp \ util/vlcqtmessagehandler.cpp \ util/vlcqtmessagehandler.hpp \ + util/colorizedsvgicon.cpp \ + util/colorizedsvgicon.hpp \ widgets/native/animators.cpp \ widgets/native/animators.hpp \ widgets/native/customwidgets.cpp widgets/native/customwidgets.hpp \ diff --git a/modules/gui/qt/dialogs/vlm/vlm.cpp b/modules/gui/qt/dialogs/vlm/vlm.cpp index 435aacec86af05ae8232737ccded1612b115fb67..c9af36f666e48f811fe8aee0a0627fc33094cb46 100644 --- a/modules/gui/qt/dialogs/vlm/vlm.cpp +++ b/modules/gui/qt/dialogs/vlm/vlm.cpp @@ -31,6 +31,7 @@ #include "dialogs/open/open.hpp" #include "dialogs/sout/sout.hpp" #include "util/qt_dirs.hpp" +#include "util/colorizedsvgicon.hpp" #include <QString> #include <QVBoxLayout> @@ -461,7 +462,7 @@ VLMAWidget::VLMAWidget( VLMWrapper *_vlm, const QString& _name, objLayout->addWidget( time, 1, 3, 1, 2 );*/ QToolButton *modifyButton = new QToolButton; - modifyButton->setIcon( QIcon( ":/menu/ic_fluent_options.svg" ) ); + modifyButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( QStringLiteral(":/menu/ic_fluent_options.svg"), modifyButton ) ); modifyButton->setToolTip( qtr("Change") ); objLayout->addWidget( modifyButton, 0, 5 ); @@ -507,13 +508,13 @@ VLMBroadcast::VLMBroadcast( VLMWrapper *vlm, const QString& _name, b_looped = _looped; playButton = new QToolButton; - playButton->setIcon( QIcon( ":/menu/ic_fluent_play_filled.svg" ) ); + playButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( QStringLiteral(":/menu/ic_fluent_play_filled.svg"), playButton ) ); playButton->setToolTip( qtr("Play") ); objLayout->addWidget( playButton, 1, 0 ); b_playing = true; QToolButton *stopButton = new QToolButton; - stopButton->setIcon( QIcon( ":/menu/ic_fluent_stop.svg" ) ); + stopButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_stop.svg", stopButton ) ); stopButton->setToolTip( qtr("Stop") ); objLayout->addWidget( stopButton, 1, 1 ); @@ -532,9 +533,9 @@ void VLMBroadcast::update() { vlm->EditBroadcast( name, input, inputOptions, output, b_enabled, b_looped ); if( b_looped ) - loopButton->setIcon( QIcon( ":/menu/ic_fluent_arrow_repeat_all.svg" ) ); + loopButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_arrow_repeat_all.svg", loopButton ) ); else - loopButton->setIcon( QIcon( ":/menu/repeat_off.svg" ) ); + loopButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/repeat_off.svg", loopButton ) ); } void VLMBroadcast::togglePlayPause() @@ -542,12 +543,12 @@ void VLMBroadcast::togglePlayPause() if( b_playing ) { vlm->ControlBroadcast( name, ControlBroadcastPause ); - playButton->setIcon( QIcon( ":/menu/ic_pause_filled.svg" ) ); + playButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_pause_filled.svg", playButton ) ); } else { vlm->ControlBroadcast( name, ControlBroadcastPlay ); - playButton->setIcon( QIcon( ":/menu/ic_fluent_play_filled.svg" ) ); + playButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( QStringLiteral(":/menu/ic_fluent_play_filled.svg"), playButton ) ); } b_playing = !b_playing; } @@ -561,7 +562,7 @@ void VLMBroadcast::toggleLoop() void VLMBroadcast::stop() { vlm->ControlBroadcast( name, ControlBroadcastStop ); - playButton->setIcon( QIcon( ":/menu/ic_fluent_play_filled.svg" ) ); + playButton->setIcon( ColorizedSvgIcon::colorizedIconForWidget( QStringLiteral(":/menu/ic_fluent_play_filled.svg"), playButton ) ); } /**************** diff --git a/modules/gui/qt/menus/menus.cpp b/modules/gui/qt/menus/menus.cpp index a097c78bfc4bcf921ef9da5313d7bd5b2adb414e..58f75e94337201a54ed43ed4c57c7baefed75105 100644 --- a/modules/gui/qt/menus/menus.cpp +++ b/modules/gui/qt/menus/menus.cpp @@ -46,6 +46,7 @@ #include "dialogs/systray/systray.hpp" #include "util/varchoicemodel.hpp" #include "util/color_scheme_model.hpp" +#include "util/colorizedsvgicon.hpp" #include "medialibrary/medialib.hpp" #include "medialibrary/mlrecentsmodel.hpp" #include "medialibrary/mlbookmarkmodel.hpp" @@ -87,7 +88,7 @@ QAction *addDPStaticEntry( QMenu *menu, #ifndef __APPLE__ /* We don't set icons in menus in MacOS X */ if( !EMPTY_STR( icon ) ) { - action = menu->addAction( QIcon( icon ), text, THEDP, member ); + action = menu->addAction( ColorizedSvgIcon::colorizedIconForWidget( icon, menu ), text, THEDP, member ); } else #endif @@ -119,7 +120,7 @@ static QAction* addMIMStaticEntry( qt_intf_t *p_intf, if( !EMPTY_STR( icon ) ) { action = menu->addAction( text, THEMIM, member ); - action->setIcon( QIcon( icon ) ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( icon, menu ) ); } else #endif @@ -141,7 +142,7 @@ static QAction* addMPLStaticEntry( qt_intf_t *p_intf, if( !EMPTY_STR( icon ) ) { action = menu->addAction( text, THEMPL, member ); - action->setIcon( QIcon( icon ) ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( icon, menu ) ); } else #endif @@ -313,7 +314,7 @@ void VLCMenuBar::ViewMenu(qt_intf_t *p_intf, QMenu *menu, std::optional<bool> pl action = menu->addAction( #ifndef __APPLE__ - QIcon( ":/menu/ic_playlist.svg" ), + ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_playlist.svg", menu ), #endif qtr( "Play&list" )); action->setShortcut(QString( "Ctrl+L" )); @@ -586,7 +587,7 @@ void VLCMenuBar::PopupMenuPlaylistEntries( QMenu *menu, qt_intf_t *p_intf ) THEMPL->togglePlayPause(); }); #ifndef __APPLE__ /* No icons in menus in Mac */ - action->setIcon( QIcon( ":/menu/ic_fluent_play_filled.svg" ) ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( QStringLiteral(":/menu/ic_fluent_play_filled.svg"), menu ) ); #endif } else @@ -633,17 +634,17 @@ void VLCMenuBar::PopupMenuControlEntries( QMenu *menu, qt_intf_t *p_intf, action = rateMenu->addAction( qtr( "&Faster" ), THEMIM, &PlayerController::faster ); #ifndef __APPLE__ /* No icons in menus in Mac */ - action->setIcon( QIcon( ":/menu/ic_fluent_fast_forward.svg") ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_fast_forward.svg", rateMenu ) ); #endif } - action = rateMenu->addAction( QIcon( ":/menu/ic_fluent_fast_forward.svg" ), qtr( "Faster (fine)" ), THEMIM, + action = rateMenu->addAction( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_fast_forward.svg", rateMenu ), qtr( "Faster (fine)" ), THEMIM, &PlayerController::littlefaster ); action = rateMenu->addAction( qtr( "N&ormal Speed" ), THEMIM, &PlayerController::normalRate ); - action = rateMenu->addAction( QIcon( ":/menu/ic_fluent_rewind.svg" ), qtr( "Slower (fine)" ), THEMIM, + action = rateMenu->addAction( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_rewind.svg", rateMenu ), qtr( "Slower (fine)" ), THEMIM, &PlayerController::littleslower ); if( b_normal ) @@ -651,7 +652,7 @@ void VLCMenuBar::PopupMenuControlEntries( QMenu *menu, qt_intf_t *p_intf, action = rateMenu->addAction( qtr( "Slo&wer" ), THEMIM, &PlayerController::slower ); #ifndef __APPLE__ /* No icons in menus in Mac */ - action->setIcon( QIcon( ":/menu/ic_fluent_rewind.svg") ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_rewind.svg", rateMenu ) ); #endif } @@ -664,13 +665,13 @@ void VLCMenuBar::PopupMenuControlEntries( QMenu *menu, qt_intf_t *p_intf, action = menu->addAction( qtr( "&Jump Forward" ), THEMIM, &PlayerController::jumpFwd ); #ifndef __APPLE__ /* No icons in menus in Mac */ - action->setIcon( QIcon( ":/menu/ic_fluent_skip_forward_10.svg") ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_skip_forward_10.svg", menu ) ); #endif action = menu->addAction( qtr( "Jump Bac&kward" ), THEMIM, &PlayerController::jumpBwd ); #ifndef __APPLE__ /* No icons in menus in Mac */ - action->setIcon( QIcon( ":/menu/ic_fluent_skip_back_10.svg") ); + action->setIcon( ColorizedSvgIcon::colorizedIconForWidget( ":/menu/ic_fluent_skip_back_10.svg", menu ) ); #endif action = menu->addAction( qfut( I_MENU_GOTOTIME ), THEDP, &DialogsProvider::gotoTimeDialog ); diff --git a/modules/gui/qt/menus/qml_menu_wrapper.cpp b/modules/gui/qt/menus/qml_menu_wrapper.cpp index 5ce0290b62fd9d365eadda29e36e4ff383f807f9..90c6f795e6d69e6b425cd2e05d39222f47582dd8 100644 --- a/modules/gui/qt/menus/qml_menu_wrapper.cpp +++ b/modules/gui/qt/menus/qml_menu_wrapper.cpp @@ -27,6 +27,7 @@ #include "playlist/playlist_controller.hpp" #include "playlist/playlist_model.hpp" #include "dialogs/dialogs_provider.hpp" +#include "util/colorizedsvgicon.hpp" // Qt includes #include <QPainter> @@ -708,7 +709,7 @@ void QmlSubtitleMenu::beforePopup(QMenu * menu) /* override */ emit triggered(Synchronize); }); - menu->addAction(QIcon(":/menu/download.svg"), qtr("Search online"), this, [this]() + menu->addAction(ColorizedSvgIcon::colorizedIconForWidget(":/menu/download.svg", menu), qtr("Search online"), this, [this]() { emit triggered(Download); }); @@ -1051,19 +1052,20 @@ void PlaylistContextMenu::popup(int selectedIndex, QPoint pos ) } action = m_menu->addAction( qtr("Add File...") ); - action->setIcon(QIcon(":/menu/add.svg")); + + action->setIcon(ColorizedSvgIcon::colorizedIconForWidget(":/menu/add.svg", m_menu.get())); connect(action, &QAction::triggered, []( ) { DialogsProvider::getInstance()->simpleOpenDialog(false); }); action = m_menu->addAction( qtr("Add Directory...") ); - action->setIcon(QIcon(":/menu/add.svg")); + action->setIcon(ColorizedSvgIcon::colorizedIconForWidget(":/menu/add.svg", m_menu.get())); connect(action, &QAction::triggered, []( ) { DialogsProvider::getInstance()->PLAppendDir(); }); action = m_menu->addAction( qtr("Advanced Open...") ); - action->setIcon(QIcon(":/menu/add.svg")); + action->setIcon(ColorizedSvgIcon::colorizedIconForWidget(":/menu/add.svg", m_menu.get())); connect(action, &QAction::triggered, []( ) { DialogsProvider::getInstance()->PLAppendDialog(); }); @@ -1127,7 +1129,7 @@ void PlaylistContextMenu::popup(int selectedIndex, QPoint pos ) } action = m_menu->addAction( qtr("Shuffle the playlist") ); - action->setIcon(QIcon(":/menu/ic_fluent_arrow_shuffle_on.svg")); + action->setIcon(ColorizedSvgIcon::colorizedIconForWidget(":/menu/ic_fluent_arrow_shuffle_on.svg", m_menu.get())); connect(action, &QAction::triggered, this, [this]( ) { m_controler->shuffle(); }); diff --git a/modules/gui/qt/meson.build b/modules/gui/qt/meson.build index c9ee9c065a17cdfd5814d28769f193c07c2a40c9..698192997ac4a63bb624b91d93f1d5d158b13325 100644 --- a/modules/gui/qt/meson.build +++ b/modules/gui/qt/meson.build @@ -481,6 +481,8 @@ some_sources = files( 'util/model_recovery_agent.hpp', 'util/vlcqtmessagehandler.cpp', 'util/vlcqtmessagehandler.hpp', + 'util/colorizedsvgicon.cpp', + 'util/colorizedsvgicon.hpp', 'widgets/native/animators.cpp', 'widgets/native/animators.hpp', 'widgets/native/customwidgets.cpp', diff --git a/modules/gui/qt/pixmaps/menu/add.svg b/modules/gui/qt/pixmaps/menu/add.svg index 272c877fb969af1353ff715f44178a2e2205bf09..73ab21f5f7e62ee579816b39fa6cd166274ad97c 100644 --- a/modules/gui/qt/pixmaps/menu/add.svg +++ b/modules/gui/qt/pixmaps/menu/add.svg @@ -1,4 +1,4 @@ <svg viewBox="0 0 48 48" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> - <path d="M22.9 8v14.9H8v2.2h14.9V40h2.2V25.1H40v-2.2H25.1V8z" clip-rule="evenodd" fill-rule="evenodd"/> + <path d="M22.9 8v14.9H8v2.2h14.9V40h2.2V25.1H40v-2.2H25.1V8z" clip-rule="evenodd" fill="#FF00FF" fill-rule="evenodd"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/download.svg b/modules/gui/qt/pixmaps/menu/download.svg index b3576e7be088b36295e3a101ef06b960e4470417..34ce1f7564c47b7213b261f2d6f921d6959adb9a 100644 --- a/modules/gui/qt/pixmaps/menu/download.svg +++ b/modules/gui/qt/pixmaps/menu/download.svg @@ -1,4 +1,4 @@ <svg data-name="Calque 1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> - <path d="M22.76 12v12.11l-3.13-3.05-1.73 1.68 6.1 5.94 6.09-5.94-1.73-1.68-3.13 3.05V12Zm4.92 0v2.41h9.84v19.17h-27V14.41h9.84V12H8v24h32V12Z" fill-rule="evenodd"/> + <path d="M22.76 12v12.11l-3.13-3.05-1.73 1.68 6.1 5.94 6.09-5.94-1.73-1.68-3.13 3.05V12Zm4.92 0v2.41h9.84v19.17h-27V14.41h9.84V12H8v24h32V12Z" fill="#FF00FF" fill-rule="evenodd"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_eject.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_eject.svg index e0a5762849b59584f26608b0c0c37d9542dd7924..cde17aec7db47b5bd23cc11819a6cd71f3b35442 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_eject.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_eject.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m11.598 7.2002c0.19996-0.26692 0.6002-0.26697 0.8003-1e-4l4.4982 6.0013c0.247 0.3296 0.0118 0.7999-0.4001 0.7999h-8.994c-0.41189 0-0.64712-0.4702-0.40016-0.7998zm1.6004-0.59987c-0.6001-0.8006-1.8009-0.80044-2.4007 3.2e-4l-4.4958 6.0012c-0.74086 0.989-0.03518 2.3994 1.2005 2.3994h8.994c1.2358 0 1.9415-1.4108 1.2002-2.3997zm-7.1987 10.4c-0.27614 0-0.5 0.2239-0.5 0.5s0.22386 0.5 0.5 0.5h12c0.2761 0 0.5-0.2239 0.5-0.5s-0.2239-0.5-0.5-0.5z" fill="#212121"/> + <path id="path2" d="m11.598 7.2002c0.19996-0.26692 0.6002-0.26697 0.8003-1e-4l4.4982 6.0013c0.247 0.3296 0.0118 0.7999-0.4001 0.7999h-8.994c-0.41189 0-0.64712-0.4702-0.40016-0.7998zm1.6004-0.59987c-0.6001-0.8006-1.8009-0.80044-2.4007 3.2e-4l-4.4958 6.0012c-0.74086 0.989-0.03518 2.3994 1.2005 2.3994h8.994c1.2358 0 1.9415-1.4108 1.2002-2.3997zm-7.1987 10.4c-0.27614 0-0.5 0.2239-0.5 0.5s0.22386 0.5 0.5 0.5h12c0.2761 0 0.5-0.2239 0.5-0.5s-0.2239-0.5-0.5-0.5z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_1.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_1.svg index ad99595e58a98d3c7bd5dcc34824162737c3abbf..fea636b3566e79ccf375614d1d730539cae327c4 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_1.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_1.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2-224" d="m18.5 8.6712c0.1163 0 0.22329 0.039685 0.30822 0.1062l0.06731 0.063118 0.01625 0.018898c0.6931 0.85822 1.1082 1.9504 1.1082 3.1394 0 0.19691-0.01134 0.39152-0.03364 0.58273-0.30841-0.15496-0.6334-0.28195-0.9716-0.3772 0.0035-0.06803 0.0053-0.13682 0.0053-0.20561 0-0.95346-0.33358-1.829-0.8905-2.5163-0.06811-0.084661-0.10949-0.19351-0.10949-0.31257 0-0.27628 0.2239-0.50003 0.5-0.50003zm-6.293 7.3288c-0.09109 0.32239-0.1536 0.65658-0.18459 0.99999h-3.0224c-0.10174 0-0.20276-3e-3 -0.303-0.0076l1.6565 1.6554c0.17356 0.17348 0.19283 0.443 0.05787 0.63791l-0.05787 0.06916c-0.17356 0.17348-0.44299 0.19276-0.63786 0.05783l-0.06924-0.05783-2.5-2.5c-0.17357-0.17348-0.19285-0.44304-0.05786-0.63791l0.05786-0.06916 2.5-2.5c0.19526-0.19502 0.51184-0.19502 0.7071 0 0.17356 0.17348 0.19283 0.443 0.05787 0.63791l-0.05787 0.06916-1.6366 1.6365 0.14088 0.0076 0.14213 0.0025zm1.4394-11.354c0.17359-0.17348 0.443-0.19276 0.6379-0.057827l0.06932 0.057827 2.5 2.5 0.05779 0.069165c0.11811 0.17046 0.11811 0.39814 0 0.56863l-0.05779 0.069165-2.5 2.5-0.06932 0.05783c-0.17049 0.11792-0.3981 0.11792-0.5686 0l-0.06932-0.05783-0.05779-0.06916c-0.11811-0.17046-0.11811-0.3981 0-0.56863l0.05779-0.069165 1.6366-1.6366-0.1409-0.00756-0.14211-0.00249h-6c-2.2091 0-4 1.7909-4 4 0 0.9563 0.33557 1.8342 0.89537 2.5224 0.06417 0.08353 0.10463 0.19162 0.10463 0.30879 0 0.2759-0.22386 0.49999-0.5 0.49999-0.167 0-0.31488-0.08202-0.40568-0.2075-0.68439-0.85603-1.0943-1.9419-1.0943-3.1236 0-2.6888 2.1223-4.8818 4.7831-4.9954l0.21689-0.00378h6c0.10171 0 0.20281 0.00302 0.303 0.00756l-1.6566-1.6555-0.057789-0.069165c-0.13501-0.19502-0.11569-0.46428 0.057789-0.63783zm8.3536 12.854c0 2.4853-2.0147 4.5-4.5 4.5s-4.5-2.0147-4.5-4.5 2.0147-4.5 4.5-4.5 4.5 2.0147 4.5 4.5zm-3.9523-2.6614c-0.1844-0.05216-0.4905-0.03402-0.6794 0.2332-0.2132 0.30312-0.5812 0.72559-1.0919 0.9809-0.24699 0.12359-0.34711 0.4238-0.2236 0.67079 0.12352 0.24718 0.4238 0.34696 0.6708 0.22375 0.2993-0.14967 0.5578-0.33562 0.7764-0.52898v3.0818c0 0.27628 0.2239 0.49999 0.5 0.49999 0.27609 0 0.5-0.22375 0.5-0.49999v-4.0764c0-0.34847-0.26729-0.53261-0.4523-0.585z" fill="#212121"/> + <path id="path2-224" d="m18.5 8.6712c0.1163 0 0.22329 0.039685 0.30822 0.1062l0.06731 0.063118 0.01625 0.018898c0.6931 0.85822 1.1082 1.9504 1.1082 3.1394 0 0.19691-0.01134 0.39152-0.03364 0.58273-0.30841-0.15496-0.6334-0.28195-0.9716-0.3772 0.0035-0.06803 0.0053-0.13682 0.0053-0.20561 0-0.95346-0.33358-1.829-0.8905-2.5163-0.06811-0.084661-0.10949-0.19351-0.10949-0.31257 0-0.27628 0.2239-0.50003 0.5-0.50003zm-6.293 7.3288c-0.09109 0.32239-0.1536 0.65658-0.18459 0.99999h-3.0224c-0.10174 0-0.20276-3e-3 -0.303-0.0076l1.6565 1.6554c0.17356 0.17348 0.19283 0.443 0.05787 0.63791l-0.05787 0.06916c-0.17356 0.17348-0.44299 0.19276-0.63786 0.05783l-0.06924-0.05783-2.5-2.5c-0.17357-0.17348-0.19285-0.44304-0.05786-0.63791l0.05786-0.06916 2.5-2.5c0.19526-0.19502 0.51184-0.19502 0.7071 0 0.17356 0.17348 0.19283 0.443 0.05787 0.63791l-0.05787 0.06916-1.6366 1.6365 0.14088 0.0076 0.14213 0.0025zm1.4394-11.354c0.17359-0.17348 0.443-0.19276 0.6379-0.057827l0.06932 0.057827 2.5 2.5 0.05779 0.069165c0.11811 0.17046 0.11811 0.39814 0 0.56863l-0.05779 0.069165-2.5 2.5-0.06932 0.05783c-0.17049 0.11792-0.3981 0.11792-0.5686 0l-0.06932-0.05783-0.05779-0.06916c-0.11811-0.17046-0.11811-0.3981 0-0.56863l0.05779-0.069165 1.6366-1.6366-0.1409-0.00756-0.14211-0.00249h-6c-2.2091 0-4 1.7909-4 4 0 0.9563 0.33557 1.8342 0.89537 2.5224 0.06417 0.08353 0.10463 0.19162 0.10463 0.30879 0 0.2759-0.22386 0.49999-0.5 0.49999-0.167 0-0.31488-0.08202-0.40568-0.2075-0.68439-0.85603-1.0943-1.9419-1.0943-3.1236 0-2.6888 2.1223-4.8818 4.7831-4.9954l0.21689-0.00378h6c0.10171 0 0.20281 0.00302 0.303 0.00756l-1.6566-1.6555-0.057789-0.069165c-0.13501-0.19502-0.11569-0.46428 0.057789-0.63783zm8.3536 12.854c0 2.4853-2.0147 4.5-4.5 4.5s-4.5-2.0147-4.5-4.5 2.0147-4.5 4.5-4.5 4.5 2.0147 4.5 4.5zm-3.9523-2.6614c-0.1844-0.05216-0.4905-0.03402-0.6794 0.2332-0.2132 0.30312-0.5812 0.72559-1.0919 0.9809-0.24699 0.12359-0.34711 0.4238-0.2236 0.67079 0.12352 0.24718 0.4238 0.34696 0.6708 0.22375 0.2993-0.14967 0.5578-0.33562 0.7764-0.52898v3.0818c0 0.27628 0.2239 0.49999 0.5 0.49999 0.27609 0 0.5-0.22375 0.5-0.49999v-4.0764c0-0.34847-0.26729-0.53261-0.4523-0.585z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_all.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_all.svg index 159fa01b1e17e87c74168125e5f0b4f09001b664..23c2c0aaf0f9f7888d4365e4dc3f7d7fc3b7772b 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_all.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_repeat_all.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m18.5 8.6712c0.1163 0 0.2233 0.0397 0.3082 0.10629l0.0673 0.06306 0.0163 0.02c0.6931 0.8582 1.1082 1.9503 1.1082 3.1394 0 2.6888-2.1223 4.8818-4.7831 4.9954l-0.2169 0.0046h-6c-0.10174 0-0.20276-3e-3 -0.303-9e-3l1.6566 1.6554c0.17357 0.1736 0.19285 0.443 0.05786 0.6379l-0.05786 0.0693c-0.17356 0.1735-0.44299 0.1928-0.63786 0.0578l-0.06924-0.0578-2.5-2.5c-0.17357-0.1736-0.19285-0.443-0.05786-0.6379l0.05786-0.0693 2.5-2.5c0.19526-0.1952 0.51184-0.1952 0.7071 0 0.17357 0.1736 0.19285 0.443 0.05786 0.6379l-0.05786 0.0693-1.6366 1.6365 0.14088 0.0074 0.14213 0.0025h6c2.2091 0 4-1.7909 4-4 0-0.95348-0.3336-1.829-0.8905-2.5163-0.0681-0.08456-0.1095-0.19367-0.1095-0.31245 0-0.27614 0.2239-0.5 0.5-0.5zm-4.8536-4.0248c0.1736-0.17357 0.443-0.19285 0.6379-0.05786l0.0693 0.05786 2.5 2.5 0.0578 0.06924c0.1181 0.17051 0.1181 0.39811 0 0.56862l-0.0578 0.06924-2.5 2.5-0.0693 0.05786c-0.1705 0.11812-0.3981 0.11812-0.5686 0l-0.0693-0.05786-0.0578-0.06924c-0.1181-0.17051-0.1181-0.39811 0-0.56862l0.0578-0.06924 1.6366-1.6366-0.1409-0.00738-0.1421-0.00248h-6c-2.2091 0-4 1.7909-4 4 0 0.9563 0.33557 1.8342 0.89537 2.5224 0.06417 0.0836 0.10463 0.1915 0.10463 0.3089 0 0.2761-0.22386 0.5-0.5 0.5-0.167 0-0.31488-0.0819-0.40568-0.2077-0.68439-0.856-1.0943-1.9419-1.0943-3.1236 0-2.6888 2.1223-4.8818 4.7831-4.9954l0.21689-0.00462h6c0.1017 0 0.2028 0.00304 0.303 0.00903l-1.6566-1.6555-0.0578-0.06924c-0.135-0.19487-0.1157-0.4643 0.0578-0.63786z" fill="#212121"/> + <path id="path2" d="m18.5 8.6712c0.1163 0 0.2233 0.0397 0.3082 0.10629l0.0673 0.06306 0.0163 0.02c0.6931 0.8582 1.1082 1.9503 1.1082 3.1394 0 2.6888-2.1223 4.8818-4.7831 4.9954l-0.2169 0.0046h-6c-0.10174 0-0.20276-3e-3 -0.303-9e-3l1.6566 1.6554c0.17357 0.1736 0.19285 0.443 0.05786 0.6379l-0.05786 0.0693c-0.17356 0.1735-0.44299 0.1928-0.63786 0.0578l-0.06924-0.0578-2.5-2.5c-0.17357-0.1736-0.19285-0.443-0.05786-0.6379l0.05786-0.0693 2.5-2.5c0.19526-0.1952 0.51184-0.1952 0.7071 0 0.17357 0.1736 0.19285 0.443 0.05786 0.6379l-0.05786 0.0693-1.6366 1.6365 0.14088 0.0074 0.14213 0.0025h6c2.2091 0 4-1.7909 4-4 0-0.95348-0.3336-1.829-0.8905-2.5163-0.0681-0.08456-0.1095-0.19367-0.1095-0.31245 0-0.27614 0.2239-0.5 0.5-0.5zm-4.8536-4.0248c0.1736-0.17357 0.443-0.19285 0.6379-0.05786l0.0693 0.05786 2.5 2.5 0.0578 0.06924c0.1181 0.17051 0.1181 0.39811 0 0.56862l-0.0578 0.06924-2.5 2.5-0.0693 0.05786c-0.1705 0.11812-0.3981 0.11812-0.5686 0l-0.0693-0.05786-0.0578-0.06924c-0.1181-0.17051-0.1181-0.39811 0-0.56862l0.0578-0.06924 1.6366-1.6366-0.1409-0.00738-0.1421-0.00248h-6c-2.2091 0-4 1.7909-4 4 0 0.9563 0.33557 1.8342 0.89537 2.5224 0.06417 0.0836 0.10463 0.1915 0.10463 0.3089 0 0.2761-0.22386 0.5-0.5 0.5-0.167 0-0.31488-0.0819-0.40568-0.2077-0.68439-0.856-1.0943-1.9419-1.0943-3.1236 0-2.6888 2.1223-4.8818 4.7831-4.9954l0.21689-0.00462h6c0.1017 0 0.2028 0.00304 0.303 0.00903l-1.6566-1.6555-0.0578-0.06924c-0.135-0.19487-0.1157-0.4643 0.0578-0.63786z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_shuffle.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_shuffle.svg index 947f459724e72f295bb85e13f8f1866b93c207e0..dc0db7a8a5ab989951ec03323262e9ee3626278e 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_shuffle.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_arrow_shuffle.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m17.854 6.1464c-0.1953-0.19527-0.5119-0.19527-0.7072 0-0.1952 0.19526-0.1952 0.51184 0 0.7071l1.1488 1.1487c-3.3225 0.07241-5.2825 1.9019-7.1044 3.6025l-0.03192 0.02979c-1.8819 1.7565-3.6259 3.3655-6.6588 3.3655-0.27614 0-0.5 0.2239-0.5 0.5 0 0.2762 0.22386 0.5 0.5 0.5 3.4473 0 5.4502-1.8694 7.3092-3.6046l0.03192-0.0298c1.8381-1.7156 3.5446-3.2906 6.4491-3.363l-1.1439 1.1439c-0.1952 0.19526-0.1952 0.51184 0 0.70711 0.1953 0.19526 0.5119 0.19526 0.7072 0l2-2c0.1953-0.19526 0.1953-0.51184 0-0.7071zm-13.354 1.8536c2.8107 0 4.6612 1.2428 6.2564 2.6423l-0.27993 0.26122c-0.15483 0.14451-0.3069 0.28607-0.45704 0.42419-1.5026-1.3049-3.1014-2.3277-5.5195-2.3277-0.27614 0-0.5-0.22386-0.5-0.5s0.22386-0.5 0.5-0.5zm13.795 7.9978c-2.6964-0.0588-4.4954-1.2748-6.0516-2.64l0.2799-0.2611c0.1548-0.1446 0.3069-0.2862 0.4571-0.4243 1.4587 1.2667 3.0081 2.2677 5.3097 2.325l-1.1439-1.1439c-0.1952-0.1952-0.1952-0.5118 0-0.7071 0.1953-0.1953 0.5119-0.1953 0.7072 0l2 2c0.1953 0.1953 0.1953 0.5119 0 0.7072l-2 2c-0.1953 0.1953-0.5119 0.1953-0.7072 0-0.1952-0.1953-0.1952-0.5118 0-0.7071z" fill="#212121"/> + <path id="path2" d="m17.854 6.1464c-0.1953-0.19527-0.5119-0.19527-0.7072 0-0.1952 0.19526-0.1952 0.51184 0 0.7071l1.1488 1.1487c-3.3225 0.07241-5.2825 1.9019-7.1044 3.6025l-0.03192 0.02979c-1.8819 1.7565-3.6259 3.3655-6.6588 3.3655-0.27614 0-0.5 0.2239-0.5 0.5 0 0.2762 0.22386 0.5 0.5 0.5 3.4473 0 5.4502-1.8694 7.3092-3.6046l0.03192-0.0298c1.8381-1.7156 3.5446-3.2906 6.4491-3.363l-1.1439 1.1439c-0.1952 0.19526-0.1952 0.51184 0 0.70711 0.1953 0.19526 0.5119 0.19526 0.7072 0l2-2c0.1953-0.19526 0.1953-0.51184 0-0.7071zm-13.354 1.8536c2.8107 0 4.6612 1.2428 6.2564 2.6423l-0.27993 0.26122c-0.15483 0.14451-0.3069 0.28607-0.45704 0.42419-1.5026-1.3049-3.1014-2.3277-5.5195-2.3277-0.27614 0-0.5-0.22386-0.5-0.5s0.22386-0.5 0.5-0.5zm13.795 7.9978c-2.6964-0.0588-4.4954-1.2748-6.0516-2.64l0.2799-0.2611c0.1548-0.1446 0.3069-0.2862 0.4571-0.4243 1.4587 1.2667 3.0081 2.2677 5.3097 2.325l-1.1439-1.1439c-0.1952-0.1952-0.1952-0.5118 0-0.7071 0.1953-0.1953 0.5119-0.1953 0.7072 0l2 2c0.1953 0.1953 0.1953 0.5119 0 0.7072l-2 2c-0.1953 0.1953-0.5119 0.1953-0.7072 0-0.1952-0.1953-0.1952-0.5118 0-0.7071z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_fast_forward.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_fast_forward.svg index 66641969c9c3eeda2e0ca205ff90006046ab9192..5a0b1a303ad28b5fcca60c4808fa65b12f561668 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_fast_forward.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_fast_forward.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m12.018 7.4862c0-0.8191 0.9308-1.2908 1.5914-0.80641l5.8796 4.3117c0.681 0.49944 0.681 1.5165 0 2.016l-5.8796 4.3117c-0.6606 0.4844-1.5914 0.0127-1.5914-0.8064v-3.16l-5.4086 3.9664c-0.66052 0.4844-1.5914 0.0127-1.5914-0.8064v-9.0266c0-0.8191 0.93084-1.2908 1.5914-0.80641l5.4086 3.9663zm6.8796 4.3117-5.8796-4.3117v9.0266l5.8796-4.3117c0.1362-0.0999 0.1362-0.30335 0-0.40324zm-7 0-5.8796-4.3117v9.0266l5.8796-4.3117c0.1362-0.0999 0.1362-0.30335 0-0.40324z" fill="#212121"/> + <path id="path2" d="m12.018 7.4862c0-0.8191 0.9308-1.2908 1.5914-0.80641l5.8796 4.3117c0.681 0.49944 0.681 1.5165 0 2.016l-5.8796 4.3117c-0.6606 0.4844-1.5914 0.0127-1.5914-0.8064v-3.16l-5.4086 3.9664c-0.66052 0.4844-1.5914 0.0127-1.5914-0.8064v-9.0266c0-0.8191 0.93084-1.2908 1.5914-0.80641l5.4086 3.9663zm6.8796 4.3117-5.8796-4.3117v9.0266l5.8796-4.3117c0.1362-0.0999 0.1362-0.30335 0-0.40324zm-7 0-5.8796-4.3117v9.0266l5.8796-4.3117c0.1362-0.0999 0.1362-0.30335 0-0.40324z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_next.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_next.svg index d086f850d80ea37f9f481bd0fbcb9c531d851510..702e2cc6dc99b440c0c535e01f2c102a923ce511 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_next.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_next.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m19 5.5c0-0.27614-0.2239-0.5-0.5-0.5-0.2762 0-0.5 0.22386-0.5 0.5v13c0 0.2761 0.2238 0.5 0.5 0.5 0.2761 0 0.5-0.2239 0.5-0.5zm-14 0.75211c0-1.0002 1.1164-1.5954 1.9468-1.0378l8.4992 5.7071c0.7345 0.4932 0.7383 1.5724 0.0072 2.0707l-8.4993 5.7929c-0.82977 0.5655-1.954-0.0288-1.954-1.0329zm1.3894-0.20755c-0.16608-0.11152-0.38937 0.0075-0.38937 0.20755v11.5c0 0.2008 0.22485 0.3196 0.3908 0.2065l8.4993-5.7928c0.1462-0.0997 0.1455-0.31552-0.0014-0.41415z" fill="#212121"/> + <path id="path2" d="m19 5.5c0-0.27614-0.2239-0.5-0.5-0.5-0.2762 0-0.5 0.22386-0.5 0.5v13c0 0.2761 0.2238 0.5 0.5 0.5 0.2761 0 0.5-0.2239 0.5-0.5zm-14 0.75211c0-1.0002 1.1164-1.5954 1.9468-1.0378l8.4992 5.7071c0.7345 0.4932 0.7383 1.5724 0.0072 2.0707l-8.4993 5.7929c-0.82977 0.5655-1.954-0.0288-1.954-1.0329zm1.3894-0.20755c-0.16608-0.11152-0.38937 0.0075-0.38937 0.20755v11.5c0 0.2008 0.22485 0.3196 0.3908 0.2065l8.4993-5.7928c0.1462-0.0997 0.1455-0.31552-0.0014-0.41415z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_options.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_options.svg index fef3c82338b3d75685981d7f77a6135fe7bc3533..c8ac5f6d4fc6c4b053dd3b2b653135954697aee9 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_options.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_options.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m16.95 7c-0.2316-1.1411-1.2405-2-2.45-2s-2.2184 0.85888-2.45 2h-7.55c-0.27614 0-0.5 0.22386-0.5 0.5s0.22386 0.5 0.5 0.5h7.55c0.2316 1.1411 1.2405 2 2.45 2 1.2297 0 2.252-0.88783 2.461-2.0575-0.0035 0.01923-0.0071 0.03839-0.011 0.05746h2.55c0.2761 0 0.5-0.22386 0.5-0.5s-0.2239-0.5-0.5-0.5zm-2.45 2c-0.8284 0-1.5-0.67157-1.5-1.5s0.6716-1.5 1.5-1.5 1.5 0.67157 1.5 1.5-0.6716 1.5-1.5 1.5zm-2.55 7c-0.23163-1.1411-1.2405-2-2.45-2s-2.2184 0.8589-2.45 2h-2.55c-0.27614 0-0.5 0.2239-0.5 0.5s0.22386 0.5 0.5 0.5h2.55c0.23163 1.1411 1.2405 2 2.45 2s2.2184-0.8589 2.45-2h7.55c0.2761 0 0.5-0.2239 0.5-0.5s-0.2239-0.5-0.5-0.5zm-2.45 2c-0.82843 0-1.5-0.6716-1.5-1.5s0.67157-1.5 1.5-1.5 1.5 0.6716 1.5 1.5-0.67157 1.5-1.5 1.5z" fill="#212121"/> + <path id="path2" d="m16.95 7c-0.2316-1.1411-1.2405-2-2.45-2s-2.2184 0.85888-2.45 2h-7.55c-0.27614 0-0.5 0.22386-0.5 0.5s0.22386 0.5 0.5 0.5h7.55c0.2316 1.1411 1.2405 2 2.45 2 1.2297 0 2.252-0.88783 2.461-2.0575-0.0035 0.01923-0.0071 0.03839-0.011 0.05746h2.55c0.2761 0 0.5-0.22386 0.5-0.5s-0.2239-0.5-0.5-0.5zm-2.45 2c-0.8284 0-1.5-0.67157-1.5-1.5s0.6716-1.5 1.5-1.5 1.5 0.67157 1.5 1.5-0.6716 1.5-1.5 1.5zm-2.55 7c-0.23163-1.1411-1.2405-2-2.45-2s-2.2184 0.8589-2.45 2h-2.55c-0.27614 0-0.5 0.2239-0.5 0.5s0.22386 0.5 0.5 0.5h2.55c0.23163 1.1411 1.2405 2 2.45 2s2.2184-0.8589 2.45-2h7.55c0.2761 0 0.5-0.2239 0.5-0.5s-0.2239-0.5-0.5-0.5zm-2.45 2c-0.82843 0-1.5-0.6716-1.5-1.5s0.67157-1.5 1.5-1.5 1.5 0.6716 1.5 1.5-0.67157 1.5-1.5 1.5z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_play_filled.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_play_filled.svg index 6d13a629d414110807b3ed1c474f5d3a26ab92f9..6205b82ec580c90cb853f6ef1307f3fe8749d426 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_play_filled.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_play_filled.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m19.222 10.685c1.0365 0.5698 1.0365 2.0591 0 2.6289l-9.9995 5.497c-0.99967 0.5495-2.2226-0.1738-2.2226-1.3145v-10.994c0-1.1408 1.2229-1.864 2.2226-1.3145z" fill="#212121"/> + <path id="path2" d="m19.222 10.685c1.0365 0.5698 1.0365 2.0591 0 2.6289l-9.9995 5.497c-0.99967 0.5495-2.2226-0.1738-2.2226-1.3145v-10.994c0-1.1408 1.2229-1.864 2.2226-1.3145z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_previous.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_previous.svg index fb94c8ce10825c876242447496a266645a3917bf..8b282a1f1633daa4f6d49df38275a7279a1e1e37 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_previous.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_previous.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m5 5.5c0-0.27614 0.22386-0.5 0.5-0.5s0.5 0.22386 0.5 0.5v13c0 0.2761-0.22386 0.5-0.5 0.5s-0.5-0.2239-0.5-0.5zm14 0.75211c0-1.0002-1.1164-1.5954-1.9468-1.0378l-8.4992 5.7071c-0.73449 0.4932-0.73822 1.5724-0.00717 2.0707l8.4992 5.7929c0.8298 0.5655 1.954-0.0288 1.954-1.0329zm-1.3893-0.20755c0.1661-0.11152 0.3893 0.0075 0.3893 0.20755v11.5c0 0.2008-0.2248 0.3196-0.3908 0.2065l-8.4992-5.7928c-0.14621-0.0997-0.14547-0.31552 0.00143-0.41415z" fill="#212121"/> + <path id="path2" d="m5 5.5c0-0.27614 0.22386-0.5 0.5-0.5s0.5 0.22386 0.5 0.5v13c0 0.2761-0.22386 0.5-0.5 0.5s-0.5-0.2239-0.5-0.5zm14 0.75211c0-1.0002-1.1164-1.5954-1.9468-1.0378l-8.4992 5.7071c-0.73449 0.4932-0.73822 1.5724-0.00717 2.0707l8.4992 5.7929c0.8298 0.5655 1.954-0.0288 1.954-1.0329zm-1.3893-0.20755c0.1661-0.11152 0.3893 0.0075 0.3893 0.20755v11.5c0 0.2008-0.2248 0.3196-0.3908 0.2065l-8.4992-5.7928c-0.14621-0.0997-0.14547-0.31552 0.00143-0.41415z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_rewind.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_rewind.svg index e1fda6461a3127fd53241940e9dcd067bca51c82..60080a9c861b10092915d74da1379f426978832d 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_rewind.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_rewind.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m12 7.4871c0-0.8191-0.93084-1.2908-1.5914-0.8064l-5.8796 4.3117c-0.68106 0.49945-0.68106 1.5166 0 2.016l5.8796 4.3117c0.66052 0.4844 1.5914 0.0127 1.5914-0.8064v-3.1599l5.4086 3.9663c0.6606 0.4844 1.5914 0.0127 1.5914-0.8064v-9.0266c0-0.8191-0.9308-1.2908-1.5914-0.8064l-5.4086 3.9663zm-6.8796 4.3117 5.8796-4.3117v9.0266l-5.8796-4.3117c-0.13621-0.0998-0.13621-0.30327 0-0.40316zm7 0 5.8796-4.3117v9.0266l-5.8796-4.3117c-0.1362-0.0998-0.1362-0.30327 0-0.40316z" fill="#212121"/> + <path id="path2" d="m12 7.4871c0-0.8191-0.93084-1.2908-1.5914-0.8064l-5.8796 4.3117c-0.68106 0.49945-0.68106 1.5166 0 2.016l5.8796 4.3117c0.66052 0.4844 1.5914 0.0127 1.5914-0.8064v-3.1599l5.4086 3.9663c0.6606 0.4844 1.5914 0.0127 1.5914-0.8064v-9.0266c0-0.8191-0.9308-1.2908-1.5914-0.8064l-5.4086 3.9663zm-6.8796 4.3117 5.8796-4.3117v9.0266l-5.8796-4.3117c-0.13621-0.0998-0.13621-0.30327 0-0.40316zm7 0 5.8796-4.3117v9.0266l-5.8796-4.3117c-0.1362-0.0998-0.1362-0.30327 0-0.40316z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_skip_back_10.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_skip_back_10.svg index cc00248855dc5088409d2c7dc27fc598179eaab9..e9019810fb7b8e7c3b1ec04f53a539a97b3d5a1e 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_skip_back_10.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_skip_back_10.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m4.998 5.5c0-0.27614 0.22385-0.5 0.5-0.5 0.27614 0 0.5 0.22386 0.5 0.5v2.2063c0.91262-1.0345 2.0839-1.8225 3.4064-2.2752 1.8362-0.62864 3.8384-0.56798 5.6332 0.17064s3.2597 2.1048 4.1216 3.8438c0.1226 0.24742 0.0215 0.54741-0.226 0.67003-0.2474 0.12263-0.5474 0.02146-0.67-0.22596-0.7541-1.5215-2.0358-2.7168-3.6062-3.3631-1.5703-0.64625-3.3221-0.69932-4.9287-0.1493-1.4133 0.48384-2.6293 1.4053-3.4765 2.6228h3.2462c0.27614 0 0.5 0.22386 0.5 0.5s-0.22386 0.5-0.5 0.5h-4c-0.27615 0-0.5-0.22386-0.5-0.5zm5.002 7c0-0.1844-0.10149-0.3538-0.26407-0.4408-0.16258-0.08705-0.35985-0.07751-0.51328 0.0248l-1.5 1c-0.22976 0.1532-0.29185 0.4636-0.13867 0.6934 0.15317 0.2297 0.46361 0.2918 0.69337 0.1386l0.72265-0.4817v5.0657c0 0.2761 0.22386 0.5 0.5 0.5 0.27615 0 0.5-0.2239 0.5-0.5zm4.5028-0.5c-0.9349 0-1.5971 0.4367-1.9958 1.1292-0.3765 0.6541-0.5042 1.5074-0.5042 2.3708s0.1277 1.7167 0.5042 2.3708c0.3987 0.6925 1.0609 1.1292 1.9958 1.1292 0.935 0 1.5972-0.4367 1.9959-1.1292 0.3765-0.6541 0.5041-1.5074 0.5041-2.3708s-0.1276-1.7167-0.5041-2.3708c-0.3987-0.6925-1.0609-1.1292-1.9959-1.1292zm-1.5 3.5c0-0.7935 0.1224-1.4402 0.3709-1.8719 0.2263-0.3932 0.5641-0.6281 1.1291-0.6281 0.5651 0 0.9029 0.2349 1.1292 0.6281 0.2485 0.4317 0.3708 1.0784 0.3708 1.8719s-0.1223 1.4402-0.3708 1.8719c-0.2263 0.3932-0.5641 0.6281-1.1292 0.6281-0.565 0-0.9028-0.2349-1.1291-0.6281-0.2485-0.4317-0.3709-1.0784-0.3709-1.8719z" fill="#212121"/> + <path id="path2" d="m4.998 5.5c0-0.27614 0.22385-0.5 0.5-0.5 0.27614 0 0.5 0.22386 0.5 0.5v2.2063c0.91262-1.0345 2.0839-1.8225 3.4064-2.2752 1.8362-0.62864 3.8384-0.56798 5.6332 0.17064s3.2597 2.1048 4.1216 3.8438c0.1226 0.24742 0.0215 0.54741-0.226 0.67003-0.2474 0.12263-0.5474 0.02146-0.67-0.22596-0.7541-1.5215-2.0358-2.7168-3.6062-3.3631-1.5703-0.64625-3.3221-0.69932-4.9287-0.1493-1.4133 0.48384-2.6293 1.4053-3.4765 2.6228h3.2462c0.27614 0 0.5 0.22386 0.5 0.5s-0.22386 0.5-0.5 0.5h-4c-0.27615 0-0.5-0.22386-0.5-0.5zm5.002 7c0-0.1844-0.10149-0.3538-0.26407-0.4408-0.16258-0.08705-0.35985-0.07751-0.51328 0.0248l-1.5 1c-0.22976 0.1532-0.29185 0.4636-0.13867 0.6934 0.15317 0.2297 0.46361 0.2918 0.69337 0.1386l0.72265-0.4817v5.0657c0 0.2761 0.22386 0.5 0.5 0.5 0.27615 0 0.5-0.2239 0.5-0.5zm4.5028-0.5c-0.9349 0-1.5971 0.4367-1.9958 1.1292-0.3765 0.6541-0.5042 1.5074-0.5042 2.3708s0.1277 1.7167 0.5042 2.3708c0.3987 0.6925 1.0609 1.1292 1.9958 1.1292 0.935 0 1.5972-0.4367 1.9959-1.1292 0.3765-0.6541 0.5041-1.5074 0.5041-2.3708s-0.1276-1.7167-0.5041-2.3708c-0.3987-0.6925-1.0609-1.1292-1.9959-1.1292zm-1.5 3.5c0-0.7935 0.1224-1.4402 0.3709-1.8719 0.2263-0.3932 0.5641-0.6281 1.1291-0.6281 0.5651 0 0.9029 0.2349 1.1292 0.6281 0.2485 0.4317 0.3708 1.0784 0.3708 1.8719s-0.1223 1.4402-0.3708 1.8719c-0.2263 0.3932-0.5641 0.6281-1.1292 0.6281-0.565 0-0.9028-0.2349-1.1291-0.6281-0.2485-0.4317-0.3709-1.0784-0.3709-1.8719z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_skip_forward_10.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_skip_forward_10.svg index 5fb543f042fcdfccb02dbd25155ce17fb7d4a60a..30b62c599d69bf03b92f9c6626c5dc705654e116 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_skip_forward_10.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_skip_forward_10.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m18.999 5.5c0-0.27614-0.2238-0.5-0.5-0.5-0.2761 0-0.5 0.22386-0.5 0.5v2.2024c-0.9121-1.0326-2.0822-1.8192-3.403-2.2714-1.8362-0.62864-3.8384-0.56798-5.6332 0.17064s-3.2597 2.1048-4.1216 3.8438c-0.12263 0.24742-0.02146 0.54741 0.22596 0.67003 0.24742 0.12263 0.5474 0.02146 0.67003-0.22596 0.75409-1.5215 2.0358-2.7168 3.6062-3.3631 1.5704-0.64625 3.3222-0.69932 4.9288-0.1493 1.4133 0.48384 2.6293 1.4053 3.4766 2.6228h-3.2497c-0.2761 0-0.5 0.22386-0.5 0.5s0.2239 0.5 0.5 0.5h4c0.2762 0 0.5-0.22386 0.5-0.5zm-6.4929 7.6292c0.3987-0.6925 1.0609-1.1292 1.9959-1.1292 0.9349 0 1.5971 0.4367 1.9958 1.1292 0.3765 0.6541 0.5042 1.5074 0.5042 2.3708s-0.1277 1.7167-0.5042 2.3708c-0.3987 0.6925-1.0609 1.1292-1.9958 1.1292-0.935 0-1.5972-0.4367-1.9959-1.1292-0.3765-0.6541-0.5041-1.5074-0.5041-2.3708s0.1276-1.7167 0.5041-2.3708zm0.8667 0.4989c-0.2485 0.4317-0.3708 1.0784-0.3708 1.8719s0.1223 1.4402 0.3708 1.8719c0.2263 0.3932 0.5641 0.6281 1.1292 0.6281 0.565 0 0.9028-0.2349 1.1291-0.6281 0.2485-0.4317 0.3709-1.0784 0.3709-1.8719s-0.1224-1.4402-0.3709-1.8719c-0.2263-0.3932-0.5641-0.6281-1.1291-0.6281-0.5651 0-0.9029 0.2349-1.1292 0.6281zm-3.3737-1.1281c0-0.1844-0.1015-0.3538-0.26407-0.4408-0.16258-0.08705-0.35986-0.07751-0.51328 0.0248l-1.5 1c-0.22977 0.1532-0.29185 0.4636-0.13868 0.6934 0.15318 0.2297 0.46361 0.2918 0.69338 0.1386l0.72265-0.4817v5.0657c0 0.2761 0.22385 0.5 0.5 0.5 0.27614 0 0.5-0.2239 0.5-0.5z" fill="#212121"/> + <path id="path2" d="m18.999 5.5c0-0.27614-0.2238-0.5-0.5-0.5-0.2761 0-0.5 0.22386-0.5 0.5v2.2024c-0.9121-1.0326-2.0822-1.8192-3.403-2.2714-1.8362-0.62864-3.8384-0.56798-5.6332 0.17064s-3.2597 2.1048-4.1216 3.8438c-0.12263 0.24742-0.02146 0.54741 0.22596 0.67003 0.24742 0.12263 0.5474 0.02146 0.67003-0.22596 0.75409-1.5215 2.0358-2.7168 3.6062-3.3631 1.5704-0.64625 3.3222-0.69932 4.9288-0.1493 1.4133 0.48384 2.6293 1.4053 3.4766 2.6228h-3.2497c-0.2761 0-0.5 0.22386-0.5 0.5s0.2239 0.5 0.5 0.5h4c0.2762 0 0.5-0.22386 0.5-0.5zm-6.4929 7.6292c0.3987-0.6925 1.0609-1.1292 1.9959-1.1292 0.9349 0 1.5971 0.4367 1.9958 1.1292 0.3765 0.6541 0.5042 1.5074 0.5042 2.3708s-0.1277 1.7167-0.5042 2.3708c-0.3987 0.6925-1.0609 1.1292-1.9958 1.1292-0.935 0-1.5972-0.4367-1.9959-1.1292-0.3765-0.6541-0.5041-1.5074-0.5041-2.3708s0.1276-1.7167 0.5041-2.3708zm0.8667 0.4989c-0.2485 0.4317-0.3708 1.0784-0.3708 1.8719s0.1223 1.4402 0.3708 1.8719c0.2263 0.3932 0.5641 0.6281 1.1292 0.6281 0.565 0 0.9028-0.2349 1.1291-0.6281 0.2485-0.4317 0.3709-1.0784 0.3709-1.8719s-0.1224-1.4402-0.3709-1.8719c-0.2263-0.3932-0.5641-0.6281-1.1291-0.6281-0.5651 0-0.9029 0.2349-1.1292 0.6281zm-3.3737-1.1281c0-0.1844-0.1015-0.3538-0.26407-0.4408-0.16258-0.08705-0.35986-0.07751-0.51328 0.0248l-1.5 1c-0.22977 0.1532-0.29185 0.4636-0.13868 0.6934 0.15318 0.2297 0.46361 0.2918 0.69338 0.1386l0.72265-0.4817v5.0657c0 0.2761 0.22385 0.5 0.5 0.5 0.27614 0 0.5-0.2239 0.5-0.5z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_fluent_stop.svg b/modules/gui/qt/pixmaps/menu/ic_fluent_stop.svg index 7ffea64b14f33d06872c881f18c87bddc3173e5d..964ae5b520d6b7b9b7ef7dded846e0dda1dfd105 100644 --- a/modules/gui/qt/pixmaps/menu/ic_fluent_stop.svg +++ b/modules/gui/qt/pixmaps/menu/ic_fluent_stop.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2" d="m17.5 6c0.2761 0 0.5 0.22386 0.5 0.5v11c0 0.2761-0.2239 0.5-0.5 0.5h-11c-0.27614 0-0.5-0.2239-0.5-0.5v-11c0-0.27614 0.22386-0.5 0.5-0.5zm-11-1c-0.82843 0-1.5 0.67157-1.5 1.5v11c0 0.8284 0.67157 1.5 1.5 1.5h11c0.8284 0 1.5-0.6716 1.5-1.5v-11c0-0.82843-0.6716-1.5-1.5-1.5z" fill="#212121"/> + <path id="path2" d="m17.5 6c0.2761 0 0.5 0.22386 0.5 0.5v11c0 0.2761-0.2239 0.5-0.5 0.5h-11c-0.27614 0-0.5-0.2239-0.5-0.5v-11c0-0.27614 0.22386-0.5 0.5-0.5zm-11-1c-0.82843 0-1.5 0.67157-1.5 1.5v11c0 0.8284 0.67157 1.5 1.5 1.5h11c0.8284 0 1.5-0.6716 1.5-1.5v-11c0-0.82843-0.6716-1.5-1.5-1.5z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_pause_filled.svg b/modules/gui/qt/pixmaps/menu/ic_pause_filled.svg index 8461e77bc5d84131f1976df2c84ab13349ac7953..bb0801f8c14c3f7acab886a9570e89fc368de268 100644 --- a/modules/gui/qt/pixmaps/menu/ic_pause_filled.svg +++ b/modules/gui/qt/pixmaps/menu/ic_pause_filled.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="rect1029" d="m8.5 5c-0.831 0-1.5 0.669-1.5 1.5v11c0 0.831 0.669 1.5 1.5 1.5s1.5-0.669 1.5-1.5v-11c0-0.831-0.669-1.5-1.5-1.5zm7 0c-0.831 0-1.5 0.669-1.5 1.5v11c0 0.831 0.669 1.5 1.5 1.5s1.5-0.669 1.5-1.5v-11c0-0.831-0.669-1.5-1.5-1.5z" fill="#000"/> + <path id="rect1029" d="m8.5 5c-0.831 0-1.5 0.669-1.5 1.5v11c0 0.831 0.669 1.5 1.5 1.5s1.5-0.669 1.5-1.5v-11c0-0.831-0.669-1.5-1.5-1.5zm7 0c-0.831 0-1.5 0.669-1.5 1.5v11c0 0.831 0.669 1.5 1.5 1.5s1.5-0.669 1.5-1.5v-11c0-0.831-0.669-1.5-1.5-1.5z" fill="#FF00FF"/> </svg> diff --git a/modules/gui/qt/pixmaps/menu/ic_playlist.svg b/modules/gui/qt/pixmaps/menu/ic_playlist.svg index b2cd9e8302414e77d2abc7d513baac2036dec75e..61a9d0cd6a39c74fcb16e207dec70008ff45c321 100644 --- a/modules/gui/qt/pixmaps/menu/ic_playlist.svg +++ b/modules/gui/qt/pixmaps/menu/ic_playlist.svg @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <svg id="svg4" width="24" height="24" fill="none" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path id="path2158" d="m4.5 6a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h9a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-9zm0 4a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h9a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-9zm9.7188 3.002c-0.63441 0.02776-1.2188 0.5487-1.2188 1.2441v5.5078c0 0.92717 1.0373 1.5446 1.8496 1.0957l4.9883-2.7539c0.8396-0.46365 0.83939-1.7274 0-2.1914l-4.9883-2.7539c-0.20304-0.11215-0.41939-0.15769-0.63086-0.14844zm0.013672 0.98438c0.043094 9.6e-4 0.088524 0.013522 0.13477 0.039063l4.9863 2.7539c0.19449 0.1075 0.19428 0.33412 0 0.44141l-4.9863 2.7539c-0.18484 0.10215-0.36719-0.005178-0.36719-0.2207v-5.5078c0-0.16187 0.10314-0.26264 0.23242-0.25977zm-9.7324 0.013672a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h5a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-5z" color="#000000" fill="#000" fill-rule="evenodd"/> + <path id="path2158" d="m4.5 6a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h9a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-9zm0 4a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h9a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-9zm9.7188 3.002c-0.63441 0.02776-1.2188 0.5487-1.2188 1.2441v5.5078c0 0.92717 1.0373 1.5446 1.8496 1.0957l4.9883-2.7539c0.8396-0.46365 0.83939-1.7274 0-2.1914l-4.9883-2.7539c-0.20304-0.11215-0.41939-0.15769-0.63086-0.14844zm0.013672 0.98438c0.043094 9.6e-4 0.088524 0.013522 0.13477 0.039063l4.9863 2.7539c0.19449 0.1075 0.19428 0.33412 0 0.44141l-4.9863 2.7539c-0.18484 0.10215-0.36719-0.005178-0.36719-0.2207v-5.5078c0-0.16187 0.10314-0.26264 0.23242-0.25977zm-9.7324 0.013672a0.5 0.5 0 0 0-0.5 0.5 0.5 0.5 0 0 0 0.5 0.5h5a0.5 0.5 0 0 0 0.5-0.5 0.5 0.5 0 0 0-0.5-0.5h-5z" color="#FF00FF" fill="#FF00FF" fill-rule="evenodd"/> </svg> diff --git a/modules/gui/qt/util/color_svg_image_provider.cpp b/modules/gui/qt/util/color_svg_image_provider.cpp index 7135ef869eb1ed5c5f3560c511b00a06c83d6ac3..baf375dd0babf4b286a41b68951d73c962824215 100644 --- a/modules/gui/qt/util/color_svg_image_provider.cpp +++ b/modules/gui/qt/util/color_svg_image_provider.cpp @@ -28,29 +28,60 @@ #include <QQmlFile> #include <QDebug> -#define PATH_KEY "_res_PATH" -#define BACKGROUND_KEY "_res_BG" -#define COLOR1_KEY "_res_C1" -#define COLOR2_KEY "_res_C2" -#define COLOR_ACCENT_KEY "_res_ACCENT" - -namespace { - static const QMap<QString, QString> predefinedSubst = { {COLOR1_KEY, "#FF00FF"}, {COLOR2_KEY, "#00FFFF"}, {COLOR_ACCENT_KEY, "#FF8800"}, }; +QPair<QByteArray, std::optional<QColor>> colorizeSvg(const QString &filename, const QList<QPair<QString, QString> > &replacements) +{ + QFile file(filename); + if (!file.open(QIODevice::ReadOnly)) + { + qWarning() << "SVGColorizer: can not open file " << filename << " for read."; + return {}; + } + + QByteArray data = file.readAll(); + //we pass by QString because we want to perform case incensite replacements + QString dataStr = QString::fromUtf8(data); + + std::optional<QColor> backgroundColor; + + for (const auto& replacePair: replacements) + { + if (replacePair.first == PATH_KEY) + continue; + else if (replacePair.first == BACKGROUND_KEY) + { + backgroundColor = QColor(replacePair.second); + } + else if (predefinedSubst.contains(replacePair.first)) + { + dataStr = dataStr.replace(predefinedSubst[replacePair.first], + replacePair.second, Qt::CaseInsensitive); + } + else + { + dataStr = dataStr.replace(replacePair.first, replacePair.second, Qt::CaseInsensitive); + } + } + + return {dataStr.toUtf8(), backgroundColor}; +} + +namespace { + class SVGColorImageReader: public AsyncTask<QImage> { public: SVGColorImageReader(const QString& filename, const QList<QPair<QString, QString>>& replacements, QSize requestedSize) : AsyncTask<QImage>() + , m_fileName(filename) , m_requestedSize(requestedSize) , m_replacements(replacements) { - m_file = new QFile(filename, this); if (!m_requestedSize.isValid()) m_requestedSize = QSize{256, 256}; } @@ -63,7 +94,9 @@ public: return {}; } - if (!m_file->open(QIODevice::ReadOnly)) + const auto data = colorizeSvg(m_fileName, m_replacements); + + if (data.first.isEmpty()) { m_error = "file can't be opened"; return {}; @@ -71,29 +104,10 @@ public: QColor backgroundColor{Qt::transparent}; - QByteArray data = m_file->readAll(); - //we pass by QString because we want to perform case incensite replacements - QString dataStr = QString::fromUtf8(data); - for (const auto& replacePair: m_replacements) - { - if (replacePair.first == PATH_KEY) - continue; - else if (replacePair.first == BACKGROUND_KEY) - { - backgroundColor = QColor(replacePair.second); - } - else if (predefinedSubst.contains(replacePair.first)) - { - dataStr = dataStr.replace(predefinedSubst[replacePair.first], - replacePair.second, Qt::CaseInsensitive); - } - else - { - dataStr = dataStr.replace(replacePair.first, replacePair.second, Qt::CaseInsensitive); - } - } + if (data.second.has_value()) + backgroundColor = *data.second; - QSvgRenderer renderer(dataStr.toUtf8()); + QSvgRenderer renderer(data.first); if (!renderer.isValid()) { m_error = "can't parse SVG content"; @@ -139,7 +153,7 @@ public: } private: - QFile* m_file = nullptr; + QString m_fileName; QString m_error; QSize m_requestedSize; QList<QPair<QString, QString>> m_replacements; diff --git a/modules/gui/qt/util/color_svg_image_provider.hpp b/modules/gui/qt/util/color_svg_image_provider.hpp index 0d0491443018651f5276b9ac26962e2441746bb7..322eef63b01ed4b01f9f50f3770adc4ae482d861 100644 --- a/modules/gui/qt/util/color_svg_image_provider.hpp +++ b/modules/gui/qt/util/color_svg_image_provider.hpp @@ -24,6 +24,14 @@ #include <QString> #include <QUrlQuery> +#define PATH_KEY "_res_PATH" +#define BACKGROUND_KEY "_res_BG" +#define COLOR1_KEY "_res_C1" +#define COLOR2_KEY "_res_C2" +#define COLOR_ACCENT_KEY "_res_ACCENT" + +QPair<QByteArray, std::optional<QColor>> colorizeSvg(const QString& filename, const QList<QPair<QString, QString>>& replacements); + class SVGColorImageImageProvider: public QQuickAsyncImageProvider { public: diff --git a/modules/gui/qt/util/colorizedsvgicon.cpp b/modules/gui/qt/util/colorizedsvgicon.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a1c02f282098169340b7e4fec630ccacdbf2adc1 --- /dev/null +++ b/modules/gui/qt/util/colorizedsvgicon.cpp @@ -0,0 +1,123 @@ +/***************************************************************************** + * Copyright (C) 2025 VLC authors and VideoLAN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * ( at your option ) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#include "colorizedsvgicon.hpp" + +#include <QPluginLoader> +#include <QIconEnginePlugin> +#include <QIconEngine> +#include <QPointer> +#include <QWidget> +#include <QFileInfo> + +ColorizedSvgIcon::ColorizedSvgIcon(QString filename, std::optional<QColor> color1, std::optional<QColor> color2, std::optional<QColor> accentColor, const QList<QPair<QString, QString> > &otherReplacements) + : QIcon(newEngine()) // QIcon takes the ownership of the icon engine +{ + captureEngine(); + + if (!m_engine) + { + qWarning() << "ColorizedSvgIcon: could not create svg icon engine, icon " << filename << " will not be colorized."; + addFile(filename); + return; + } + + QList<QPair<QString, QString>> replacements; + { + if (color1.has_value()) + replacements.push_back({QStringLiteral(COLOR1_KEY), color1->name(QColor::HexRgb)}); + + if (color2.has_value()) + replacements.push_back({QStringLiteral(COLOR2_KEY), color2->name(QColor::HexRgb)}); + + if (accentColor.has_value()) + replacements.push_back({QStringLiteral(COLOR_ACCENT_KEY), accentColor->name(QColor::HexRgb)}); + + replacements.append(otherReplacements.begin(), otherReplacements.end()); + } + + QByteArray data; + { + // Serialization (akin to `QSvgIconEngine::write()`): + int isCompressed = 0; + + QHash<int, QString> svgFiles; + QHash<int, QByteArray> svgBuffers; + + const QByteArray& buf = colorizeSvg(filename, replacements).first; + + const auto key = hashKey(Normal, Off); // QIcon(QString) uses these settings + + // Different colored svgs should have different file names assigned, + // for now it is not relevant, so don't provide the file name to the + // engine: + // svgFiles.insert(key, filename); + svgBuffers.insert(key, buf); + + QDataStream out(&data, QDataStream::OpenModeFlag::WriteOnly); + + out << svgFiles << isCompressed << svgBuffers; + out << 0; // no additional added pixmaps + } + + { + // Feed the engine with the colorized svg content: + QDataStream in(std::as_const(data)); // read-only + if (!m_engine->read(in)) + { + qWarning() << "ColorizedSvgIcon: svg icon engine can not read contents, icon " << filename << " will not be colorized."; + addFile(filename); + return; + } + } +} + +ColorizedSvgIcon ColorizedSvgIcon::colorizedIconForWidget(const QString &fileName, const QWidget *widget) +{ + assert(widget); + return ColorizedSvgIcon(fileName, widget->palette().text().color()); +} + +QIconEngine *ColorizedSvgIcon::svgIconEngine() +{ + static const auto plugin = []() -> QPointer<QIconEnginePlugin> { +#ifdef QT_STATIC + const auto& staticPlugins = QPluginLoader::staticInstances(); + const auto it = std::find_if(staticPlugins.begin(), staticPlugins.end(), [](QObject *obj) -> bool { + return obj->inherits("QSvgIconPlugin"); + }); + + if (it != staticPlugins.end()) + return qobject_cast<QIconEnginePlugin*>(*it); + else + return nullptr; +#else + QPluginLoader loader(QStringLiteral("iconengines/qsvgicon")); // Official Qt plugin + // No need to check the metadata (or inherits `QSvgIconPlugin`), a plugin named "qsvgicon" should already support svg. + return qobject_cast<QIconEnginePlugin*>(loader.instance()); +#endif + }(); + + if (!plugin) + { + qWarning() << "ColorizedSvgIcon: svg icon plugin is not found."; + return nullptr; + } + + return plugin->create(); +} diff --git a/modules/gui/qt/util/colorizedsvgicon.hpp b/modules/gui/qt/util/colorizedsvgicon.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c7b88962df95b352f3f8b6f02c8958723ee2081b --- /dev/null +++ b/modules/gui/qt/util/colorizedsvgicon.hpp @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (C) 2025 VLC authors and VideoLAN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * ( at your option ) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ +#ifndef COLORIZEDSVGICON_HPP +#define COLORIZEDSVGICON_HPP + +#include <QIcon> + +#include "util/color_svg_image_provider.hpp" + +#include <QMutex> + +#include <optional> + +class ColorizedSvgIcon : public QIcon +{ + QIconEngine *m_engine = nullptr; + + inline static QMutex engineLock; + inline static QIconEngine *lastEngine; // static variables are initialized by default + + static QIconEngine *newEngine() + { + engineLock.lock(); + assert(!lastEngine); + lastEngine = svgIconEngine(); + return lastEngine; + } + + void captureEngine() + { + assert(!m_engine); + assert(lastEngine); + m_engine = lastEngine; + lastEngine = nullptr; + engineLock.unlock(); + } + + static int hashKey(QIcon::Mode mode, QIcon::State state) + { + // From QSvgIconEnginePrivate: + return ((mode << 4) | state); + } + +public: + explicit ColorizedSvgIcon(QString filename, + std::optional<QColor> color1 = std::nullopt, + std::optional<QColor> color2 = std::nullopt, + std::optional<QColor> accentColor = std::nullopt, + const QList<QPair<QString, QString>>& otherReplacements = {}); + + [[nodiscard]] static ColorizedSvgIcon colorizedIconForWidget(const QString& fileName, const QWidget *widget); + + [[nodiscard]] static QIconEngine *svgIconEngine(); +}; + +#endif // COLORIZEDSVGICON_HPP