From 0c96b11b05d8f7619e8b23d8244493b89c3bb3a1 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Wed, 16 Mar 2022 19:40:01 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20WIP:=20Modified=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Domain/App/Base.lproj/Main.storyboard | 45 +++++++++++++------ .../SiteList/Cells/SiteListNameCell.swift | 6 +-- .../SiteList/Cells/SiteListPhpCell.swift | 14 ++++++ .../SiteList/Cells/SiteListTypeCell.swift | 2 + phpmon/Domain/SiteList/SiteListCell.swift | 11 ----- 5 files changed, 48 insertions(+), 30 deletions(-) diff --git a/phpmon/Domain/App/Base.lproj/Main.storyboard b/phpmon/Domain/App/Base.lproj/Main.storyboard index 307551a..e9e522f 100644 --- a/phpmon/Domain/App/Base.lproj/Main.storyboard +++ b/phpmon/Domain/App/Base.lproj/Main.storyboard @@ -849,7 +849,7 @@ Gw - + @@ -862,19 +862,19 @@ Gw - + - - + + - - + + @@ -886,6 +886,7 @@ Gw + @@ -894,7 +895,7 @@ Gw - + @@ -907,11 +908,11 @@ Gw - + + + + + + + + + + + + - + + + + + - + @@ -941,7 +957,7 @@ Gw - + @@ -954,8 +970,8 @@ Gw - - + + @@ -1030,6 +1046,7 @@ Gw + diff --git a/phpmon/Domain/SiteList/Cells/SiteListNameCell.swift b/phpmon/Domain/SiteList/Cells/SiteListNameCell.swift index 5017d4f..f5e00ab 100644 --- a/phpmon/Domain/SiteList/Cells/SiteListNameCell.swift +++ b/phpmon/Domain/SiteList/Cells/SiteListNameCell.swift @@ -20,11 +20,7 @@ class SiteListNameCell: NSTableCellView, SiteListCellProtocol self.site = site var siteName = "\(site.name).\(Valet.shared.config.tld)" - - if (site.isolatedPhpVersion != nil) { - siteName += " [isolated \(site.isolatedPhpVersion!.versionNumber.homebrewVersion)]" - } - + labelSiteName.stringValue = siteName // Show the absolute path, except make sure to replace the /Users/username segment with ~ for readability diff --git a/phpmon/Domain/SiteList/Cells/SiteListPhpCell.swift b/phpmon/Domain/SiteList/Cells/SiteListPhpCell.swift index e8743ca..4349207 100644 --- a/phpmon/Domain/SiteList/Cells/SiteListPhpCell.swift +++ b/phpmon/Domain/SiteList/Cells/SiteListPhpCell.swift @@ -11,7 +11,21 @@ import AppKit class SiteListPhpCell: NSTableCellView, SiteListCellProtocol { + @IBOutlet weak var buttonPhpVersion: NSButton! + @IBOutlet weak var imageViewPhpVersionOK: NSImageView! + func populateCell(with site: ValetSite) { + let versionInUse = site.isolatedPhpVersion?.versionNumber.homebrewVersion ?? PhpEnv.phpInstall.version.short + buttonPhpVersion.title = " PHP \(versionInUse)" + + if site.isolatedPhpVersion != nil { + imageViewPhpVersionOK.isHidden = false + imageViewPhpVersionOK.image = NSImage(named: "Isolated") + } else { + imageViewPhpVersionOK.isHidden = (site.composerPhp == "???" || !site.composerPhpCompatibleWithLinked) + imageViewPhpVersionOK.image = NSImage(named: "Checkmark") + } + } diff --git a/phpmon/Domain/SiteList/Cells/SiteListTypeCell.swift b/phpmon/Domain/SiteList/Cells/SiteListTypeCell.swift index 7be8804..f66296d 100644 --- a/phpmon/Domain/SiteList/Cells/SiteListTypeCell.swift +++ b/phpmon/Domain/SiteList/Cells/SiteListTypeCell.swift @@ -32,5 +32,7 @@ class SiteListTypeCell: NSTableCellView, SiteListCellProtocol let constraint = site.notableComposerDependencies["laravel/framework"]! labelDriver.stringValue = "Laravel (\(constraint))" } + + labelDriver.stringValue += "\nPHP \(site.composerPhp)" } } diff --git a/phpmon/Domain/SiteList/SiteListCell.swift b/phpmon/Domain/SiteList/SiteListCell.swift index 375119c..2bb60c7 100644 --- a/phpmon/Domain/SiteList/SiteListCell.swift +++ b/phpmon/Domain/SiteList/SiteListCell.swift @@ -15,22 +15,11 @@ protocol SiteListCellProtocol { class SiteListCell: NSTableCellView { - @IBOutlet weak var labelDriverType: NSTextField! - - - @IBOutlet weak var buttonPhpVersion: NSButton! - @IBOutlet weak var imageViewPhpVersionOK: NSImageView! - override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) } func populateCell(with site: ValetSite) { - // Show the PHP version - buttonPhpVersion.title = " PHP \(site.composerPhp) " - buttonPhpVersion.isHidden = (site.composerPhp == "???") - - imageViewPhpVersionOK.isHidden = (site.composerPhp == "???" || !site.composerPhpCompatibleWithLinked) } /*