mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
✨ Add info button for PHP upgrades
This commit is contained in:
@ -3688,7 +3688,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
@ -3719,7 +3719,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
@ -3960,7 +3960,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
@ -4077,7 +4077,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
@ -4194,7 +4194,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
@ -4377,7 +4377,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1520;
|
CURRENT_PROJECT_VERSION = 1525;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
|
@ -116,6 +116,10 @@ struct Constants {
|
|||||||
string: "https://phpmon.app/php-unavailable"
|
string: "https://phpmon.app/php-unavailable"
|
||||||
)!
|
)!
|
||||||
|
|
||||||
|
static let WikiPhpUpgrade = URL(
|
||||||
|
string: "https://phpmon.app/php-upgrade"
|
||||||
|
)!
|
||||||
|
|
||||||
static let DonationPayment = URL(
|
static let DonationPayment = URL(
|
||||||
string: "https://phpmon.app/sponsor/now"
|
string: "https://phpmon.app/sponsor/now"
|
||||||
)!
|
)!
|
||||||
|
@ -10,6 +10,11 @@ import Foundation
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct HelpButton: View {
|
struct HelpButton: View {
|
||||||
|
@State var frameSize: CGFloat = 14
|
||||||
|
@State var textSize: CGFloat = 12
|
||||||
|
@State var shadowOpacity: CGFloat = 0.3
|
||||||
|
@State var shadowRadius: CGFloat = 1
|
||||||
|
|
||||||
var action: () -> Void
|
var action: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@ -18,9 +23,10 @@ struct HelpButton: View {
|
|||||||
Circle()
|
Circle()
|
||||||
.strokeBorder(Color(NSColor.separatorColor), lineWidth: 0.5)
|
.strokeBorder(Color(NSColor.separatorColor), lineWidth: 0.5)
|
||||||
.background(Circle().foregroundColor(Color(NSColor.controlColor)).opacity(0.7))
|
.background(Circle().foregroundColor(Color(NSColor.controlColor)).opacity(0.7))
|
||||||
.shadow(color: Color(NSColor.separatorColor).opacity(0.3), radius: 1)
|
.shadow(color: Color(NSColor.separatorColor)
|
||||||
.frame(width: 14, height: 14)
|
.opacity(shadowOpacity), radius: shadowRadius)
|
||||||
Text("?").font(.system(size: 12, weight: .medium))
|
.frame(width: frameSize, height: frameSize)
|
||||||
|
Text("?").font(.system(size: textSize, weight: .medium))
|
||||||
.foregroundColor(Color(NSColor.labelColor))
|
.foregroundColor(Color(NSColor.labelColor))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
// swiftlint:disable type_body_length
|
||||||
struct PhpVersionManagerView: View {
|
struct PhpVersionManagerView: View {
|
||||||
@ObservedObject var formulae: BrewFormulaeObservable
|
@ObservedObject var formulae: BrewFormulaeObservable
|
||||||
@ObservedObject var status: BusyStatus
|
@ObservedObject var status: BusyStatus
|
||||||
@ -231,7 +232,11 @@ struct PhpVersionManagerView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if formula.isInstalled {
|
if formula.hasUpgradedFormulaAlias {
|
||||||
|
HelpButton(frameSize: 18, textSize: 14, shadowOpacity: 1, shadowRadius: 2, action: {
|
||||||
|
NSWorkspace.shared.open(Constants.Urls.WikiPhpUpgrade)
|
||||||
|
})
|
||||||
|
} else if formula.isInstalled {
|
||||||
Button("phpman.buttons.uninstall".localizedForSwiftUI, role: .destructive) {
|
Button("phpman.buttons.uninstall".localizedForSwiftUI, role: .destructive) {
|
||||||
Task { await self.confirmUninstall(formula) }
|
Task { await self.confirmUninstall(formula) }
|
||||||
}
|
}
|
||||||
@ -285,6 +290,15 @@ struct PhpVersionManagerView: View {
|
|||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func formulaIcon(for formula: BrewPhpFormula) -> some View {
|
||||||
|
Image(systemName: formula.icon)
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: 16, height: 16)
|
||||||
|
.foregroundColor(formula.iconColor)
|
||||||
|
.padding(.horizontal, 5)
|
||||||
|
}
|
||||||
|
|
||||||
private func unavailableFormula() -> some View {
|
private func unavailableFormula() -> some View {
|
||||||
HStack(spacing: 5) {
|
HStack(spacing: 5) {
|
||||||
Text("phpman.version.unavailable".localizedForSwiftUI)
|
Text("phpman.version.unavailable".localizedForSwiftUI)
|
||||||
@ -295,16 +309,8 @@ struct PhpVersionManagerView: View {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func formulaIcon(for formula: BrewPhpFormula) -> some View {
|
|
||||||
Image(systemName: formula.icon)
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: 16, height: 16)
|
|
||||||
.foregroundColor(formula.iconColor)
|
|
||||||
.padding(.horizontal, 5)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// swiftlint:enable type_body_length
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
PhpVersionManagerView(
|
PhpVersionManagerView(
|
||||||
|
Reference in New Issue
Block a user