Browse Source

UI: Use macOS app icon for Qt app on macOS

PatTheMav 5 years ago
parent
commit
9ac92f61be
4 changed files with 16 additions and 1 deletions
  1. 1 0
      UI/forms/obs.qrc
  2. 5 0
      UI/obs-app.cpp
  3. 5 0
      UI/window-basic-stats.cpp
  4. 5 1
      UI/window-projector.cpp

+ 1 - 0
UI/forms/obs.qrc

@@ -10,6 +10,7 @@
     <file>images/plus.svg</file>
     <file>images/plus.svg</file>
     <file>images/down.svg</file>
     <file>images/down.svg</file>
     <file>images/up.svg</file>
     <file>images/up.svg</file>
+    <file>images/obs_256x256.png</file>
     <file>images/obs.png</file>
     <file>images/obs.png</file>
     <file>images/obs_macos.png</file>
     <file>images/obs_macos.png</file>
     <file>images/obs_paused.png</file>
     <file>images/obs_paused.png</file>

+ 5 - 0
UI/obs-app.cpp

@@ -1125,7 +1125,12 @@ OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store)
 {
 {
 	sleepInhibitor = os_inhibit_sleep_create("OBS Video/audio");
 	sleepInhibitor = os_inhibit_sleep_create("OBS Video/audio");
 
 
+#ifdef __APPLE__
+	setWindowIcon(
+		QIcon::fromTheme("obs", QIcon(":/res/images/obs_256x256.png")));
+#else
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
+#endif
 }
 }
 
 
 OBSApp::~OBSApp()
 OBSApp::~OBSApp()

+ 5 - 0
UI/window-basic-stats.cpp

@@ -170,7 +170,12 @@ OBSBasicStats::OBSBasicStats(QWidget *parent, bool closeable)
 	resize(800, 280);
 	resize(800, 280);
 
 
 	setWindowTitle(QTStr("Basic.Stats"));
 	setWindowTitle(QTStr("Basic.Stats"));
+#ifdef __APPLE__
+	setWindowIcon(
+		QIcon::fromTheme("obs", QIcon(":/res/images/obs_256x256.png")));
+#else
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
+#endif
 
 
 	setWindowModality(Qt::NonModal);
 	setWindowModality(Qt::NonModal);
 	setAttribute(Qt::WA_DeleteOnClose, true);
 	setAttribute(Qt::WA_DeleteOnClose, true);

+ 5 - 1
UI/window-projector.cpp

@@ -31,8 +31,12 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
 		setWindowFlags(Qt::WindowStaysOnTopHint);
 		setWindowFlags(Qt::WindowStaysOnTopHint);
 
 
 	type = type_;
 	type = type_;
-
+#ifdef __APPLE__
+	setWindowIcon(
+		QIcon::fromTheme("obs", QIcon(":/res/images/obs_256x256.png")));
+#else
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
+#endif
 
 
 	if (monitor == -1)
 	if (monitor == -1)
 		resize(480, 270);
 		resize(480, 270);