mirror of https://github.com/status-im/nimqml.git
feat: add DockClicker event filter
Add an event filter to `qApp` that can detect a dock icon click (in macos) when the main window is hidden or closed.
This commit is contained in:
parent
6776fed33f
commit
bf48b9114a
|
@ -135,6 +135,7 @@ proc dos_qapplication_quit() {.cdecl, dynlib: dynLibName, importc.}
|
|||
proc dos_qapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qapplication_delete() {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qapplication_clipboard_setText(content: cstring) {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qapplication_installEventFilter(engine: DosQQmlApplicationEngine) {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
# QGuiApplication
|
||||
proc dos_qguiapplication_create() {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
|
|
@ -17,6 +17,9 @@ proc icon*(application: QApplication, filename: string) =
|
|||
proc setClipboardText*(text: string = "") =
|
||||
dos_qapplication_clipboard_setText(text.cstring)
|
||||
|
||||
proc installEventFilter*(application: QApplication, engine: QQmlApplicationEngine) =
|
||||
dos_qapplication_installEventFilter(engine.vptr)
|
||||
|
||||
proc delete*(application: QApplication) =
|
||||
## Delete the given QApplication
|
||||
if application.deleted:
|
||||
|
|
Loading…
Reference in New Issue