Add rule override

Update core

Optimize more details
This commit is contained in:
chen08209
2025-03-12 17:15:31 +08:00
parent b6c7b15e3e
commit ef5f6dbd59
145 changed files with 7710 additions and 2404 deletions

View File

@@ -99,9 +99,9 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
app_links: 9028728e32c83a0831d9db8cf91c526d16cc5468
app_links: afe860c55c7ef176cea7fb630a2b7d7736de591d
connectivity_plus: 2256d3e20624a7749ed21653aafe291a46446fee
device_info_plus: a56e6e74dbbd2bb92f2da12c64ddd4f67a749041
device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
dynamic_color: b820c000cc68df65e7ba7ff177cb98404ce56651
file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24

View File

@@ -31,6 +31,7 @@
7AC6855B2B8AF836004C123B /* (null) in Bundle Framework */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
CDD319C761C7664F6008596B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4121E8CCDC7DC35194714CDE /* Pods_Runner.framework */; };
F50091052CF74B7700D43AEA /* FlClashCore in CopyFiles */ = {isa = PBXBuildFile; fileRef = F50091042CF74B7700D43AEA /* FlClashCore */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
F5AA39AF2DA1D9FB00F5C816 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = F5AA39AE2DA1D9FB00F5C816 /* LaunchAtLogin */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -135,6 +136,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F5AA39AF2DA1D9FB00F5C816 /* LaunchAtLogin in Frameworks */,
CDD319C761C7664F6008596B /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -326,6 +328,9 @@
Base,
);
mainGroup = 33CC10E42044A3C60003C045;
packageReferences = (
F5AA39AD2DA1D9FB00F5C816 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */,
);
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -827,6 +832,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
F5AA39AD2DA1D9FB00F5C816 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/LaunchAtLogin";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
F5AA39AE2DA1D9FB00F5C816 /* LaunchAtLogin */ = {
isa = XCSwiftPackageProductDependency;
package = F5AA39AD2DA1D9FB00F5C816 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */;
productName = LaunchAtLogin;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
}

View File

@@ -1,19 +1,37 @@
import Cocoa
import FlutterMacOS
import window_manager
import LaunchAtLogin
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
let windowFrame = self.frame
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)
RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
hiddenWindowAtLaunch()
}
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
let windowFrame = self.frame
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)
FlutterMethodChannel(
name: "launch_at_startup", binaryMessenger: flutterViewController.engine.binaryMessenger
)
.setMethodCallHandler { (_ call: FlutterMethodCall, result: @escaping FlutterResult) in
switch call.method {
case "launchAtStartupIsEnabled":
result(LaunchAtLogin.isEnabled)
case "launchAtStartupSetEnabled":
if let arguments = call.arguments as? [String: Any] {
LaunchAtLogin.isEnabled = arguments["setEnabledValue"] as! Bool
}
result(nil)
default:
result(FlutterMethodNotImplemented)
}
}
RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
hiddenWindowAtLaunch()
}
}