feat(app): implement basic function
General - 配置界面支持配置对象存储桶 - 快捷键进入截图 - 一键上传截图 & 复制截图链接 MacOS - 状态栏指示器和应用图标
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//go:build darwin
|
||||
|
||||
package main
|
||||
|
||||
import "C"
|
||||
|
||||
//export nativeOverlayConfirm
|
||||
func nativeOverlayConfirm(x, y, w, h C.int) {
|
||||
nativeOverlayState.Lock()
|
||||
app := nativeOverlayState.app
|
||||
nativeOverlayState.app = nil
|
||||
nativeOverlayState.Unlock()
|
||||
if app == nil {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
_ = app.ConfirmNativeRegion(RegionRect{
|
||||
X: int(x),
|
||||
Y: int(y),
|
||||
W: int(w),
|
||||
H: int(h),
|
||||
})
|
||||
}()
|
||||
}
|
||||
|
||||
//export nativeOverlayCancel
|
||||
func nativeOverlayCancel() {
|
||||
nativeOverlayState.Lock()
|
||||
app := nativeOverlayState.app
|
||||
nativeOverlayState.app = nil
|
||||
nativeOverlayState.Unlock()
|
||||
if app == nil {
|
||||
return
|
||||
}
|
||||
go app.CancelNativeRegion()
|
||||
}
|
||||
Reference in New Issue
Block a user