From 71f8db089771733d89a9211750a383f48c01d427 Mon Sep 17 00:00:00 2001 From: Ryan Nosurname Date: Thu, 28 May 2026 14:46:27 +0000 Subject: informationpanelcontent: Remove video preview play arrow This commit removes the "Play" arrow on top of the video preview. There is no change to behavior. Motivation: There is already the play button and seekbar directly below the thumbnail, and when mousing over it you get the pointing hand. Surely this gives the user enough clues that the video can be previewed in-place. --- src/panels/information/informationpanelcontent.cpp | 43 ---------------------- 1 file changed, 43 deletions(-) (limited to 'src/panels') diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 285ce3ae9..cdd98f54c 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -27,9 +26,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -40,9 +37,6 @@ #include "mediawidget.h" #include "pixmapviewer.h" -const int PLAY_ARROW_SIZE = 24; -const int PLAY_ARROW_BORDER_SIZE = 2; - InformationPanelContent::InformationPanelContent(QWidget *parent) : QWidget(parent) , m_item() @@ -390,43 +384,6 @@ void InformationPanelContent::showPreview(const KFileItem &item, const QPixmap & p.setDevicePixelRatio(devicePixelRatioF()); } - if (m_isVideo) { - // adds a play arrow overlay - - auto maxDim = qMax(p.width(), p.height()); - auto arrowSize = qMax(PLAY_ARROW_SIZE, maxDim / 8); - - // compute relative pixel positions - const int zeroX = static_cast((p.width() / 2 - arrowSize / 2) / p.devicePixelRatio()); - const int zeroY = static_cast((p.height() / 2 - arrowSize / 2) / p.devicePixelRatio()); - - QPolygon arrow; - arrow << QPoint(zeroX, zeroY); - arrow << QPoint(zeroX, zeroY + arrowSize); - arrow << QPoint(zeroX + arrowSize, zeroY + arrowSize / 2); - - QPainterPath path; - path.addPolygon(arrow); - - QLinearGradient gradient(QPointF(zeroX, zeroY + arrowSize / 2), QPointF(zeroX + arrowSize, zeroY + arrowSize / 2)); - - QColor whiteColor = Qt::white; - QColor blackColor = Qt::black; - gradient.setColorAt(0, whiteColor); - gradient.setColorAt(1, blackColor); - - QBrush brush(gradient); - - QPainter painter(&p); - - QPen pen(blackColor, PLAY_ARROW_BORDER_SIZE, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); - painter.setPen(pen); - - painter.setRenderHint(QPainter::Antialiasing); - painter.drawPolygon(arrow); - painter.fillPath(path, brush); - } - m_preview->setPixmap(p); } -- cgit v1.3.1