[PATCH 2/2] qcam: viewfinder_qt: Render stopped icon on a black background
Kieran Bingham
kieran.bingham at ideasonboard.com
Mon Sep 9 14:39:12 CEST 2024
Quoting Laurent Pinchart (2024-09-05 17:25:08)
> To match the black letterboxes, render the stoppid icon on a black
s/stoppid/stopped/
> background.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/apps/qcam/assets/feathericons/camera-off.svg | 2 +-
> src/apps/qcam/viewfinder_qt.cpp | 5 +++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/apps/qcam/assets/feathericons/camera-off.svg b/src/apps/qcam/assets/feathericons/camera-off.svg
> index daa3e25f0c1d..2d36b59c8b52 100644
> --- a/src/apps/qcam/assets/feathericons/camera-off.svg
> +++ b/src/apps/qcam/assets/feathericons/camera-off.svg
> @@ -1 +1 @@
> -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-camera-off"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56"></path></svg>
> \ No newline at end of file
> +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#c0c0c0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-camera-off"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56"></path></svg>
> diff --git a/src/apps/qcam/viewfinder_qt.cpp b/src/apps/qcam/viewfinder_qt.cpp
> index 62b6f27fa23e..b0d63f3fa5ea 100644
> --- a/src/apps/qcam/viewfinder_qt.cpp
> +++ b/src/apps/qcam/viewfinder_qt.cpp
> @@ -48,6 +48,8 @@ ViewFinderQt::ViewFinderQt(QWidget *parent)
> QPalette pal = palette();
> pal.setColor(QPalette::Window, Qt::black);
> setPalette(pal);
> +
> + setAttribute(Qt::WA_OpaquePaintEvent, true);
> }
>
> ViewFinderQt::~ViewFinderQt()
> @@ -122,7 +124,6 @@ void ViewFinderQt::render(libcamera::FrameBuffer *buffer, Image *image)
> }
> }
>
> - setAttribute(Qt::WA_OpaquePaintEvent, true);
> update();
>
> if (buffer)
> @@ -138,7 +139,6 @@ void ViewFinderQt::stop()
> buffer_ = nullptr;
> }
>
> - setAttribute(Qt::WA_OpaquePaintEvent, false);
Oh - so now these are redundant... Probably not worth adding the
comments in the previous patch if they'll just be removed here then.
I find this version a bit ... garish ? I'm not sure. Slight personal
preference on the original without this patch - but no objection to this
one either.
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> update();
> }
>
> @@ -194,6 +194,7 @@ void ViewFinderQt::paintEvent(QPaintEvent *)
> else
> point.setY((height() - pixmap_.height()) / 2);
>
> + painter.drawRect(rect());
> painter.drawPixmap(point, pixmap_);
> }
>
> --
> Regards,
>
> Laurent Pinchart
>
More information about the libcamera-devel
mailing list