From patchwork Mon Mar 23 14:21:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3250 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CCFC962C50 for ; Mon, 23 Mar 2020 15:22:20 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59723A31 for ; Mon, 23 Mar 2020 15:22:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584973340; bh=cVb52Stk9ppYJwFRDHb9aaavjPXSp25SbMpq6eRtJAE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bX44HsgTSirrGPLg/BKJ4aag4pFdw6H9rlp+lqDzR5lbGrcaZXDpg28RG73bqJusL yaoXU9EIGzJdHk2xUoy9r2dQ2PDzhnnPrhzw7zJTj0i0DW66dj/SCkJQCczY7WLEAg Ietjfbzcioyx2cvnkt7mbfr2EMBi31/CuEf4U3lE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 16:21:51 +0200 Message-Id: <20200323142205.28342-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> References: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 07/21] qcam: main_window: Use icons from system icon theme X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2020 14:22:24 -0000 Use the system icon theme by default, falling back to custom icons if no theme is available. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/qcam/main_window.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 86f92360a1a9..14baf7ec4c2e 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -97,7 +97,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. */ @@ -112,12 +114,16 @@ int MainWindow::createToolbars() toolbar_->addSeparator(); - action = toolbar_->addAction(QIcon(":play-circle.svg"), "Start Capture"); + action = toolbar_->addAction(QIcon::fromTheme("media-playback-start", + QIcon(":play-circle.svg")), + "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;