mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
fix macOS AppDelegate.swift & UI update
This commit is contained in:
@@ -2,7 +2,7 @@ import Flutter
|
|||||||
import UIKit
|
import UIKit
|
||||||
import UniformTypeIdentifiers
|
import UniformTypeIdentifiers
|
||||||
|
|
||||||
@UIApplicationMain
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate, UIDocumentPickerDelegate {
|
@objc class AppDelegate: FlutterAppDelegate, UIDocumentPickerDelegate {
|
||||||
var flutterResult: FlutterResult?
|
var flutterResult: FlutterResult?
|
||||||
var directoryPath: URL!
|
var directoryPath: URL!
|
||||||
|
@@ -96,7 +96,7 @@ class WindowFrame extends StatelessWidget {
|
|||||||
? Colors.white
|
? Colors.white
|
||||||
: Colors.black,
|
: Colors.black,
|
||||||
),
|
),
|
||||||
).toAlign(Alignment.centerLeft).paddingLeft(4),
|
).toAlign(Alignment.centerLeft).paddingLeft(4+(App.isMacOS?25:0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (kDebugMode)
|
if (kDebugMode)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
|
|
||||||
@NSApplicationMain
|
@main
|
||||||
class AppDelegate: FlutterAppDelegate {
|
class AppDelegate: FlutterAppDelegate {
|
||||||
var flutterResult: FlutterResult?
|
var flutterResult: FlutterResult?
|
||||||
var directoryPath: URL!
|
var directoryPath: URL!
|
||||||
@@ -13,12 +13,18 @@ class AppDelegate: FlutterAppDelegate {
|
|||||||
methodChannel.setMethodCallHandler { (call, result) in
|
methodChannel.setMethodCallHandler { (call, result) in
|
||||||
switch call.method {
|
switch call.method {
|
||||||
case "getProxy":
|
case "getProxy":
|
||||||
if let proxySettings = CFNetworkCopySystemProxySettings()?.takeUnretainedValue() as NSDictionary?,
|
if let proxySettings = CFNetworkCopySystemProxySettings()?.takeUnretainedValue() as NSDictionary? {
|
||||||
let dict = proxySettings.object(forKey: kCFNetworkProxiesHTTPProxy) as? NSDictionary,
|
if let httpProxy = proxySettings[kCFNetworkProxiesHTTPProxy] as? String,
|
||||||
let host = dict.object(forKey: kCFNetworkProxiesHTTPProxy) as? String,
|
let httpPort = proxySettings[kCFNetworkProxiesHTTPPort] as? Int {
|
||||||
let port = dict.object(forKey: kCFNetworkProxiesHTTPPort) as? Int {
|
let proxyConfig = "\(httpProxy):\(httpPort)"
|
||||||
let proxyConfig = "\(host):\(port)"
|
|
||||||
result(proxyConfig)
|
result(proxyConfig)
|
||||||
|
} else if let socksProxy = proxySettings[kCFNetworkProxiesSOCKSProxy] as? String,
|
||||||
|
let socksPort = proxySettings[kCFNetworkProxiesSOCKSPort] as? Int {
|
||||||
|
let proxyConfig = "\(socksProxy):\(socksPort)"
|
||||||
|
result(proxyConfig)
|
||||||
|
} else {
|
||||||
|
result("")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result("")
|
result("")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user