-
-
Notifications
You must be signed in to change notification settings - Fork 607
Open
Description
windowConfig = {
"title": "assistant",
"url": server,
"frameless": True,
"easy_drag": False,
"http_port": 11000,
"js_api": api,
}
def run(debug: bool = False, developmentURL: str = None):
if debug and developmentURL:
windowConfig["url"] = developmentURL
webview.settings['ALLOW_DOWNLOADS'] = True
window = webview.create_window(**windowConfig)
api._setWindow(window)
webview.start(debug=debug)
class WebViewAPI:
def __init__(self):
self._windowRef = None
self._isMaximized = False
def _setWindow(self, window: Window):
self._windowRef = weakref.ref(window)
def closeWindow(self):
self._windowRef().destroy()
def minimizeWindow(self):
self._windowRef().minimize()
def maximizeToggleWindow(self):
if self._isMaximized:
self._windowRef().restore()
self._isMaximized = False
else:
self._windowRef().maximize()
self._isMaximized = True
In the absence of borders, the window's zooming in and out animation will be lost.
Metadata
Metadata
Assignees
Labels
No labels