From 253f550212dc445736f64636029cf6d3a0b167db Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:24:41 +0200 Subject: [PATCH] Added quit button, and fixed WindowGroup showing up --- Brewer.xcodeproj/project.pbxproj | 14 +++++++---- .../contents.xcworkspacedata | 2 +- Brewer/BrewerApp.swift | 24 +++++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Brewer.xcodeproj/project.pbxproj b/Brewer.xcodeproj/project.pbxproj index e83269a..cc098aa 100644 --- a/Brewer.xcodeproj/project.pbxproj +++ b/Brewer.xcodeproj/project.pbxproj @@ -469,21 +469,24 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Brewer/Brewer.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = "0.1.1-beta"; DEVELOPMENT_ASSET_PATHS = "\"Brewer/Preview Content\""; DEVELOPMENT_TEAM = 96S93Z7LTG; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = Brewer; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = "0.1.1-beta"; PRODUCT_BUNDLE_IDENTIFIER = dev.cems.Brewer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -497,21 +500,24 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Brewer/Brewer.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = "0.1.1-beta"; DEVELOPMENT_ASSET_PATHS = "\"Brewer/Preview Content\""; DEVELOPMENT_TEAM = 96S93Z7LTG; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = Brewer; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = "0.1.1-beta"; PRODUCT_BUNDLE_IDENTIFIER = dev.cems.Brewer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/Brewer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Brewer.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a..f9c923d 100644 --- a/Brewer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Brewer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:/Volumes/Data/Projects/Brewer/Brewer.xcodeproj"> diff --git a/Brewer/BrewerApp.swift b/Brewer/BrewerApp.swift index e7f99ca..5efbe2c 100644 --- a/Brewer/BrewerApp.swift +++ b/Brewer/BrewerApp.swift @@ -25,11 +25,24 @@ struct BrewerApp: App { } var body: some Scene { - WindowGroup { - EmptyView() - } MenuBarExtra { - ContentView().padding() + VStack(spacing: 0) { + ContentView() + .padding() + .padding(.bottom, 0) + Button { + NSApplication.shared.terminate(self) + } label: { + Label("Quit", systemImage: "x") + .symbolRenderingMode(.palette) + .symbolVariant(.circle) + .symbolVariant(.fill) + .foregroundStyle(.white, .red) + } + .frame(maxWidth: .infinity, alignment: .trailing) + .padding() + .padding(.top, 0) + } } label: { if isUpToDate { Label("Brewer", systemImage: "sparkle.magnifyingglass") @@ -40,6 +53,9 @@ struct BrewerApp: App { } } .menuBarExtraStyle(.window) + WindowGroup { + EmptyView() + } } }