diff --git a/rsc/VivyRessources.qrc b/rsc/VivyRessources.qrc index b27b8c63186b315b4fd7cb2fb9e8c355c97c22c7..542123ecd6cfc6901242cd5182f3821252f809ce 100644 --- a/rsc/VivyRessources.qrc +++ b/rsc/VivyRessources.qrc @@ -35,6 +35,9 @@ <file alias="folder.svg">icons/breeze-dark/folder.svg</file> <file alias="text-x-generic.svg">icons/breeze-dark/text-x-generic.svg</file> <file alias="help-about.svg">icons/breeze-dark/help-about.svg</file> + <file alias="media-pause.svg">icons/breeze-dark/media-playback-pause.svg</file> + <file alias="media-play.svg">icons/breeze-dark/media-playback-start.svg</file> + <file alias="media-stop.svg">icons/breeze-dark/media-playback-stop.svg</file> </qresource> <qresource prefix="icons/light"> <file alias="document-new.svg">icons/breeze-light/document-new.svg</file> @@ -44,6 +47,9 @@ <file alias="folder.svg">icons/breeze-light/folder.svg</file> <file alias="text-x-generic.svg">icons/breeze-light/text-x-generic.svg</file> <file alias="help-about.svg">icons/breeze-light/help-about.svg</file> + <file alias="media-pause.svg">icons/breeze-light/media-playback-pause.svg</file> + <file alias="media-play.svg">icons/breeze-light/media-playback-start.svg</file> + <file alias="media-stop.svg">icons/breeze-light/media-playback-stop.svg</file> </qresource> <!-- QDarkStyle style sheet, MIT Licence --> diff --git a/rsc/icons/breeze-dark/media-playback-pause.svg b/rsc/icons/breeze-dark/media-playback-pause.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d62eb8de4e89f33c536636878600078a001e6e6 --- /dev/null +++ b/rsc/icons/breeze-dark/media-playback-pause.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#eff0f1; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 8 0 0 -20 z m 12 0 0 20 8 0 0 -20 z" + id="path8" + class="ColorScheme-Text" + /> +</svg> diff --git a/rsc/icons/breeze-dark/media-playback-start.svg b/rsc/icons/breeze-dark/media-playback-start.svg new file mode 100644 index 0000000000000000000000000000000000000000..2014d770a7d1ff5e449d68cefa64421b9e0e91f7 --- /dev/null +++ b/rsc/icons/breeze-dark/media-playback-start.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#eff0f1; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 20 -10 z" + id="path105" + class="ColorScheme-Text" + /> +</svg> diff --git a/rsc/icons/breeze-dark/media-playback-stop.svg b/rsc/icons/breeze-dark/media-playback-stop.svg new file mode 100644 index 0000000000000000000000000000000000000000..3660cf8baaad932135642fe472a347bc45e043ed --- /dev/null +++ b/rsc/icons/breeze-dark/media-playback-stop.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#eff0f1; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 20 0 0 -20 z" + id="path91" + class="ColorScheme-Text" + /> +</svg> diff --git a/rsc/icons/breeze-light/media-playback-pause.svg b/rsc/icons/breeze-light/media-playback-pause.svg new file mode 100644 index 0000000000000000000000000000000000000000..ece183885e0811d28bcd87beee0639f4fb63f155 --- /dev/null +++ b/rsc/icons/breeze-light/media-playback-pause.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#232629; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 8 0 0 -20 z m 12 0 0 20 8 0 0 -20 z" + id="path8" + class="ColorScheme-Text" + /> +</svg> diff --git a/rsc/icons/breeze-light/media-playback-start.svg b/rsc/icons/breeze-light/media-playback-start.svg new file mode 100644 index 0000000000000000000000000000000000000000..28f7c9b3d05dd7ba88dfaf8ae5bfe456500835a5 --- /dev/null +++ b/rsc/icons/breeze-light/media-playback-start.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#232629; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 20 -10 z" + id="path105" + class="ColorScheme-Text" + /> +</svg> diff --git a/rsc/icons/breeze-light/media-playback-stop.svg b/rsc/icons/breeze-light/media-playback-stop.svg new file mode 100644 index 0000000000000000000000000000000000000000..2aa152a2d0211d2e9492639b8ac469f657481075 --- /dev/null +++ b/rsc/icons/breeze-light/media-playback-stop.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#232629; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none" + d="m 6 6 0 20 20 0 0 -20 z" + id="path91" + class="ColorScheme-Text" + /> +</svg> diff --git a/src/UI/DocumentViews/MpvControls.cc b/src/UI/DocumentViews/MpvControls.cc index 36971ccb8b589c78a16e0783a4ff3560d9d29aab..eee42cad4201127c8bea5648613cb4a64061c9c5 100644 --- a/src/UI/DocumentViews/MpvControls.cc +++ b/src/UI/DocumentViews/MpvControls.cc @@ -44,11 +44,10 @@ MpvControls::MpvControls(MpvContainer *passedContainer, QWidget *parent) noexcep connect(togglePlaybackButton, &QAbstractButton::clicked, mpv, &MpvContainer::mpvTogglePlayback); connect(mpv, &MpvContainer::mpvPlaybackToggled, this, - [togglePlaybackButton](bool isPlay) noexcept -> void { + [this, togglePlaybackButton](bool isPlay) noexcept -> void { qDebug() << "Got playback update to" << (isPlay ? QStringLiteral("Play") : QStringLiteral("Pause")); - togglePlaybackButton->setText(isPlay ? QStringLiteral("Pause") - : QStringLiteral("Play")); + togglePlaybackButton->setIcon(isPlay ? pauseIcon : playIcon); }); auto *centralLayout = new QHBoxLayout(this); diff --git a/src/UI/DocumentViews/MpvControls.hh b/src/UI/DocumentViews/MpvControls.hh index 4f25db87fc728e9c9c06caea0f814069fd4ef912..db00d5900753f8411c2c2f2896aab0d8458708dd 100644 --- a/src/UI/DocumentViews/MpvControls.hh +++ b/src/UI/DocumentViews/MpvControls.hh @@ -5,6 +5,8 @@ #endif #include "../../Lib/Utils.hh" +#include "../../VivyApplication.hh" +#include <QIcon> namespace Vivy { @@ -20,6 +22,9 @@ private: chrono::seconds timePosition; int askedSliderPosition{ 0 }; + const QIcon playIcon{ VIVY_ICON_PLAY }; + const QIcon pauseIcon{ VIVY_ICON_PAUSE }; + public: explicit MpvControls(MpvContainer *mpv, QWidget *parent) noexcept; }; diff --git a/src/VivyApplication.hh b/src/VivyApplication.hh index 4b0b82b988e3b6bbf696b3fe0adbf098d95568fd..a13719cda18f38253f0181147f9559f3ff776f34 100644 --- a/src/VivyApplication.hh +++ b/src/VivyApplication.hh @@ -16,6 +16,9 @@ #define VIVY_ICON_ABOUT ":icons/dark/help-about.svg" #define VIVY_ICON_FILE ":icons/dark/text-x-generic.svg" #define VIVY_ICON_FOLDER ":icons/dark/folder.svg" +#define VIVY_ICON_PLAY ":icons/dark/media-play.svg" +#define VIVY_ICON_PAUSE ":icons/dark/media-pause.svg" +#define VIVY_ICON_STOP ":icons/dark/media-stop.svg" #include <QApplication> #include <QPixmap>