From e84d2c993483df043c11fa255a6cfe9cec2f44dd Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Wed, 20 Aug 2025 18:54:47 -0700 Subject: [PATCH] fix playlist details modal spacing --- ui/pages/sync.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/ui/pages/sync.py b/ui/pages/sync.py index 0799296..9fa69f1 100644 --- a/ui/pages/sync.py +++ b/ui/pages/sync.py @@ -1131,7 +1131,17 @@ class PlaylistDetailsModal(QDialog): def setup_ui(self): self.setWindowTitle(f"Playlist Details - {self.playlist.name}") - self.setFixedSize(1200, 800) + + # Make modal responsive to screen size + from PyQt6.QtWidgets import QApplication + screen = QApplication.primaryScreen().geometry() + modal_width = min(1200, int(screen.width() * 0.9)) + modal_height = min(800, int(screen.height() * 0.9)) + self.resize(modal_width, modal_height) + + # Center the modal on screen + self.move((screen.width() - modal_width) // 2, (screen.height() - modal_height) // 2) + self.setStyleSheet(""" QDialog { background: #191414; @@ -1140,22 +1150,22 @@ class PlaylistDetailsModal(QDialog): """) main_layout = QVBoxLayout(self) - main_layout.setContentsMargins(32, 32, 32, 32) - main_layout.setSpacing(24) + main_layout.setContentsMargins(20, 20, 20, 20) # Reduced margins for smaller screens + main_layout.setSpacing(16) - # Header section + # Header section (fixed height) header = self.create_header() - main_layout.addWidget(header) + main_layout.addWidget(header, 0) # stretch factor 0 - fixed size - # Track list section + # Track list section (expandable) track_list = self.create_track_list() - main_layout.addWidget(track_list) + main_layout.addWidget(track_list, 1) # stretch factor 1 - takes available space - # Button section + # Button section (fixed height, always visible) button_widget = QWidget() button_layout = self.create_buttons() button_widget.setLayout(button_layout) - main_layout.addWidget(button_widget) + main_layout.addWidget(button_widget, 0) # stretch factor 0 - fixed size def create_header(self): header = QFrame()