pyloid 0.16.10__tar.gz → 0.16.12__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyloid-0.16.10 → pyloid-0.16.12}/PKG-INFO +2 -1
- {pyloid-0.16.10 → pyloid-0.16.12}/pyproject.toml +2 -1
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/browser_window.py +40 -5
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/monitor.py +24 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/pyloid.py +2 -2
- {pyloid-0.16.10 → pyloid-0.16.12}/LICENSE +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/README.md +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/__init__.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/api.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/autostart.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/custom/titlebar.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/filewatcher.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/js_api/event_api.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/js_api/window_api.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/timer.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/tray.py +0 -0
- {pyloid-0.16.10 → pyloid-0.16.12}/src/pyloid/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyloid
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.12
|
4
4
|
Summary:
|
5
5
|
Author: aesthetics-of-record
|
6
6
|
Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
|
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
13
|
+
Requires-Dist: mss (>=9.0.2,<10.0.0)
|
13
14
|
Requires-Dist: pyside6 (>=6.7.3,<7.0.0)
|
14
15
|
Description-Content-Type: text/markdown
|
15
16
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyloid"
|
3
|
-
version = "0.16.
|
3
|
+
version = "0.16.12"
|
4
4
|
description = ""
|
5
5
|
authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
|
6
6
|
readme = "README.md"
|
@@ -11,6 +11,7 @@ packages = [
|
|
11
11
|
[tool.poetry.dependencies]
|
12
12
|
python = ">=3.9,<3.13"
|
13
13
|
pyside6 = "^6.7.3"
|
14
|
+
mss = "^9.0.2"
|
14
15
|
|
15
16
|
|
16
17
|
[build-system]
|
@@ -251,9 +251,45 @@ class BrowserWindow:
|
|
251
251
|
self.set_size(self.width, self.height)
|
252
252
|
self.set_position(self.x, self.y)
|
253
253
|
|
254
|
-
# allow local file access to remote urls
|
254
|
+
# allow local file access to remote urls and screen capture
|
255
255
|
self.web_view.settings().setAttribute(
|
256
|
-
QWebEngineSettings.LocalContentCanAccessRemoteUrls, True
|
256
|
+
QWebEngineSettings.WebAttribute.LocalContentCanAccessRemoteUrls, True
|
257
|
+
)
|
258
|
+
self.web_view.settings().setAttribute(
|
259
|
+
QWebEngineSettings.WebAttribute.ScreenCaptureEnabled, True
|
260
|
+
)
|
261
|
+
self.web_view.settings().setAttribute(
|
262
|
+
QWebEngineSettings.WebAttribute.AutoLoadImages, True
|
263
|
+
)
|
264
|
+
self.web_view.settings().setAttribute(
|
265
|
+
QWebEngineSettings.WebAttribute.JavascriptEnabled, True
|
266
|
+
)
|
267
|
+
self.web_view.settings().setAttribute(
|
268
|
+
QWebEngineSettings.WebAttribute.LocalStorageEnabled, True
|
269
|
+
)
|
270
|
+
self.web_view.settings().setAttribute(
|
271
|
+
QWebEngineSettings.WebAttribute.ErrorPageEnabled, True
|
272
|
+
)
|
273
|
+
self.web_view.settings().setAttribute(
|
274
|
+
QWebEngineSettings.WebAttribute.AutoLoadIconsForPage, True
|
275
|
+
)
|
276
|
+
self.web_view.settings().setAttribute(
|
277
|
+
QWebEngineSettings.WebAttribute.ShowScrollBars, True
|
278
|
+
)
|
279
|
+
self.web_view.settings().setAttribute(
|
280
|
+
QWebEngineSettings.WebAttribute.DnsPrefetchEnabled, True
|
281
|
+
)
|
282
|
+
self.web_view.settings().setAttribute(
|
283
|
+
QWebEngineSettings.WebAttribute.PdfViewerEnabled, True
|
284
|
+
)
|
285
|
+
self.web_view.settings().setAttribute(
|
286
|
+
QWebEngineSettings.WebAttribute.FullScreenSupportEnabled, True
|
287
|
+
)
|
288
|
+
self.web_view.settings().setAttribute(
|
289
|
+
QWebEngineSettings.WebAttribute.JavascriptCanAccessClipboard, True
|
290
|
+
)
|
291
|
+
self.web_view.settings().setUnknownUrlSchemePolicy(
|
292
|
+
QWebEngineSettings.UnknownUrlSchemePolicy.AllowAllUnknownUrlSchemes
|
257
293
|
)
|
258
294
|
|
259
295
|
# Set icon
|
@@ -305,7 +341,6 @@ class BrowserWindow:
|
|
305
341
|
source = bytes(qwebchannel_js.readAll()).decode("utf-8")
|
306
342
|
self.web_view.page().runJavaScript(source)
|
307
343
|
qwebchannel_js.close()
|
308
|
-
|
309
344
|
|
310
345
|
js_code = """
|
311
346
|
if (typeof QWebChannel !== 'undefined') {
|
@@ -1667,7 +1702,7 @@ class BrowserWindow:
|
|
1667
1702
|
Examples
|
1668
1703
|
--------
|
1669
1704
|
```python
|
1670
|
-
window.set_web_engine_view_attribute(QWebEngineSettings.WebAttribute.
|
1705
|
+
window.set_web_engine_view_attribute(QWebEngineSettings.WebAttribute.ScreenCaptureEnabled, False)
|
1671
1706
|
```
|
1672
1707
|
"""
|
1673
1708
|
settings = self.web_view.settings()
|
@@ -1690,7 +1725,7 @@ class BrowserWindow:
|
|
1690
1725
|
Examples
|
1691
1726
|
--------
|
1692
1727
|
```python
|
1693
|
-
window.is_web_engine_view_attribute(QWebEngineSettings.WebAttribute.
|
1728
|
+
window.is_web_engine_view_attribute(QWebEngineSettings.WebAttribute.ScreenCaptureEnabled)
|
1694
1729
|
```
|
1695
1730
|
"""
|
1696
1731
|
settings = self.web_view.settings()
|
@@ -895,3 +895,27 @@ class Monitor():
|
|
895
895
|
monitor = self.screen
|
896
896
|
monitor.refreshRateChanged.connect(callback)
|
897
897
|
|
898
|
+
def virtual_geometry_changed(self, callback: Callable):
|
899
|
+
"""
|
900
|
+
Registers a callback for the event that occurs when the virtual geometry of the monitor changes.
|
901
|
+
|
902
|
+
Parameters
|
903
|
+
----------
|
904
|
+
callback : Callable
|
905
|
+
The function to be called when the virtual geometry changes.
|
906
|
+
|
907
|
+
Examples
|
908
|
+
--------
|
909
|
+
```python
|
910
|
+
app = Pyloid("Pyloid-App")
|
911
|
+
|
912
|
+
def on_virtual_geometry_changed():
|
913
|
+
print("Virtual geometry changed!")
|
914
|
+
|
915
|
+
monitor = app.get_primary_monitor()
|
916
|
+
monitor.virtual_geometry_changed(on_virtual_geometry_changed)
|
917
|
+
```
|
918
|
+
"""
|
919
|
+
monitor = self.screen
|
920
|
+
monitor.virtualGeometryChanged.connect(callback)
|
921
|
+
|
@@ -12,7 +12,7 @@ from PySide6.QtGui import (
|
|
12
12
|
QImage,
|
13
13
|
QAction,
|
14
14
|
)
|
15
|
-
from PySide6.QtCore import Qt, Signal, QObject, QTimer
|
15
|
+
from PySide6.QtCore import Qt, Signal, QObject, QTimer, QEvent
|
16
16
|
from PySide6.QtNetwork import QLocalServer, QLocalSocket
|
17
17
|
from .api import PyloidAPI
|
18
18
|
from typing import List, Optional, Dict, Callable, Union, Literal
|
@@ -1395,4 +1395,4 @@ class Pyloid(QApplication):
|
|
1395
1395
|
window.web_view.page().runJavaScript(js_code)
|
1396
1396
|
window.web_view.page().setBackgroundColor(
|
1397
1397
|
Qt.GlobalColor.black if self.theme == "dark" else Qt.GlobalColor.white
|
1398
|
-
)
|
1398
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|