From a8f4ace099296719623c6a683a46d3a1e80d1e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Neves?= Date: Sat, 7 Sep 2024 21:39:42 +0000 Subject: [PATCH] Fix volume icon on menu bar not centered --- BGMApp/BGMApp/BGMStatusBarItem.mm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/BGMApp/BGMApp/BGMStatusBarItem.mm b/BGMApp/BGMApp/BGMStatusBarItem.mm index d92474b3..f26b1c47 100644 --- a/BGMApp/BGMApp/BGMStatusBarItem.mm +++ b/BGMApp/BGMApp/BGMStatusBarItem.mm @@ -125,10 +125,17 @@ - (void) dealloc { - (void) initIcons { // Load the icons. fermataIcon = [NSImage imageNamed:@"FermataIcon"]; - volumeIcon0SoundWaves = [NSImage imageNamed:@"Volume0"]; - volumeIcon1SoundWave = [NSImage imageNamed:@"Volume1"]; - volumeIcon2SoundWaves = [NSImage imageNamed:@"Volume2"]; - volumeIcon3SoundWaves = [NSImage imageNamed:@"Volume3"]; + if (@available(macOS 11.0, *)) { + volumeIcon0SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.fill" accessibilityDescription:nil]; + volumeIcon1SoundWave = [NSImage imageWithSystemSymbolName:@"speaker.wave.1.fill" accessibilityDescription:nil]; + volumeIcon2SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.wave.2.fill" accessibilityDescription:nil]; + volumeIcon3SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.wave.3.fill" accessibilityDescription:nil]; + } else { + volumeIcon0SoundWaves = [NSImage imageNamed:@"Volume0"]; + volumeIcon1SoundWave = [NSImage imageNamed:@"Volume1"]; + volumeIcon2SoundWaves = [NSImage imageNamed:@"Volume2"]; + volumeIcon3SoundWaves = [NSImage imageNamed:@"Volume3"]; + } // Set the icons' sizes. NSRect statusBarItemFrame;