MCPcopy Create free account
hub / github.com/NyarchLinux/DesktopPuppet / load_webview

Method load_webview

src/puppets/live2d.py:29–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 return self.box
28
29 def load_webview(self):
30 webview = WebKit.WebView()
31 color = Gdk.RGBA()
32 color.red = 0
33 color.green = 0
34 color.blue = 0
35 color.alpha = 0
36 webview.set_background_color(color)
37
38 scale = int(self.scale)/100
39 q = urlencode({"model": self.model, "bg": "transparent", "scale": scale})
40 print(q)
41 webview.load_uri(urljoin(self.address, f"?{q}"))
42 webview.set_hexpand(True)
43 webview.set_vexpand(True)
44 def monitor_loading(wb, event):
45 if event == WebKit.LoadEvent.FINISHED:
46 self.loaded = True
47 webview.connect("load-changed", monitor_loading)
48 self.webview = webview
49
50 def change_address(self):

Callers 1

change_addressMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected