From 2bf28fe247ed7eb8f40ba8fbc2db4876df388d0c Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Sat, 16 Mar 2024 00:32:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Allow=20resizable=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PHP Monitor.xcodeproj/project.pbxproj | 12 ++++++------ phpmon/Common/Helpers/PMWindowController.swift | 2 ++ .../UI/PhpExtensionManagerView.swift | 2 +- .../UI/PhpExtensionManagerWindowController.swift | 4 ++-- .../UI/PhpVersionManagerView.swift | 3 ++- .../UI/PhpVersionManagerWindowController.swift | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/PHP Monitor.xcodeproj/project.pbxproj b/PHP Monitor.xcodeproj/project.pbxproj index 119a26c..8d8b8ce 100644 --- a/PHP Monitor.xcodeproj/project.pbxproj +++ b/PHP Monitor.xcodeproj/project.pbxproj @@ -3665,7 +3665,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3696,7 +3696,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3937,7 +3937,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; @@ -4054,7 +4054,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -4171,7 +4171,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -4353,7 +4353,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1450; + CURRENT_PROJECT_VERSION = 1455; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; diff --git a/phpmon/Common/Helpers/PMWindowController.swift b/phpmon/Common/Helpers/PMWindowController.swift index e42a92f..30e1857 100644 --- a/phpmon/Common/Helpers/PMWindowController.swift +++ b/phpmon/Common/Helpers/PMWindowController.swift @@ -29,6 +29,8 @@ class PMWindowController: NSWindowController, NSWindowDelegate { App.shared.remove(window: windowName) } + func windowDidResize(_ notification: Notification) {} + deinit { Log.perf("deinit: \(String(describing: self)).\(#function)") } diff --git a/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerView.swift b/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerView.swift index 2368f39..41200a1 100644 --- a/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerView.swift +++ b/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerView.swift @@ -58,7 +58,7 @@ struct PhpExtensionManagerView: View { .searchable(text: $searchText) } } - .frame(width: 600, height: 600) + .frame(minWidth: 600, minHeight: 600) .onAppear { Task { await delay(seconds: 1) diff --git a/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerWindowController.swift b/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerWindowController.swift index 0f38ec0..a0260b1 100644 --- a/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerWindowController.swift +++ b/phpmon/Modules/PHP Extension Manager/UI/PhpExtensionManagerWindowController.swift @@ -1,5 +1,5 @@ // -// PhpVersionManagerWindowController.swift +// PhpExtensionManagerWindowController.swift // PHP Monitor // // Created by Nico Verbruggen on 13/11/2023. @@ -28,7 +28,7 @@ class PhpExtensionManagerWindowController: PMWindowController { guard let window = windowController.window else { return } window.title = "phpextman.window.title".localized - window.styleMask = [.titled, .closable, .miniaturizable] + window.styleMask = [.titled, .closable, .miniaturizable, .resizable] window.titlebarAppearsTransparent = false window.delegate = delegate ?? windowController window.contentView = NSHostingView(rootView: windowController.view) diff --git a/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerView.swift b/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerView.swift index 15e4c81..6b9e191 100644 --- a/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerView.swift +++ b/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerView.swift @@ -136,7 +136,8 @@ struct PhpVersionManagerView: View { .listStyle(PlainListStyle()) } } - }.frame(width: 600, height: 600) + } + .frame(minWidth: 600, minHeight: 600) } // MARK: View Variables diff --git a/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerWindowController.swift b/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerWindowController.swift index 083d560..698b0d6 100644 --- a/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerWindowController.swift +++ b/phpmon/Modules/PHP Version Manager/UI/PhpVersionManagerWindowController.swift @@ -30,7 +30,7 @@ class PhpVersionManagerWindowController: PMWindowController { guard let window = windowController.window else { return } window.title = "" - window.styleMask = [.titled, .closable, .miniaturizable] + window.styleMask = [.titled, .closable, .miniaturizable, .resizable] window.titlebarAppearsTransparent = true window.delegate = delegate ?? windowController window.contentView = NSHostingView(rootView: windowController.view)