pyloid 0.16.8__py3-none-any.whl → 0.16.10__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
pyloid/browser_window.py
CHANGED
@@ -58,25 +58,22 @@ class CustomWebPage(QWebEnginePage):
|
|
58
58
|
|
59
59
|
|
60
60
|
class CustomWebEngineView(QWebEngineView):
|
61
|
-
def __init__(self, parent=None):
|
61
|
+
def __init__(self, parent: "BrowserWindow" = None):
|
62
62
|
super().__init__(parent._window)
|
63
|
-
self.parent = parent
|
63
|
+
self.parent: "BrowserWindow" = parent
|
64
64
|
|
65
65
|
# 커스텀 웹 페이지 설정
|
66
66
|
self.custom_page = CustomWebPage()
|
67
67
|
self.setPage(self.custom_page)
|
68
68
|
|
69
|
-
self.drag_relative_position = None
|
70
|
-
self.is_dragging = False
|
71
69
|
self.is_resizing = False
|
72
70
|
self.resize_start_pos = None
|
73
71
|
self.resize_direction = None
|
74
|
-
self.screen_geometry = self.screen().
|
72
|
+
self.screen_geometry = self.screen().virtualGeometry()
|
75
73
|
self.is_resizing_enabled = True
|
76
74
|
|
77
75
|
def mouse_press_event(self, event):
|
78
76
|
if event.button() == Qt.LeftButton:
|
79
|
-
self.drag_relative_position = event.globalPos() - self.parent._window.pos()
|
80
77
|
if not self.parent.frame and self.is_resizing_enabled:
|
81
78
|
self.resize_direction = self.get_resize_direction(event.pos())
|
82
79
|
if self.resize_direction:
|
@@ -84,35 +81,13 @@ class CustomWebEngineView(QWebEngineView):
|
|
84
81
|
self.resize_start_pos = event.globalPos()
|
85
82
|
|
86
83
|
def start_system_drag(self):
|
87
|
-
|
84
|
+
"""네이티브 시스템 창 이동 시작"""
|
85
|
+
if self.parent._window.windowHandle():
|
86
|
+
self.parent._window.windowHandle().startSystemMove()
|
88
87
|
|
89
88
|
def mouse_move_event(self, event):
|
90
89
|
if self.is_resizing and self.is_resizing_enabled:
|
91
90
|
self.resize_window(event.globalPos())
|
92
|
-
elif not self.parent.frame and self.is_dragging:
|
93
|
-
# 현재 마우스 위치를 전역 좌표로 가져옵니다
|
94
|
-
current_global_pos = event.globalPos()
|
95
|
-
|
96
|
-
# 화면 경계를 계산합니다
|
97
|
-
left_boundary = self.screen_geometry.left()
|
98
|
-
right_boundary = self.screen_geometry.right()
|
99
|
-
top_boundary = self.screen_geometry.top()
|
100
|
-
bottom_boundary = self.screen_geometry.bottom()
|
101
|
-
|
102
|
-
# 마우스 커서 위치를 제한합니다
|
103
|
-
new_cursor_pos = QPoint(
|
104
|
-
max(left_boundary, min(current_global_pos.x(), right_boundary)),
|
105
|
-
max(top_boundary, min(current_global_pos.y(), bottom_boundary)),
|
106
|
-
)
|
107
|
-
|
108
|
-
# 마우스 커서를 새 위치로 이동합니다
|
109
|
-
QCursor.setPos(new_cursor_pos)
|
110
|
-
|
111
|
-
# 창의 새 위치를 계산합니다
|
112
|
-
new_window_pos = new_cursor_pos - self.drag_relative_position
|
113
|
-
|
114
|
-
# 창을 새 위치로 이동합니다
|
115
|
-
self.parent._window.move(new_window_pos)
|
116
91
|
else:
|
117
92
|
# Change cursor based on resize direction
|
118
93
|
resize_direction = self.get_resize_direction(event.pos())
|
@@ -123,7 +98,6 @@ class CustomWebEngineView(QWebEngineView):
|
|
123
98
|
|
124
99
|
def mouse_release_event(self, event):
|
125
100
|
if event.button() == Qt.LeftButton:
|
126
|
-
self.is_dragging = False
|
127
101
|
self.is_resizing = False
|
128
102
|
self.resize_direction = None
|
129
103
|
self.unsetCursor()
|
@@ -277,48 +251,9 @@ class BrowserWindow:
|
|
277
251
|
self.set_size(self.width, self.height)
|
278
252
|
self.set_position(self.x, self.y)
|
279
253
|
|
280
|
-
# allow local file access to remote urls
|
281
|
-
self.web_view.settings().setAttribute(
|
282
|
-
QWebEngineSettings.WebAttribute.LocalContentCanAccessRemoteUrls, True
|
283
|
-
)
|
284
|
-
self.web_view.settings().setAttribute(
|
285
|
-
QWebEngineSettings.WebAttribute.ScreenCaptureEnabled, True
|
286
|
-
)
|
287
|
-
self.web_view.settings().setAttribute(
|
288
|
-
QWebEngineSettings.WebAttribute.AutoLoadImages, True
|
289
|
-
)
|
290
|
-
self.web_view.settings().setAttribute(
|
291
|
-
QWebEngineSettings.WebAttribute.JavascriptEnabled, True
|
292
|
-
)
|
293
|
-
self.web_view.settings().setAttribute(
|
294
|
-
QWebEngineSettings.WebAttribute.LocalStorageEnabled, True
|
295
|
-
)
|
254
|
+
# allow local file access to remote urls
|
296
255
|
self.web_view.settings().setAttribute(
|
297
|
-
QWebEngineSettings.
|
298
|
-
)
|
299
|
-
self.web_view.settings().setAttribute(
|
300
|
-
QWebEngineSettings.WebAttribute.AutoLoadIconsForPage, True
|
301
|
-
)
|
302
|
-
self.web_view.settings().setAttribute(
|
303
|
-
QWebEngineSettings.WebAttribute.ShowScrollBars, True
|
304
|
-
)
|
305
|
-
self.web_view.settings().setAttribute(
|
306
|
-
QWebEngineSettings.WebAttribute.DnsPrefetchEnabled, True
|
307
|
-
)
|
308
|
-
self.web_view.settings().setAttribute(
|
309
|
-
QWebEngineSettings.WebAttribute.PdfViewerEnabled, True
|
310
|
-
)
|
311
|
-
self.web_view.settings().setAttribute(
|
312
|
-
QWebEngineSettings.WebAttribute.FullScreenSupportEnabled, True
|
313
|
-
)
|
314
|
-
self.web_view.settings().setAttribute(
|
315
|
-
QWebEngineSettings.WebAttribute.JavascriptCanAccessClipboard, True
|
316
|
-
)
|
317
|
-
self.web_view.settings().setImageAnimationPolicy(
|
318
|
-
QWebEngineSettings.ImageAnimationPolicy.Allow
|
319
|
-
)
|
320
|
-
self.web_view.settings().setUnknownUrlSchemePolicy(
|
321
|
-
QWebEngineSettings.UnknownUrlSchemePolicy.AllowAllUnknownUrlSchemes
|
256
|
+
QWebEngineSettings.LocalContentCanAccessRemoteUrls, True
|
322
257
|
)
|
323
258
|
|
324
259
|
# Set icon
|
@@ -370,6 +305,7 @@ class BrowserWindow:
|
|
370
305
|
source = bytes(qwebchannel_js.readAll()).decode("utf-8")
|
371
306
|
self.web_view.page().runJavaScript(source)
|
372
307
|
qwebchannel_js.close()
|
308
|
+
|
373
309
|
|
374
310
|
js_code = """
|
375
311
|
if (typeof QWebChannel !== 'undefined') {
|
@@ -1731,7 +1667,7 @@ class BrowserWindow:
|
|
1731
1667
|
Examples
|
1732
1668
|
--------
|
1733
1669
|
```python
|
1734
|
-
window.set_web_engine_view_attribute(QWebEngineSettings.WebAttribute.
|
1670
|
+
window.set_web_engine_view_attribute(QWebEngineSettings.WebAttribute.JavascriptCanAccessClipboard, False)
|
1735
1671
|
```
|
1736
1672
|
"""
|
1737
1673
|
settings = self.web_view.settings()
|
@@ -1754,7 +1690,7 @@ class BrowserWindow:
|
|
1754
1690
|
Examples
|
1755
1691
|
--------
|
1756
1692
|
```python
|
1757
|
-
window.is_web_engine_view_attribute(QWebEngineSettings.WebAttribute.
|
1693
|
+
window.is_web_engine_view_attribute(QWebEngineSettings.WebAttribute.JavascriptCanAccessClipboard)
|
1758
1694
|
```
|
1759
1695
|
"""
|
1760
1696
|
settings = self.web_view.settings()
|
@@ -198,4 +198,4 @@ Apache License
|
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
200
|
See the License for the specific language governing permissions and
|
201
|
-
limitations under the License.
|
201
|
+
limitations under the License.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
pyloid/__init__.py,sha256=OOPhOKNQVmAM8hnfTeE7lHzxb8LsFNcgegBAvDrA-vY,293
|
2
2
|
pyloid/api.py,sha256=np0pFVUlen_GpN0svY0A3awY_ZjVFk-RpHQZZKFUMuo,2157
|
3
3
|
pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
4
|
-
pyloid/browser_window.py,sha256=
|
4
|
+
pyloid/browser_window.py,sha256=r372da5z69xIxXIDGTYt1bxlxGRwNQHRRF-AyysKaU0,57109
|
5
5
|
pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
|
6
6
|
pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
|
7
7
|
pyloid/js_api/event_api.py,sha256=_52yyBonqecmMvJpFW7OMNi_jX8Nrteqw_kI6r-DGG0,951
|
@@ -11,7 +11,7 @@ pyloid/pyloid.py,sha256=lctL2ZV3tCMUTQ8BEa4NgVb-3yVV_E8cXQXxFJrONI8,43919
|
|
11
11
|
pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
12
12
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
13
13
|
pyloid/utils.py,sha256=VGZE2liY8_AElEqxVe1YLbk3fWlcAevpRc6oOTTgi-U,1927
|
14
|
-
pyloid-0.16.
|
15
|
-
pyloid-0.16.
|
16
|
-
pyloid-0.16.
|
17
|
-
pyloid-0.16.
|
14
|
+
pyloid-0.16.10.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
15
|
+
pyloid-0.16.10.dist-info/METADATA,sha256=g9NgK88ubM0EHJT7NdQTveJdaRe18ID8A7ecj2YpuxI,3051
|
16
|
+
pyloid-0.16.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
17
|
+
pyloid-0.16.10.dist-info/RECORD,,
|
File without changes
|