Mini player and full size window album art size aren't the same #155

Closed
opened 2021-05-16 13:10:53 -04:00 by NattyNarwhal · 4 comments
NattyNarwhal commented 2021-05-16 13:10:53 -04:00 (Migrated from github.com)

Describe

The miniplayer has proper sized album art in the toolbar, while the full-sized window doesn't.

To Reproduce (delete if not applicable)
Steps to reproduce the behavior:

  1. Play track
  2. Enter mini player

Expected behavior

Mini player and normal player should have same size album art

Screenshots

Screen Shot 2021-05-16 at 2 07 15 PM Screen Shot 2021-05-16 at 2 07 46 PM

Version information:*

  • macOS version: 11.3
  • Cog version: ... 1528-g95a63327
**Describe** The miniplayer has proper sized album art in the toolbar, while the full-sized window doesn't. **To Reproduce** (delete if not applicable) Steps to reproduce the behavior: 1. Play track 2. Enter mini player **Expected behavior** Mini player and normal player should have same size album art **Screenshots** <img width="873" alt="Screen Shot 2021-05-16 at 2 07 15 PM" src="https://user-images.githubusercontent.com/3161292/118405914-597dfd00-b650-11eb-8403-68d8375eae23.png"> <img width="862" alt="Screen Shot 2021-05-16 at 2 07 46 PM" src="https://user-images.githubusercontent.com/3161292/118405909-4ec36800-b650-11eb-9054-30f4f601237f.png"> **Version information:*** - macOS version: 11.3 - Cog version: ... 1528-g95a63327
nevack commented 2021-05-16 13:48:38 -04:00 (Migrated from github.com)

I'll look into it

I'll look into it
NattyNarwhal commented 2021-09-19 15:36:21 -03:00 (Migrated from github.com)

So, I wonder if it's something due to button sizing, due to these screenshots I took, where the highlight rectangle (very faint) is noticeably smaller:

Screen Shot 2021-09-19 at 3 19 54 PM Screen Shot 2021-09-19 at 3 20 11 PM

So I added some logging code:

diff --git a/Application/AppController.m b/Application/AppController.m
index 8762e8ab..52defc63 100644
--- a/Application/AppController.m
+++ b/Application/AppController.m
@@ -265,6 +265,17 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
             self.infoButton.image = playlistController.currentEntry.albumArt;
             self.infoButtonMini.imageScaling = NSImageScaleProportionallyUpOrDown;
             self.infoButtonMini.image = playlistController.currentEntry.albumArt;
+#define LogSize(SIZE) NSLog(@"%s: %0.0f x %0.0f",\
+                            #SIZE, SIZE.width, SIZE.height)
+            NSSize miniFitting, fullFitting, miniIntrins, fullIntrins;
+            fullFitting = self.infoButton.fittingSize;
+            LogSize(fullFitting);
+            fullIntrins = self.infoButton.intrinsicContentSize;
+            LogSize(fullIntrins);
+            miniFitting = self.infoButtonMini.fittingSize;
+            LogSize(miniFitting);
+            miniIntrins = self.infoButtonMini.intrinsicContentSize;
+            LogSize(miniIntrins);
         } else {
             self.infoButton.imageScaling = NSImageScaleNone;
             self.infoButton.image = [NSImage imageNamed:@"infoTemplate"];

And when I started playing in full sized (output is the same in mini mode):

2021-09-19 15:29:30.706394-0300 Cog[25089:1317247] fullFitting: 46 x 40
2021-09-19 15:29:30.706835-0300 Cog[25089:1317247] fullIntrins: 34 x 28
2021-09-19 15:29:30.707326-0300 Cog[25089:1317247] miniFitting: 46 x 40
2021-09-19 15:29:30.707674-0300 Cog[25089:1317247] miniIntrins: 34 x 28

They also have the same controlSize value of NSControlSizeLarge.

So, I wonder if it's something due to button sizing, due to these screenshots I took, where the highlight rectangle (very faint) is noticeably smaller: <img width="317" alt="Screen Shot 2021-09-19 at 3 19 54 PM" src="https://user-images.githubusercontent.com/3161292/133938685-6537b8e0-e5b8-4c0c-9916-bc3214c84203.png"> <img width="283" alt="Screen Shot 2021-09-19 at 3 20 11 PM" src="https://user-images.githubusercontent.com/3161292/133938687-055315cc-349e-4fa7-9788-35e3c9bd167c.png"> So I added some logging code: ```diff diff --git a/Application/AppController.m b/Application/AppController.m index 8762e8ab..52defc63 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -265,6 +265,17 @@ - (void)observeValueForKeyPath:(NSString *)keyPath self.infoButton.image = playlistController.currentEntry.albumArt; self.infoButtonMini.imageScaling = NSImageScaleProportionallyUpOrDown; self.infoButtonMini.image = playlistController.currentEntry.albumArt; +#define LogSize(SIZE) NSLog(@"%s: %0.0f x %0.0f",\ + #SIZE, SIZE.width, SIZE.height) + NSSize miniFitting, fullFitting, miniIntrins, fullIntrins; + fullFitting = self.infoButton.fittingSize; + LogSize(fullFitting); + fullIntrins = self.infoButton.intrinsicContentSize; + LogSize(fullIntrins); + miniFitting = self.infoButtonMini.fittingSize; + LogSize(miniFitting); + miniIntrins = self.infoButtonMini.intrinsicContentSize; + LogSize(miniIntrins); } else { self.infoButton.imageScaling = NSImageScaleNone; self.infoButton.image = [NSImage imageNamed:@"infoTemplate"]; ``` And when I started playing in full sized (output is the same in mini mode): ``` 2021-09-19 15:29:30.706394-0300 Cog[25089:1317247] fullFitting: 46 x 40 2021-09-19 15:29:30.706835-0300 Cog[25089:1317247] fullIntrins: 34 x 28 2021-09-19 15:29:30.707326-0300 Cog[25089:1317247] miniFitting: 46 x 40 2021-09-19 15:29:30.707674-0300 Cog[25089:1317247] miniIntrins: 34 x 28 ``` They also have the same `controlSize` value of `NSControlSizeLarge`.
nevack commented 2021-09-20 09:08:39 -03:00 (Migrated from github.com)

Thanks!

Thanks!
NattyNarwhal commented 2021-12-27 19:26:28 -03:00 (Migrated from github.com)
Screen Shot 2021-12-27 at 6 26 07 PM

Can't reproduce this in 12.1. I guess Apple finally fixed it?

<img width="1056" alt="Screen Shot 2021-12-27 at 6 26 07 PM" src="https://user-images.githubusercontent.com/3161292/147511031-0bd2f615-65ef-42a3-bc89-d4308cea32cb.png"> Can't reproduce this in 12.1. I guess Apple finally fixed it?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: chris/Cog#155
No description provided.