mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
34 lines
930 B
Swift
34 lines
930 B
Swift
//
|
|
// SiteListTypeCell.swift
|
|
// PHP Monitor
|
|
//
|
|
// Created by Nico Verbruggen on 16/03/2022.
|
|
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
import AppKit
|
|
|
|
class SiteListKindCell: NSTableCellView, SiteListCellProtocol
|
|
{
|
|
static let reusableName = "siteListKindCell"
|
|
|
|
@IBOutlet weak var imageViewType: NSImageView!
|
|
|
|
func populateCell(with site: ValetSite) {
|
|
// If the `aliasPath` is nil, we're dealing with a parked site (otherwise: linked).
|
|
imageViewType.image = NSImage(
|
|
named: site.aliasPath == nil
|
|
? "IconParked"
|
|
: "IconLinked"
|
|
)
|
|
|
|
// Unless, of course, this is a default site
|
|
if site.absolutePath == Valet.shared.config.defaultSite {
|
|
imageViewType.image = NSImage(named: "IconDefault")
|
|
}
|
|
|
|
imageViewType.contentTintColor = NSColor.tertiaryLabelColor
|
|
}
|
|
}
|