1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Improve display of blank albums

* Add dark and light blank album image variants
* Use CALayer to draw rounded corners and a tinted border on each album
  cover
This commit is contained in:
Daniel Barber 2019-02-12 22:08:57 -05:00
parent 891d08cfff
commit eeb776199b
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
11 changed files with 34 additions and 1 deletions

View File

@ -1,12 +1,35 @@
{
"images" : [
{
"idiom" : "universal"
},
{
"idiom" : "universal",
"filename" : "blankAlbum.pdf"
"filename" : "blankAlbumLight-1.pdf",
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
]
},
{
"idiom" : "universal",
"filename" : "blankAlbumDark.pdf",
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
]
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "original",
"preserves-vector-representation" : true
}
}

Binary file not shown.

View File

@ -9,7 +9,9 @@
<customObject id="-2" userLabel="File's Owner" customClass="AlbumItem" customModule="Persephone" customModuleProvider="target">
<connections>
<outlet property="albumArtist" destination="5Uu-j1-qyT" id="2Et-tX-InT"/>
<outlet property="albumCoverView" destination="Kfb-8f-ean" id="ZAL-jD-lHj"/>
<outlet property="albumTitle" destination="KEh-NL-c2W" id="SI3-hm-H2B"/>
<outlet property="imageView" destination="Kfb-8f-ean" id="Ur0-hX-wJm"/>
<outlet property="view" destination="Hz6-mo-xeY" id="v7W-XA-Emc"/>
</connections>
</customObject>

View File

@ -9,9 +9,16 @@
import Cocoa
class AlbumItem: NSCollectionViewItem {
let albumCoverBorderColor = NSColor.init(calibratedWhite: 1, alpha: 0.1)
override func viewDidLoad() {
super.viewDidLoad()
// Do view setup here.
albumCoverView.wantsLayer = true
albumCoverView.layer?.cornerRadius = 3
albumCoverView.layer?.borderWidth = 1
albumCoverView.layer?.borderColor = albumCoverBorderColor.cgColor
}
func setAlbum(_ album: MPDClient.Album) {
@ -19,6 +26,7 @@ class AlbumItem: NSCollectionViewItem {
albumArtist.stringValue = album.artist
}
@IBOutlet var albumCoverView: NSImageView!
@IBOutlet var albumTitle: NSTextField!
@IBOutlet var albumArtist: NSTextField!
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB