D22183: Add click to play/pause feature on previews for audio/video
Elvis Angelaccio
noreply at phabricator.kde.org
Sun Aug 11 16:05:56 BST 2019
elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> informationpanelcontent.cpp:365-366
> + // compute relative pixel positions
> + const int zero_x = static_cast<int>(p.width() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio());
> + const int zero_y = static_cast<int>(p.height() / 2 - PLAY_ARROW_SIZE / 2 / devicePixelRatio());
> +
Please always use camelCase.
> phononwidget.cpp:103-119
> +bool PhononWidget::eventFilter(QObject *object, QEvent *event)
> +{
> + Q_UNUSED(object);
> + if (event->type() == QEvent::MouseButtonPress) {
> + const QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
> + if (mouseEvent->button() == Qt::LeftButton) {
> + // toggle playback
Have you tried to override `mousePressEvent()` instead of using an event filter?
> phononwidget.h:77
> void play();
> + Phonon::State state();
>
Why a slot? This is just a getter, isn't it?
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D22183
To: meven, elvisangelaccio, #dolphin, ngraham
Cc: anthonyfieroni, ngraham, kfm-devel, aprcela, vmarinescu, fprice, fbampaloukas, alexde, feverfew, meven, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190811/f768c355/attachment.htm>
More information about the kfm-devel
mailing list