From f5e81d67cc63dbd1ef1fe57bcf796e6221bf08f7 Mon Sep 17 00:00:00 2001 From: Alexander Stepanischev Date: Sat, 5 Nov 2022 09:46:25 +0100 Subject: [PATCH] Added explicit Quit button --- WeatherDock.xcodeproj/project.pbxproj | 4 ++-- WeatherDock/views/main/HeaderView.swift | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/WeatherDock.xcodeproj/project.pbxproj b/WeatherDock.xcodeproj/project.pbxproj index 75112bd..525ad4a 100644 --- a/WeatherDock.xcodeproj/project.pbxproj +++ b/WeatherDock.xcodeproj/project.pbxproj @@ -511,7 +511,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"WeatherDock/Preview Content\""; DEVELOPMENT_TEAM = CT76ZJ5MHM; @@ -546,7 +546,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"WeatherDock/Preview Content\""; DEVELOPMENT_TEAM = CT76ZJ5MHM; diff --git a/WeatherDock/views/main/HeaderView.swift b/WeatherDock/views/main/HeaderView.swift index abe4836..859b4cb 100644 --- a/WeatherDock/views/main/HeaderView.swift +++ b/WeatherDock/views/main/HeaderView.swift @@ -39,6 +39,21 @@ struct HeaderView: View { } .buttonStyle(PlainButtonStyle()) .padding(.trailing) + Menu{ + Button { + NSApplication.shared.terminate(self) + } label: { + Text("Quit") + } + .buttonStyle(PlainButtonStyle()) + } label: { + Image(systemName: "xmark") + } + .frame(width: 10) + .menuStyle(.borderlessButton) + .menuIndicator(.hidden) + .padding(.trailing) + }.padding(.top) } }