remove usage of UnsafePointer (#594)

This commit is contained in:
Brendan Allan
2023-03-06 00:20:41 +08:00
committed by GitHub
parent 2a09c7214b
commit 40562eaf25
2 changed files with 3 additions and 8 deletions

View File

@@ -1,8 +1,7 @@
import WebKit
@_cdecl("reload_webview")
public func reloadWebview(webviewPtr: UnsafePointer<WKWebView>) -> () {
let webview = webviewPtr.pointee;
public func reloadWebview(webview: WKWebView) -> () {
webview.window!.orderOut(webview);
webview.reload();
webview.window!.makeKey();

View File

@@ -21,9 +21,7 @@ public func lockAppTheme(themeType: AppThemeType) {
}
@_cdecl("blur_window_background")
public func blurWindowBackground(windowPtr: UnsafePointer<NSWindow>) {
let window = windowPtr.pointee;
public func blurWindowBackground(window: NSWindow) {
let windowContent = window.contentView!;
let blurryView = NSVisualEffectView();
@@ -51,9 +49,7 @@ func setInvisibleToolbar(windowPtr: NSWindow, hasToolbar: Bool) {
}
@_cdecl("set_titlebar_style")
public func setTitlebarStyle(windowPtr: UnsafePointer<NSWindow>, transparent: Bool, large: Bool) {
let window = windowPtr.pointee;
public func setTitlebarStyle(window: NSWindow, transparent: Bool, large: Bool) {
var styleMask = window.styleMask;
if transparent && large {