New Plus Window

This commit is contained in:
Leon Böttger committed 2025-05-17 10:04:54 +02:00
1 parent 1cdcf0297d
commit a76983df36
22 files changed
+115 -35

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.
+4
View File
@@ -200,6 +200,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
defer: false defer: false
) )
plusWindow?.styleMask.insert(.fullSizeContentView)
plusWindow?.titleVisibility = .hidden
plusWindow?.titlebarAppearsTransparent = true
plusWindow?.center() plusWindow?.center()
plusWindow?.isReleasedWhenClosed = false plusWindow?.isReleasedWhenClosed = false
plusWindow?.setFrameAutosaveName("PlusScreen") plusWindow?.setFrameAutosaveName("PlusScreen")
+21
View File
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Plain.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

+88 -32
View File
@@ -9,8 +9,8 @@ import SwiftUI
import StoreKit import StoreKit
import NearbyShare import NearbyShare
let plusViewWidth: CGFloat = 440 let plusViewWidth: CGFloat = 600
let plusViewHeight: CGFloat = 200 let plusViewHeight: CGFloat = 460
struct GetPlusView: View { struct GetPlusView: View {
@@ -41,64 +41,120 @@ struct GetPlusView: View {
var body: some View { var body: some View {
let validPrice = price != ""
ZStack { ZStack {
Color.defaultBackground ZStack {
.edgesIgnoringSafeArea(.all) if colorScheme == .dark {
Color.black.opacity(0.2)
}
else {
Color.white
}
}
.ignoresSafeArea()
let validPrice = price != "" VStack() {
// Top Image
VStack(spacing: 12) { let topHeight = 170.0
Text("plusview_title")
.font(.title)
.bold()
Text("plusview_description") ZStack {
.multilineTextAlignment(.center)
.padding() Color.gray.opacity(colorScheme == .light ? 0.1 : 0.12)
.padding(.top, -10)
.alert(isPresented: $boughtSuccessAlert, content: { Image(.plain)
Alert(title: Text("plusview_success_title"), message: Text("plusview_success_description"), dismissButton: .default(Text("plusview_success_button"), action: { .resizable()
closeView() .scaledToFit()
})) .padding(.top, topHeight * 0.23)
}) .padding(.bottom, topHeight * 0.07)
}
.edgesIgnoringSafeArea(.top)
.frame(height: topHeight)
HStack(spacing: 10) { Spacer()
VStack {
// Headline Text
Text("plusview_title")
.font(.system(size: 32))
.fontWeight(.semibold)
.multilineTextAlignment(.center)
.minimumScaleFactor(0.5)
.lineLimit(1)
// Subheadline
Text("plusview_description")
.font(.system(size: 15))
.lineSpacing(5)
.multilineTextAlignment(.center)
.padding(.top)
.alert(isPresented: $boughtSuccessAlert, content: {
Alert(title: Text("plusview_success_title"), message: Text("plusview_success_description"), dismissButton: .default(Text("plusview_success_button"), action: {
closeView()
}))
})
.minimumScaleFactor(0.5)
.opacity(0.8)
}
.padding(.horizontal, 40)
Spacer()
Divider()
// Buttons
HStack {
Button("plusview_restorepurchase") { Button("plusview_restorepurchase") {
restorePurchases() restorePurchases()
} }
.keyboardShortcut(.cancelAction) .foregroundColor(.gray)
.alert(isPresented: $showRestoreError, content: { .buttonStyle(.borderless)
Alert(title: Text("plusview_restorefailed"), message: Text(restoreError), dismissButton: .default(Text("plusview_restorefailed_proceed")))
})
.opacity(restoring ? 0 : 1) .opacity(restoring ? 0 : 1)
.overlay( .overlay(
ProgressView() ProgressView()
.scaleEffect(0.5) .scaleEffect(0.6)
.opacity(restoring ? 1 : 0) .opacity(restoring ? 1 : 0)
.frame(maxWidth: .infinity, alignment: .leading)
) )
.alert(isPresented: $showRestoreError, content: {
Alert(title: Text("plusview_restorefailed"), message: Text(restoreError), dismissButton: .default(Text("plusview_restorefailed_proceed")))
})
Spacer()
let priceString = validPrice ? " (\(price))" : "" let priceString = validPrice ? " (\(price))" : ""
Button("plusview_unlock_label".localized() + priceString) { Button("plusview_unlock_label".localized() + priceString) {
buttonAction() buttonAction()
} }
.buttonStyle(.bordered)
.controlSize(.large)
.keyboardShortcut(.defaultAction) .keyboardShortcut(.defaultAction)
.opacity(buying ? 0 : 1)
.overlay(
ProgressView()
.scaleEffect(0.6)
.opacity(buying ? 1 : 0)
.frame(maxWidth: .infinity, alignment: .trailing)
)
.padding(.horizontal)
.padding(.vertical, 10)
.alert(isPresented: $warning, content: { .alert(isPresented: $warning, content: {
Alert(title: Text("plusview_purchasefailed"), message: Text("plusview_purchasefaileddescription".localized() + (errorText != "" ? " Error: " : "") + errorText), dismissButton: .default(Text("plusview_restorefailed_proceed"))) Alert(title: Text("plusview_purchasefailed"), message: Text("plusview_purchasefaileddescription".localized() + (errorText != "" ? " Error: " : "") + errorText), dismissButton: .default(Text("plusview_restorefailed_proceed")))
}) })
} }
.opacity(buying || restoring ? 0 : 1) .padding(.horizontal)
.overlay( .padding(.bottom, 10)
ProgressView()
.scaleEffect(0.5)
.opacity(buying || restoring ? 1 : 0)
)
} }
.onAppear { .onAppear {
loadProducts(shouldBuy: false) loadProducts(shouldBuy: false)
} }
.animation(.default, value: validPrice) .animation(.default, value: validPrice)
.padding()
} }
.frame(width: plusViewWidth, height: plusViewHeight) .frame(width: plusViewWidth, height: plusViewHeight)
} }
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

+2 -2
View File
@@ -825,7 +825,7 @@
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx; SDKROOT = macosx;
SHARED_BUILD = 35; SHARED_BUILD = 36;
SHARED_VERSION = 1.8; SHARED_VERSION = 1.8;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -884,7 +884,7 @@
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
SDKROOT = macosx; SDKROOT = macosx;
SHARED_BUILD = 35; SHARED_BUILD = 36;
SHARED_VERSION = 1.8; SHARED_VERSION = 1.8;
SWIFT_COMPILATION_MODE = wholemodule; SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
@@ -34,7 +34,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = "en"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"