pyloid 0.12.0__py3-none-any.whl → 0.12.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyloid/pyloid.py
CHANGED
@@ -15,6 +15,7 @@ from PySide6.QtGui import (
|
|
15
15
|
QClipboard,
|
16
16
|
QImage,
|
17
17
|
QAction,
|
18
|
+
QCursor,
|
18
19
|
)
|
19
20
|
from PySide6.QtCore import Qt, Signal, QPoint, QUrl, QObject, QTimer, QSize, QEvent
|
20
21
|
from PySide6.QtNetwork import QLocalServer, QLocalSocket
|
@@ -261,6 +262,7 @@ class CustomWebEngineView(QWebEngineView):
|
|
261
262
|
self.parent = parent
|
262
263
|
self.drag_relative_position = None
|
263
264
|
self.is_dragging = False
|
265
|
+
self.screen_geometry = self.screen().availableGeometry()
|
264
266
|
|
265
267
|
def mouse_press_event(self, event):
|
266
268
|
if event.button() == Qt.LeftButton:
|
@@ -273,8 +275,25 @@ class CustomWebEngineView(QWebEngineView):
|
|
273
275
|
if not self.parent.frame and self.is_dragging:
|
274
276
|
# 현재 마우스 위치를 전역 좌표로 가져옵니다
|
275
277
|
current_global_pos = event.globalPos()
|
276
|
-
|
277
|
-
|
278
|
+
|
279
|
+
# 화면 경계를 계산합니다
|
280
|
+
left_boundary = self.screen_geometry.left()
|
281
|
+
right_boundary = self.screen_geometry.right()
|
282
|
+
top_boundary = self.screen_geometry.top()
|
283
|
+
bottom_boundary = self.screen_geometry.bottom()
|
284
|
+
|
285
|
+
# 마우스 커서 위치를 제한합니다
|
286
|
+
new_cursor_pos = QPoint(
|
287
|
+
max(left_boundary, min(current_global_pos.x(), right_boundary)),
|
288
|
+
max(top_boundary, min(current_global_pos.y(), bottom_boundary)),
|
289
|
+
)
|
290
|
+
|
291
|
+
# 마우스 커서를 새 위치로 이동합니다
|
292
|
+
QCursor.setPos(new_cursor_pos)
|
293
|
+
|
294
|
+
# 창의 새 위치를 계산합니다
|
295
|
+
new_window_pos = new_cursor_pos - self.drag_relative_position
|
296
|
+
|
278
297
|
# 창을 새 위치로 이동합니다
|
279
298
|
self.parent._window.move(new_window_pos)
|
280
299
|
|
@@ -283,12 +302,13 @@ class CustomWebEngineView(QWebEngineView):
|
|
283
302
|
self.is_dragging = False
|
284
303
|
|
285
304
|
def eventFilter(self, source, event):
|
286
|
-
if self.focusProxy() is source
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
305
|
+
if self.focusProxy() is source:
|
306
|
+
if event.type() == QEvent.MouseButtonPress:
|
307
|
+
self.mouse_press_event(event)
|
308
|
+
elif event.type() == QEvent.MouseMove:
|
309
|
+
self.mouse_move_event(event)
|
310
|
+
elif event.type() == QEvent.MouseButtonRelease:
|
311
|
+
self.mouse_release_event(event)
|
292
312
|
return super().eventFilter(source, event)
|
293
313
|
|
294
314
|
|
@@ -740,7 +760,7 @@ class BrowserWindow:
|
|
740
760
|
return self._window.isVisible()
|
741
761
|
|
742
762
|
def set_resizable(self, resizable: bool):
|
743
|
-
"""
|
763
|
+
"""Sets the resizability of the window."""
|
744
764
|
self.resizable = resizable
|
745
765
|
if resizable:
|
746
766
|
self._window.setWindowFlags(
|
@@ -878,14 +898,14 @@ class Pyloid(QApplication):
|
|
878
898
|
def _init_single_instance(self):
|
879
899
|
"""Initializes the application as a single instance."""
|
880
900
|
socket = QLocalSocket()
|
881
|
-
socket.connectToServer(
|
901
|
+
socket.connectToServer(self.app_name)
|
882
902
|
if socket.waitForConnected(500):
|
883
903
|
# Another instance is already running
|
884
904
|
sys.exit(1)
|
885
905
|
|
886
906
|
# Create a new server
|
887
907
|
self.server = QLocalServer()
|
888
|
-
self.server.listen(
|
908
|
+
self.server.listen(self.app_name)
|
889
909
|
self.server.newConnection.connect(self._handle_new_connection)
|
890
910
|
|
891
911
|
def _handle_new_connection(self):
|
@@ -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.
|
@@ -4,11 +4,11 @@ pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
|
4
4
|
pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
|
5
5
|
pyloid/filewatcher.py,sha256=n8N56D65le5TpsgxXb7z-FO_0lqv4UYD4yGq_UuMrAs,1285
|
6
6
|
pyloid/monitor.py,sha256=fqDnZ_7dpxVZLVJ5gCluDRY2USrQ5YL_fw1AnYivhsk,12741
|
7
|
-
pyloid/pyloid.py,sha256=
|
7
|
+
pyloid/pyloid.py,sha256=Q6M2HyV7M8-DrRwSNtQu1Rxbm_tSyVEMsb3euIQ383g,48889
|
8
8
|
pyloid/timer.py,sha256=1bYhqte3rV77vaeMUkcTgmx2ux7FtCqLCx9lIC2-COg,4360
|
9
9
|
pyloid/tray.py,sha256=rXgdkvzGxtie_EIcTSA7fjuta4nJk5THhNkGFcfv5Ew,634
|
10
10
|
pyloid/utils.py,sha256=DQerZWU_0o8dHcJ5y3yXf9i5OXn7KQZqU-hVBq3uPUA,711
|
11
|
-
pyloid-0.12.
|
12
|
-
pyloid-0.12.
|
13
|
-
pyloid-0.12.
|
14
|
-
pyloid-0.12.
|
11
|
+
pyloid-0.12.2.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
12
|
+
pyloid-0.12.2.dist-info/METADATA,sha256=oS4sC1P8_eLHtxOLy2rg3vwTx8ViyDnA2AhhGPPx_Po,6069
|
13
|
+
pyloid-0.12.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
14
|
+
pyloid-0.12.2.dist-info/RECORD,,
|
File without changes
|