From 9c58f67c48d55115a95ff6a4653afd208b08e807 Mon Sep 17 00:00:00 2001 From: Dzmitry Neviadomski Date: Wed, 5 May 2021 02:03:55 +0300 Subject: [PATCH] Fix Info button sizing when album art not present. --- Application/AppController.m | 24 ++++++++++++------------ Base.lproj/MainMenu.xib | 4 +++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Application/AppController.m b/Application/AppController.m index 73fe6ee57..8762e8abb 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -260,6 +260,18 @@ void* kAppControllerContext = &kAppControllerContext; self.infoButtonMini.image = [NSImage imageNamed:@"infoTemplate"]; } + if (entry.albumArt) { + self.infoButton.imageScaling = NSImageScaleProportionallyUpOrDown; + self.infoButton.image = playlistController.currentEntry.albumArt; + self.infoButtonMini.imageScaling = NSImageScaleProportionallyUpOrDown; + self.infoButtonMini.image = playlistController.currentEntry.albumArt; + } else { + self.infoButton.imageScaling = NSImageScaleNone; + self.infoButton.image = [NSImage imageNamed:@"infoTemplate"]; + self.infoButtonMini.imageScaling = NSImageScaleNone; + self.infoButtonMini.image = [NSImage imageNamed:@"infoTemplate"]; + } + if (@available(macOS 11.0, *)) { NSString *title = @"Cog"; if (entry.title) { @@ -291,18 +303,6 @@ void* kAppControllerContext = &kAppControllerContext; miniWindow.title = title; mainWindow.title = title; } - - if (entry.albumArt) { - self.infoButton.imageScaling = NSImageScaleProportionallyUpOrDown; - self.infoButton.image = playlistController.currentEntry.albumArt; - self.infoButtonMini.imageScaling = NSImageScaleProportionallyUpOrDown; - self.infoButtonMini.image = playlistController.currentEntry.albumArt; - } else { - self.infoButton.imageScaling = NSImageScaleNone; - self.infoButton.image = [NSImage imageNamed:@"infoTemplate"]; - self.infoButtonMini.imageScaling = NSImageScaleNone; - self.infoButtonMini.image = [NSImage imageNamed:@"infoTemplate"]; - } } } diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 1aa91972b..854465c55 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -435,8 +435,10 @@ - + + +