pyloid 0.16.9__tar.gz → 0.16.10__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyloid-0.16.9 → pyloid-0.16.10}/PKG-INFO +1 -1
- {pyloid-0.16.9 → pyloid-0.16.10}/pyproject.toml +1 -1
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/browser_window.py +5 -31
- {pyloid-0.16.9 → pyloid-0.16.10}/LICENSE +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/README.md +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/__init__.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/api.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/autostart.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/custom/titlebar.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/filewatcher.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/js_api/event_api.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/js_api/window_api.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/monitor.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/pyloid.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/timer.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/tray.py +0 -0
- {pyloid-0.16.9 → pyloid-0.16.10}/src/pyloid/utils.py +0 -0
@@ -58,16 +58,14 @@ 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
|
@@ -76,7 +74,6 @@ class CustomWebEngineView(QWebEngineView):
|
|
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()
|
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
|
File without changes
|
File without changes
|