pyloid 0.16.9__py3-none-any.whl → 0.16.11__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,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
- self.is_dragging = True
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()
pyloid/monitor.py CHANGED
@@ -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
+
pyloid/pyloid.py CHANGED
@@ -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
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.16.9
3
+ Version: 0.16.11
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,17 +1,17 @@
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=t7d77lPZJesBuyc-LG4GYlxBuzLrfTls2p3qLifabEA,58233
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
8
8
  pyloid/js_api/window_api.py,sha256=_EAZ0GG0oa0EeIIyWnys03InLQuQfv4ZPezMouOJEGc,8155
9
- pyloid/monitor.py,sha256=nmcoOmlHeTysrZVT5mmL92ASbqMg8aH-hQg35qKWi0M,27540
10
- pyloid/pyloid.py,sha256=lctL2ZV3tCMUTQ8BEa4NgVb-3yVV_E8cXQXxFJrONI8,43919
9
+ pyloid/monitor.py,sha256=1mXvHm5deohnNlTLcRx4sT4x-stnOIb0dUQnnxN50Uo,28295
10
+ pyloid/pyloid.py,sha256=ar-3yP8IqB6HCWwuxJmjJZ9kekn7LhHqnNOTH-qhxpM,43925
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.9.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
15
- pyloid-0.16.9.dist-info/METADATA,sha256=gnt1wmXbU8d6MW5TviO3j5_Pgp0cghxClvX7klXVKOU,3050
16
- pyloid-0.16.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
- pyloid-0.16.9.dist-info/RECORD,,
14
+ pyloid-0.16.11.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
15
+ pyloid-0.16.11.dist-info/METADATA,sha256=VWQ196ZX2TYxekFHEZWaswkDTIzfVPzyqAybdRB6pSk,3051
16
+ pyloid-0.16.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
+ pyloid-0.16.11.dist-info/RECORD,,