Bedre sync
This commit is contained in:
@@ -668,12 +668,26 @@ class PlaylistPanel(QWidget):
|
||||
|
||||
from ui.playlist_info_dialog import PlaylistInfoWindow
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
from PyQt6.QtCore import QSettings
|
||||
main = self.window()
|
||||
self._info_window = PlaylistInfoWindow(self, parent=main)
|
||||
QApplication.instance().aboutToQuit.connect(self._info_window.close)
|
||||
if main:
|
||||
|
||||
# Gendan gemt position eller placer ved siden af hovedvindue
|
||||
s = QSettings("LineDance", "Player")
|
||||
pos = s.value("window/info_pos")
|
||||
if pos:
|
||||
self._info_window.move(pos)
|
||||
elif main:
|
||||
geo = main.geometry()
|
||||
self._info_window.move(geo.right() + 10, geo.top() + 100)
|
||||
self._info_window.move(geo.right() + 10, geo.top())
|
||||
|
||||
# Sikr at vinduet er på skærmen
|
||||
screen = QApplication.primaryScreen().availableGeometry()
|
||||
w_geo = self._info_window.frameGeometry()
|
||||
x = max(0, min(w_geo.x(), screen.right() - w_geo.width()))
|
||||
y = max(0, min(w_geo.y(), screen.bottom() - w_geo.height()))
|
||||
self._info_window.move(x, y)
|
||||
self._info_window.show()
|
||||
|
||||
def _change_dance(self, idx: int, song: dict):
|
||||
|
||||
Reference in New Issue
Block a user