mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
👌 SwiftUI fixes
This commit is contained in:
@ -16,7 +16,8 @@ class FakeServicesManager: ServicesManager {
|
||||
|
||||
init(
|
||||
formulae: [String] = ["php", "nginx", "dnsmasq"],
|
||||
status: Service.Status = .active
|
||||
status: Service.Status = .active,
|
||||
loading: Bool = false
|
||||
) {
|
||||
super.init()
|
||||
|
||||
@ -29,6 +30,10 @@ class FakeServicesManager: ServicesManager {
|
||||
self.services = []
|
||||
self.reapplyServices()
|
||||
|
||||
if loading {
|
||||
return
|
||||
}
|
||||
|
||||
Task { @MainActor in
|
||||
self.firstRunComplete = true
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ class FakeValetSite: ValetSite {
|
||||
self.isolatedPhpVersion = PhpInstallation(isolated)
|
||||
}
|
||||
|
||||
self.evaluateCompatibility()
|
||||
if PhpEnv.shared.currentInstall != nil {
|
||||
self.evaluateCompatibility()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,8 +77,17 @@ struct VersionPopoverView: View {
|
||||
return "alert.composer_php_requirement.unable_to_determine".localized
|
||||
}
|
||||
|
||||
|
||||
let suffix = {
|
||||
if isRunningTests || isRunningSwiftUIPreview {
|
||||
return "test"
|
||||
}
|
||||
|
||||
return Valet.shared.config.tld
|
||||
}()
|
||||
|
||||
return "alert.composer_php_requirement.title".localized(
|
||||
"\(site.name).\(Valet.shared.config.tld)",
|
||||
"\(site.name).\(suffix)",
|
||||
site.composerPhp
|
||||
)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ struct ServicesView: View {
|
||||
let view = NSHostingView(rootView: rootView)
|
||||
view.autoresizingMask = [.width]
|
||||
view.setFrameSize(
|
||||
CGSize(width: view.frame.width, height: rootView.height + 30)
|
||||
CGSize(width: view.frame.width, height: rootView.height)
|
||||
)
|
||||
// view.layer?.backgroundColor = CGColor.init(red: 255, green: 0, blue: 0, alpha: 1)
|
||||
view.focusRingType = .none
|
||||
@ -153,13 +153,6 @@ struct ServiceView: View {
|
||||
|
||||
struct ServicesView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ServicesView(manager: FakeServicesManager(
|
||||
formulae: ["php", "nginx", "dnsmasq"],
|
||||
status: .active
|
||||
), perRow: 4)
|
||||
.frame(width: 330.0)
|
||||
.previewDisplayName("Loading")
|
||||
|
||||
ServicesView(manager: FakeServicesManager(
|
||||
formulae: ["php", "nginx", "dnsmasq"],
|
||||
status: .active
|
||||
|
Reference in New Issue
Block a user