pyloid 0.16.1__py3-none-any.whl → 0.16.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/browser_window.py
CHANGED
@@ -24,6 +24,7 @@ from .custom.titlebar import CustomTitleBar
|
|
24
24
|
from .js_api.window_api import WindowAPI
|
25
25
|
from PySide6.QtGui import QPixmap, QMovie
|
26
26
|
from PySide6.QtWidgets import QSplashScreen, QLabel
|
27
|
+
from PySide6.QtCore import QSize
|
27
28
|
|
28
29
|
|
29
30
|
# 어차피 load 부분에만 쓰이니까 나중에 분리해서 load 위에서 선언하자.
|
@@ -1395,6 +1396,7 @@ class BrowserWindow:
|
|
1395
1396
|
close_on_load: bool = True,
|
1396
1397
|
stay_on_top: bool = True,
|
1397
1398
|
clickable: bool = True,
|
1399
|
+
position: str = "center",
|
1398
1400
|
):
|
1399
1401
|
"""
|
1400
1402
|
Sets the static image splash screen of the window.
|
@@ -1410,6 +1412,8 @@ class BrowserWindow:
|
|
1410
1412
|
clickable : bool, optional
|
1411
1413
|
True to make the splash screen clickable, False otherwise (default is True)
|
1412
1414
|
if clickable is True, you can click the splash screen to close it.
|
1415
|
+
position : str, optional
|
1416
|
+
Position of the splash screen. Options are 'center', 'top-left', 'top-right', 'bottom-left', 'bottom-right' (default is 'center')
|
1413
1417
|
|
1414
1418
|
Examples
|
1415
1419
|
--------
|
@@ -1435,6 +1439,7 @@ class BrowserWindow:
|
|
1435
1439
|
|
1436
1440
|
self.close_on_load = close_on_load
|
1437
1441
|
self.splash_screen = splash
|
1442
|
+
self._position_splash_screen(position)
|
1438
1443
|
self.splash_screen.show()
|
1439
1444
|
|
1440
1445
|
def set_gif_splash_screen(
|
@@ -1443,6 +1448,7 @@ class BrowserWindow:
|
|
1443
1448
|
close_on_load: bool = True,
|
1444
1449
|
stay_on_top: bool = True,
|
1445
1450
|
clickable: bool = True,
|
1451
|
+
position: str = "center",
|
1446
1452
|
):
|
1447
1453
|
"""
|
1448
1454
|
Sets the gif splash screen of the window.
|
@@ -1458,6 +1464,8 @@ class BrowserWindow:
|
|
1458
1464
|
clickable : bool, optional
|
1459
1465
|
True to make the splash screen clickable, False otherwise (default is True)
|
1460
1466
|
if clickable is True, you can click the splash screen to close it.
|
1467
|
+
position : str, optional
|
1468
|
+
Position of the splash screen. Options are 'center', 'top-left', 'top-right', 'bottom-left', 'bottom-right' (default is 'center')
|
1461
1469
|
|
1462
1470
|
Examples
|
1463
1471
|
--------
|
@@ -1490,17 +1498,45 @@ class BrowserWindow:
|
|
1490
1498
|
movie = QMovie(gif_path)
|
1491
1499
|
label.setMovie(movie)
|
1492
1500
|
|
1493
|
-
# Start animation and show splash screen
|
1494
|
-
movie.start()
|
1495
|
-
splash.show()
|
1496
|
-
|
1497
1501
|
# Adjust splash screen size to match GIF size
|
1498
1502
|
movie.frameChanged.connect(
|
1499
1503
|
lambda: splash.setFixedSize(movie.currentPixmap().size())
|
1500
1504
|
)
|
1501
1505
|
|
1506
|
+
# Start animation and show splash screen
|
1507
|
+
movie.start()
|
1502
1508
|
self.close_on_load = close_on_load
|
1503
1509
|
self.splash_screen = splash
|
1510
|
+
self._position_splash_screen(position)
|
1511
|
+
splash.show()
|
1512
|
+
|
1513
|
+
def _position_splash_screen(self, position: str):
|
1514
|
+
if not self.splash_screen:
|
1515
|
+
return
|
1516
|
+
|
1517
|
+
screen = self.app.primaryScreen().geometry()
|
1518
|
+
splash_size = self.splash_screen.size()
|
1519
|
+
|
1520
|
+
if position == "center":
|
1521
|
+
new_position = screen.center() - QPoint(
|
1522
|
+
splash_size.width() // 2, splash_size.height() // 2
|
1523
|
+
)
|
1524
|
+
elif position == "top-left":
|
1525
|
+
new_position = screen.topLeft()
|
1526
|
+
elif position == "top-right":
|
1527
|
+
new_position = screen.topRight() - QPoint(splash_size.width(), 0)
|
1528
|
+
elif position == "bottom-left":
|
1529
|
+
new_position = screen.bottomLeft() - QPoint(0, splash_size.height())
|
1530
|
+
elif position == "bottom-right":
|
1531
|
+
new_position = screen.bottomRight() - QPoint(
|
1532
|
+
splash_size.width(), splash_size.height()
|
1533
|
+
)
|
1534
|
+
else:
|
1535
|
+
new_position = screen.center() - QPoint(
|
1536
|
+
splash_size.width() // 2, splash_size.height() // 2
|
1537
|
+
)
|
1538
|
+
|
1539
|
+
self.splash_screen.move(new_position)
|
1504
1540
|
|
1505
1541
|
def close_splash_screen(self):
|
1506
1542
|
"""
|
@@ -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=oX0FfQSFLVtTohI91QN2PR8EkwhY12qtcxWb0tknHrs,49771
|
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=3YymePkpM_hKPzvHSSgELuSHkmbDsKW60HnRwwBMY7A,41178
|
|
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.2.dist-info/LICENSE,sha256=MTYF-6xpRekyTUglRweWtbfbwBL1I_3Bgfbm_SNOuI8,11525
|
15
|
+
pyloid-0.16.2.dist-info/METADATA,sha256=jkiAeck5XT9NawztFM4196igCb15YUVNYGezF-xq-g0,3050
|
16
|
+
pyloid-0.16.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
17
|
+
pyloid-0.16.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|