[PATCH 2/2] qcam: viewfinder_qt: Render stopped icon on a black background
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Sep 5 18:25:08 CEST 2024
To match the black letterboxes, render the stoppid icon on a black
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);
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