mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Improve album art display
* Mask album art to rounded corners * Add a black background colour for albums with non square artwork
This commit is contained in:
parent
7d0c50a8b7
commit
da851365d6
@ -22,8 +22,10 @@ class AlbumViewItem: NSCollectionViewItem {
|
|||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
albumCoverView.wantsLayer = true
|
albumCoverView.wantsLayer = true
|
||||||
albumCoverView.layer?.cornerRadius = 3
|
albumCoverView.layer?.backgroundColor = NSColor.black.cgColor
|
||||||
|
albumCoverView.layer?.cornerRadius = 4
|
||||||
albumCoverView.layer?.borderWidth = 1
|
albumCoverView.layer?.borderWidth = 1
|
||||||
|
albumCoverView.layer?.masksToBounds = true
|
||||||
|
|
||||||
albumCoverBox.wantsLayer = true
|
albumCoverBox.wantsLayer = true
|
||||||
albumCoverBox.layer?.cornerRadius = 5
|
albumCoverBox.layer?.cornerRadius = 5
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
|
||||||
class AlbumDetailView: NSViewController {
|
class AlbumDetailView: NSViewController {
|
||||||
|
var observer: NSKeyValueObservation?
|
||||||
var album: Album?
|
var album: Album?
|
||||||
var dataSource = AlbumTracksDataSource()
|
var dataSource = AlbumTracksDataSource()
|
||||||
|
|
||||||
@ -30,10 +31,17 @@ class AlbumDetailView: NSViewController {
|
|||||||
albumTracksView.columnAutoresizingStyle = .sequentialColumnAutoresizingStyle
|
albumTracksView.columnAutoresizingStyle = .sequentialColumnAutoresizingStyle
|
||||||
|
|
||||||
albumCoverView.wantsLayer = true
|
albumCoverView.wantsLayer = true
|
||||||
albumCoverView.layer?.cornerRadius = 5
|
albumCoverView.layer?.backgroundColor = NSColor.black.cgColor
|
||||||
|
albumCoverView.layer?.cornerRadius = 6
|
||||||
albumCoverView.layer?.borderWidth = 1
|
albumCoverView.layer?.borderWidth = 1
|
||||||
|
albumCoverView.layer?.masksToBounds = true
|
||||||
setAppearance()
|
setAppearance()
|
||||||
|
|
||||||
|
if #available(OSX 10.14, *) {
|
||||||
|
observer = NSApp.observe(\.effectiveAppearance) { (app, _) in
|
||||||
|
self.setAppearance()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillAppear() {
|
override func viewWillAppear() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user