From 2080051b9f4d0c9e1dcc8f32b08e17817545c95c Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Mon, 11 Mar 2019 10:52:01 -0500 Subject: [PATCH] UI: Use icons from theme on Linux --- UI/obs-app.cpp | 2 ++ UI/window-basic-main.cpp | 10 ++++++---- UI/window-basic-stats.cpp | 3 ++- UI/window-projector.cpp | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index e1e9e1322..4ce6f5909 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1045,6 +1045,8 @@ OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store) profilerNameStore(store) { sleepInhibitor = os_inhibit_sleep_create("OBS Video/audio"); + + setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png"))); } OBSApp::~OBSApp() diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 16f4e469f..e698ad31d 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4977,7 +4977,8 @@ inline void OBSBasic::OnActivate() UpdateProcessPriority(); if (trayIcon) - trayIcon->setIcon(QIcon(":/res/images/tray_active.png")); + trayIcon->setIcon(QIcon::fromTheme("obs-tray-active", + QIcon(":/res/images/tray_active.png"))); } } @@ -4990,7 +4991,8 @@ inline void OBSBasic::OnDeactivate() ClearProcessPriority(); if (trayIcon) - trayIcon->setIcon(QIcon(":/res/images/obs.png")); + trayIcon->setIcon(QIcon::fromTheme("obs-tray", + QIcon(":/res/images/obs.png"))); } } @@ -6639,8 +6641,8 @@ void OBSBasic::ToggleShowHide() void OBSBasic::SystemTrayInit() { - trayIcon.reset(new QSystemTrayIcon(QIcon(":/res/images/obs.png"), - this)); + trayIcon.reset(new QSystemTrayIcon(QIcon::fromTheme("obs-tray", + QIcon(":/res/images/obs.png")), this)); trayIcon->setToolTip("OBS Studio"); showHide = new QAction(QTStr("Basic.SystemTray.Show"), diff --git a/UI/window-basic-stats.cpp b/UI/window-basic-stats.cpp index ef40618e5..c2e5f7045 100644 --- a/UI/window-basic-stats.cpp +++ b/UI/window-basic-stats.cpp @@ -139,7 +139,8 @@ OBSBasicStats::OBSBasicStats(QWidget *parent, bool closeable) resize(800, 280); setWindowTitle(QTStr("Basic.Stats")); - setWindowIcon(QIcon(":/res/images/obs.png")); + setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png"))); + setWindowModality(Qt::NonModal); setAttribute(Qt::WA_DeleteOnClose, true); diff --git a/UI/window-projector.cpp b/UI/window-projector.cpp index 5622c85f1..1e343d170 100644 --- a/UI/window-projector.cpp +++ b/UI/window-projector.cpp @@ -30,7 +30,8 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor, type = type_; if (isWindow) { - setWindowIcon(QIcon(":/res/images/obs.png")); + setWindowIcon(QIcon::fromTheme("obs", + QIcon(":/res/images/obs.png"))); UpdateProjectorTitle(projectorTitle); windowedProjectors.push_back(this); -- GitLab