From 6eb93a5ea0a9f9978cd52d54594e7e6752ab8750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Orzech?= Date: Sun, 18 Jan 2026 02:27:27 +0000 Subject: [PATCH] feat: Update macOS deployment target and redesign the note window with a borderless style and custom glass effect. --- FastMemos.xcodeproj/project.pbxproj | 4 +-- FastMemos/Views/NoteWindowView.swift | 42 +++++----------------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/FastMemos.xcodeproj/project.pbxproj b/FastMemos.xcodeproj/project.pbxproj index 9e69125..11d7096 100644 --- a/FastMemos.xcodeproj/project.pbxproj +++ b/FastMemos.xcodeproj/project.pbxproj @@ -258,7 +258,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 26.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -315,7 +315,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 26.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; diff --git a/FastMemos/Views/NoteWindowView.swift b/FastMemos/Views/NoteWindowView.swift index 9da8235..551b6cb 100644 --- a/FastMemos/Views/NoteWindowView.swift +++ b/FastMemos/Views/NoteWindowView.swift @@ -14,7 +14,7 @@ class NotePanel: NSPanel { super.init( contentRect: NSRect(x: 0, y: 0, width: 500, height: 280), - styleMask: [.titled, .closable, .resizable, .fullSizeContentView], + styleMask: [.borderless, .fullSizeContentView], backing: .buffered, defer: false ) @@ -29,11 +29,8 @@ class NotePanel: NSPanel { self.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary] self.backgroundColor = .clear self.isOpaque = false + self.hasShadow = true - // Hide traffic light buttons - self.standardWindowButton(.closeButton)?.isHidden = true - self.standardWindowButton(.miniaturizeButton)?.isHidden = true - self.standardWindowButton(.zoomButton)?.isHidden = true // Set minimum size self.minSize = NSSize(width: 400, height: 200) @@ -42,32 +39,12 @@ class NotePanel: NSPanel { // Center on screen self.center() - // Create visual effect view for frosted glass - let visualEffectView = NSVisualEffectView() - visualEffectView.material = .hudWindow - visualEffectView.blendingMode = .behindWindow - visualEffectView.state = .active - visualEffectView.wantsLayer = true - visualEffectView.layer?.cornerRadius = 16 - visualEffectView.layer?.masksToBounds = true - let contentView = NoteWindowView(appState: appState, closeWindow: { [weak self] in self?.orderOut(nil) }) hostingView = NSHostingView(rootView: contentView) - hostingView?.translatesAutoresizingMaskIntoConstraints = false - visualEffectView.addSubview(hostingView!) - - // Constrain hosting view to fill the visual effect view - NSLayoutConstraint.activate([ - hostingView!.leadingAnchor.constraint(equalTo: visualEffectView.leadingAnchor), - hostingView!.trailingAnchor.constraint(equalTo: visualEffectView.trailingAnchor), - hostingView!.topAnchor.constraint(equalTo: visualEffectView.topAnchor), - hostingView!.bottomAnchor.constraint(equalTo: visualEffectView.bottomAnchor) - ]) - - self.contentView = visualEffectView + self.contentView = hostingView } func showWindow() { @@ -77,11 +54,6 @@ class NotePanel: NSPanel { }) hostingView?.rootView = contentView - // Hide traffic light buttons again (in case they reset) - self.standardWindowButton(.closeButton)?.isHidden = true - self.standardWindowButton(.miniaturizeButton)?.isHidden = true - self.standardWindowButton(.zoomButton)?.isHidden = true - self.center() self.makeKeyAndOrderFront(nil) NSApp.activate(ignoringOtherApps: true) @@ -208,9 +180,9 @@ struct NoteWindowView: View { } .padding(.horizontal, 16) .padding(.vertical, 12) - .background(.ultraThinMaterial) } - .clipShape(RoundedRectangle(cornerRadius: 16)) + .padding(4) + .glassEffect(.regular, in: .rect(cornerRadius: 20)) .frame(minWidth: 400, minHeight: 200) .onAppear { visibility = appState.defaultVisibility @@ -219,8 +191,8 @@ struct NoteWindowView: View { .onExitCommand { closeWindow() } - .animation(.easeInOut(duration: 0.2), value: showSuccess) - .animation(.easeInOut(duration: 0.2), value: errorMessage) + .animation(Animation.easeInOut(duration: 0.2), value: showSuccess) + .animation(Animation.easeInOut(duration: 0.2), value: errorMessage) } private var wordCount: Int {