mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
👌 Various UI improvements
This commit is contained in:
@ -1358,9 +1358,9 @@
|
|||||||
C43931C329C4BD510069165B /* PhpManager */ = {
|
C43931C329C4BD510069165B /* PhpManager */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
C4D5576329C77CC5001A44CD /* PhpVersionManagerWindowController.swift */,
|
||||||
C43931C429C4BD610069165B /* PhpFormulaeManager.swift */,
|
C43931C429C4BD610069165B /* PhpFormulaeManager.swift */,
|
||||||
C48DDD0C29C75C9E00D032D9 /* BlockingOverlayView.swift */,
|
C48DDD0C29C75C9E00D032D9 /* BlockingOverlayView.swift */,
|
||||||
C4D5576329C77CC5001A44CD /* PhpVersionManagerWindowController.swift */,
|
|
||||||
);
|
);
|
||||||
path = PhpManager;
|
path = PhpManager;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -37,13 +37,13 @@ class PMWindowController: NSWindowController, NSWindowDelegate {
|
|||||||
|
|
||||||
extension NSWindowController {
|
extension NSWindowController {
|
||||||
|
|
||||||
public func positionWindowInTopLeftCorner() {
|
public func positionWindowInTopLeftCorner(offsetY: CGFloat = 0, offsetX: CGFloat = 0) {
|
||||||
guard let frame = NSScreen.main?.frame else { return }
|
guard let frame = NSScreen.main?.frame else { return }
|
||||||
guard let window = self.window else { return }
|
guard let window = self.window else { return }
|
||||||
|
|
||||||
window.setFrame(NSRect(
|
window.setFrame(NSRect(
|
||||||
x: frame.size.width - window.frame.size.width - 20,
|
x: frame.size.width - window.frame.size.width - 20 + offsetX,
|
||||||
y: frame.size.height - window.frame.size.height - 40,
|
y: frame.size.height - window.frame.size.height - 40 + offsetY,
|
||||||
width: window.frame.width,
|
width: window.frame.width,
|
||||||
height: window.frame.height
|
height: window.frame.height
|
||||||
), display: true)
|
), display: true)
|
||||||
|
@ -44,7 +44,7 @@ struct BlockingOverlayView<Content: View>: View {
|
|||||||
.padding(.top, -4)
|
.padding(.top, -4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}.background(Color.white)
|
||||||
.disabled(isBlocking)
|
.disabled(isBlocking)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ struct PhpFormulaeView: View {
|
|||||||
|
|
||||||
self.status = PhpFormulaeStatus(
|
self.status = PhpFormulaeStatus(
|
||||||
busy: true,
|
busy: true,
|
||||||
title: "Checking for updates",
|
title: "Checking for updates!",
|
||||||
description: "Checking if any PHP version is outdated..."
|
description: "Checking if any PHP version is outdated..."
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -47,8 +47,53 @@ struct PhpFormulaeView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
BlockingOverlayView(busy: self.status.busy, title: self.status.title, text: self.status.description) {
|
VStack {
|
||||||
VStack {
|
HStack(alignment: .center, spacing: 15) {
|
||||||
|
Image(systemName: "arrow.down.to.line.circle.fill")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 40, height: 40)
|
||||||
|
.foregroundColor(Color.blue)
|
||||||
|
.padding(12)
|
||||||
|
VStack(alignment: .leading, spacing: 5) {
|
||||||
|
Text("phpman.description".localizedForSwiftUI)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
Text("phpman.disclaimer".localizedForSwiftUI)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(10)
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
|
HStack(alignment: .center, spacing: 15) {
|
||||||
|
Button {
|
||||||
|
Task { // Reload warnings
|
||||||
|
Task { @MainActor in
|
||||||
|
self.status.busy = true
|
||||||
|
self.status.title = "Checking for updates!"
|
||||||
|
self.status.description = "Checking if any PHP version is outdated..."
|
||||||
|
}
|
||||||
|
await self.handler.refreshPhpVersions(loadOutdated: true)
|
||||||
|
Task { @MainActor in
|
||||||
|
self.status.busy = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "arrow.clockwise")
|
||||||
|
.buttonStyle(.automatic)
|
||||||
|
.controlSize(.large)
|
||||||
|
}
|
||||||
|
.focusable(false)
|
||||||
|
|
||||||
|
Text("phpman.refresh.button.description".localizedForSwiftUI)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
.font(.system(size: 11))
|
||||||
|
}
|
||||||
|
.padding(10)
|
||||||
|
|
||||||
|
BlockingOverlayView(busy: self.status.busy, title: self.status.title, text: self.status.description) {
|
||||||
List(Array(formulae.phpVersions.enumerated()), id: \.1.name) { (index, formula) in
|
List(Array(formulae.phpVersions.enumerated()), id: \.1.name) { (index, formula) in
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: formula.icon)
|
Image(systemName: formula.icon)
|
||||||
@ -96,7 +141,7 @@ struct PhpFormulaeView: View {
|
|||||||
.padding(.vertical, 10)
|
.padding(.vertical, 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.frame(width: 500, height: 500)
|
}.frame(width: 600, height: 600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +150,7 @@ struct PhpFormulaeView_Previews: PreviewProvider {
|
|||||||
PhpFormulaeView(
|
PhpFormulaeView(
|
||||||
formulae: Brew.shared.formulae,
|
formulae: Brew.shared.formulae,
|
||||||
handler: FakeBrewFormulaeHandler()
|
handler: FakeBrewFormulaeHandler()
|
||||||
).frame(width: 600, height: 500)
|
).frame(width: 600, height: 600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class PhpVersionManagerWindowController: PMWindowController {
|
|||||||
window.titlebarAppearsTransparent = true
|
window.titlebarAppearsTransparent = true
|
||||||
window.delegate = delegate ?? windowController
|
window.delegate = delegate ?? windowController
|
||||||
window.contentView = NSHostingView(rootView: windowController.view)
|
window.contentView = NSHostingView(rootView: windowController.view)
|
||||||
window.setContentSize(NSSize(width: 600, height: 480))
|
window.setContentSize(NSSize(width: 600, height: 800))
|
||||||
|
|
||||||
App.shared.versionManagerWindowController = windowController
|
App.shared.versionManagerWindowController = windowController
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ class PhpVersionManagerWindowController: PMWindowController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
App.shared.versionManagerWindowController?.showWindow(self)
|
App.shared.versionManagerWindowController?.showWindow(self)
|
||||||
App.shared.versionManagerWindowController?.window?.setCenterPosition(offsetY: 70)
|
App.shared.versionManagerWindowController?.positionWindowInTopLeftCorner()
|
||||||
|
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,14 @@ struct WarningListView: View {
|
|||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 15) {
|
HStack(alignment: .center, spacing: 15) {
|
||||||
Button("warnings.refresh.button".localizedForSwiftUI) {
|
Button {
|
||||||
Task { // Reload warnings
|
Task { // Reload warnings
|
||||||
await self.warningManager.checkEnvironment()
|
await self.warningManager.checkEnvironment()
|
||||||
}
|
}
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "arrow.clockwise")
|
||||||
|
.buttonStyle(.automatic)
|
||||||
|
.controlSize(.large)
|
||||||
}
|
}
|
||||||
Text("warnings.refresh.button.description".localizedForSwiftUI)
|
Text("warnings.refresh.button.description".localizedForSwiftUI)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
"mi_no_php_linked" = "No PHP version linked!";
|
"mi_no_php_linked" = "No PHP version linked!";
|
||||||
"mi_fix_php_link" = "Fix Automatically...";
|
"mi_fix_php_link" = "Fix Automatically...";
|
||||||
"mi_no_php_linked_explain" = "What's This?";
|
"mi_no_php_linked_explain" = "What's This?";
|
||||||
"mi_php_version_manager" = "Install & Upgrade PHP Versions...";
|
"mi_php_version_manager" = "PHP Version Manager...";
|
||||||
|
|
||||||
"mi_diagnostics" = "Diagnostics";
|
"mi_diagnostics" = "Diagnostics";
|
||||||
"mi_active_services" = "Active Services";
|
"mi_active_services" = "Active Services";
|
||||||
@ -88,6 +88,14 @@
|
|||||||
"mi_xdebug_actions" = "Actions";
|
"mi_xdebug_actions" = "Actions";
|
||||||
"mi_xdebug_disable_all" = "Disable All Modes";
|
"mi_xdebug_disable_all" = "Disable All Modes";
|
||||||
|
|
||||||
|
// PHPMAN
|
||||||
|
|
||||||
|
"phpman.title" = "PHP Manager";
|
||||||
|
"phpman.description" = "**PHP Manager** lets you install different PHP versions via Homebrew.";
|
||||||
|
"phpman.disclaimer" = "PHP Manager may ask for administrative privileges to take ownership of certain folders during certain operations. If you prefer it, you can also manually install PHP versions via the terminal.";
|
||||||
|
"phpman.refresh.button" = "Search for Updates";
|
||||||
|
"phpman.refresh.button.description" = "You can press this button to check (again) if any updates are available to installed PHP versions. When you first open this window, PHP Monitor already does this check.";
|
||||||
|
|
||||||
// GENERIC
|
// GENERIC
|
||||||
|
|
||||||
"generic.ok" = "OK";
|
"generic.ok" = "OK";
|
||||||
|
Reference in New Issue
Block a user