From patchwork Mon Mar 23 17:35:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3273 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CAEFE62CC3 for ; Mon, 23 Mar 2020 18:36:18 +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 6B1FFA31 for ; Mon, 23 Mar 2020 18:36:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584984978; bh=kx4gjDAMNtkpvOXxR9uIYamZfxIRWIZM0OCOZ9J/E/s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TBDRN2TaRHtFMMCr7NCJqkYqWkwRvXvzPjM7G6yJmIYSzEZUUAofQh2UC2VhYxahw WrT+c4JHB5jl6ZVBZ2a5qEBSg0365118/kEDgAqLWob4mnXb4QDx5gL/Wj0GZBl/xk wlfwLgKRt0pcxbpsYqiSnIXfKs8LIy7U3hF2ly5A= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 19:35:45 +0200 Message-Id: <20200323173559.21109-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> References: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 17:36:22 -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 --- 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;