pyloid 0.23.19__tar.gz → 0.24.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyloid
3
- Version: 0.23.19
3
+ Version: 0.24.0
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.23.19"
3
+ version = "0.24.0"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -316,8 +316,7 @@ class _BrowserWindow:
316
316
  self.id = str(uuid.uuid4()) # Generate unique ID
317
317
  self._window = QMainWindow()
318
318
  self.web_view = CustomWebEngineView(self)
319
-
320
-
319
+
321
320
  if rpc:
322
321
  self.rpc = rpc
323
322
  self.rpc_url = rpc.url
@@ -350,27 +349,26 @@ class _BrowserWindow:
350
349
  self.shortcuts = {}
351
350
  self.close_on_load = True
352
351
  self.splash_screen = None
353
- ###########################################################################################
352
+ ###########################################################################################
354
353
  # RPC 서버가 없으면 추가하지 않음
355
354
  if not self.rpc:
356
- return;
357
-
355
+ return
356
+
358
357
  self.rpc.pyloid = self.app.pyloid_wrapper
359
358
  # self.rpc.window = self.window_wrapper
360
-
359
+
361
360
  # RPC 서버 중복 방지
362
361
  if self.rpc in self.app.rpc_servers:
363
- return;
364
-
362
+ return
363
+
365
364
  # RPC 서버 추가
366
365
  self.app.rpc_servers.add(self.rpc)
367
-
366
+
368
367
  # Start unique RPC servers
369
368
  server_thread = threading.Thread(target=self.rpc.start, daemon=True)
370
369
  server_thread.start()
371
- ###########################################################################################
370
+ ###########################################################################################
372
371
 
373
-
374
372
  def _set_custom_frame(
375
373
  self,
376
374
  use_custom: bool,
@@ -487,6 +485,9 @@ class _BrowserWindow:
487
485
  # Remove title bar and borders (if needed)
488
486
  if not self.frame:
489
487
  self._window.setWindowFlags(Qt.FramelessWindowHint)
488
+ self._window.setAttribute(Qt.WA_TranslucentBackground)
489
+ self.web_view.setAttribute(Qt.WA_TranslucentBackground)
490
+ self.web_view.page().setBackgroundColor(Qt.transparent)
490
491
 
491
492
  # Disable default context menu
492
493
  if not self.context_menu:
@@ -810,6 +811,9 @@ class _BrowserWindow:
810
811
  self._window.setWindowFlags(Qt.Window)
811
812
  else:
812
813
  self._window.setWindowFlags(Qt.FramelessWindowHint)
814
+ self._window.setAttribute(Qt.WA_TranslucentBackground)
815
+ self.web_view.setAttribute(Qt.WA_TranslucentBackground)
816
+ self.web_view.page().setBackgroundColor(Qt.transparent)
813
817
  if was_visible:
814
818
  self._window.show()
815
819
 
@@ -897,7 +901,7 @@ class _BrowserWindow:
897
901
  def _remove_from_app_windows(self):
898
902
  """Removes the window from the app's window list."""
899
903
  self.app.windows_dict.pop(self.id)
900
-
904
+
901
905
  if not self.app.windows_dict:
902
906
  self.app.quit() # Quit the app if all windows are closed
903
907
 
@@ -960,14 +964,14 @@ class _BrowserWindow:
960
964
  self._window.show()
961
965
  self._window.raise_()
962
966
  self._window.activateWindow()
963
-
967
+
964
968
  # was_on_top = bool(self._window.windowFlags() & Qt.WindowStaysOnTopHint)
965
969
  # if not was_on_top:
966
970
  # self._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
967
971
  # self._window.show()
968
-
972
+
969
973
  # self._window.activateWindow()
970
-
974
+
971
975
  # if not was_on_top:
972
976
  # self._window.setWindowFlag(Qt.WindowStaysOnTopHint, False)
973
977
  # self._window.show()
@@ -93,13 +93,6 @@ def custom_message_handler(mode, context, message):
93
93
 
94
94
  qInstallMessageHandler(custom_message_handler)
95
95
 
96
-
97
- class _WindowController(QObject):
98
- create_window_signal = Signal(
99
- QApplication, str, int, int, int, int, bool, bool, bool, PyloidRPC
100
- )
101
-
102
-
103
96
  # Only Work in Main Thread
104
97
  class _Pyloid(QApplication):
105
98
  def __init__(
@@ -151,10 +144,7 @@ class _Pyloid(QApplication):
151
144
  if self.single_instance:
152
145
  self._init_single_instance()
153
146
 
154
- self.controller = _WindowController()
155
- self.controller.create_window_signal.connect(
156
- self._create_window_signal_function
157
- )
147
+
158
148
 
159
149
  self.file_watcher = FileWatcher()
160
150
 
@@ -289,38 +279,8 @@ class _Pyloid(QApplication):
289
279
  >>> window = app.create_window(title="New Window", width=1024, height=768)
290
280
  >>> window.show()
291
281
  """
292
- self.controller.create_window_signal.emit(
293
- self,
294
- title,
295
- width,
296
- height,
297
- x,
298
- y,
299
- frame,
300
- context_menu,
301
- dev_tools,
302
- rpc,
303
- )
304
- latest_window_id = list(self.windows_dict.keys())[-1]
305
- return self.windows_dict[latest_window_id]
306
-
307
- def _create_window_signal_function(
308
- self,
309
- app,
310
- title: str,
311
- width: int,
312
- height: int,
313
- x: int,
314
- y: int,
315
- frame: bool,
316
- context_menu: bool,
317
- dev_tools: bool,
318
- # js_apis: List[PyloidAPI] = [],
319
- rpc: Optional[PyloidRPC] = None,
320
- ) -> BrowserWindow:
321
- """Function to create a new browser window."""
322
282
  window = BrowserWindow(
323
- app,
283
+ self,
324
284
  title,
325
285
  width,
326
286
  height,
@@ -332,6 +292,7 @@ class _Pyloid(QApplication):
332
292
  rpc,
333
293
  )
334
294
  self.windows_dict[window._window.id] = window
295
+ # latest_window_id = list(self.windows_dict.keys())[-1]
335
296
  return window
336
297
 
337
298
  def run(self):
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