| 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): |