Skip to content

In the absence of borders, the window's zooming in and out animation will be lost. #1715

@xyk2002

Description

@xyk2002
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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions