[libcamera-devel] [PATCH v2 07/21] qcam: main_window: Use icons from system icon theme
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Mar 23 18:35:45 CET 2020
Use the system icon theme by default, falling back to custom icons if no
theme is available.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
Changes since v1:
- Rebase on play/stop action toggle
---
src/qcam/main_window.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 74b8748c3347..9f008a57f9a1 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -96,7 +96,9 @@ int MainWindow::createToolbars()
/* Disable right click context menu. */
toolbar_->setContextMenuPolicy(Qt::PreventContextMenu);
- action = toolbar_->addAction(QIcon(":x-circle.svg"), "Quit");
+ action = toolbar_->addAction(QIcon::fromTheme("application-exit",
+ QIcon(":x-circle.svg")),
+ "Quit");
connect(action, &QAction::triggered, this, &MainWindow::quit);
/* Camera selection. */
@@ -111,15 +113,19 @@ int MainWindow::createToolbars()
toolbar_->addSeparator();
- iconPlay_ = QIcon(":play-circle.svg");
- iconStop_ = QIcon(":stop-circle.svg");
+ iconPlay_ = QIcon::fromTheme("media-playback-start",
+ QIcon(":play-circle.svg"));
+ iconStop_ = QIcon::fromTheme("media-playback-stop",
+ QIcon(":stop-circle.svg"));
action = toolbar_->addAction(iconPlay_, "Start Capture");
action->setCheckable(true);
connect(action, &QAction::toggled, this, &MainWindow::toggleCapture);
startStopAction_ = action;
- action = toolbar_->addAction(QIcon(":save.svg"), "saveAs");
+ action = toolbar_->addAction(QIcon::fromTheme("document-save-as",
+ QIcon(":save.svg")),
+ "Save As...");
connect(action, &QAction::triggered, this, &MainWindow::saveImageAs);
return 0;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list