forked from trav/lintunes
v0.72.1: the visualizer gets its own Preferences page, sized to the style shown
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"""LinTunes — iTunes-style music library manager and player for Linux."""
|
||||
|
||||
__version__ = "0.72.0"
|
||||
__version__ = "0.72.1"
|
||||
|
||||
@@ -7,7 +7,7 @@ from PyQt6.QtWidgets import (
|
||||
QFormLayout, QFontComboBox, QListWidget, QScrollArea, QSplitter,
|
||||
QStackedWidget, QWidget, QDialogButtonBox, QFrame, QToolButton,
|
||||
QColorDialog, QMenu, QDoubleSpinBox, QComboBox, QInputDialog,
|
||||
QMessageBox, QApplication,
|
||||
QMessageBox, QApplication, QSizePolicy,
|
||||
)
|
||||
from PyQt6.QtCore import Qt, QTimer
|
||||
from PyQt6.QtGui import QDoubleValidator, QFont, QColor, QFontInfo
|
||||
@@ -125,8 +125,8 @@ class PreferencesDialog(QDialog):
|
||||
for title, groups in (
|
||||
("General", general),
|
||||
("Appearance", [self._build_general_group(),
|
||||
self._build_visualizer_group(),
|
||||
self._build_colors_group()]),
|
||||
("Visualizer", [self._build_visualizer_group()]),
|
||||
("DJ", [self._build_dj_group()]),
|
||||
("Integrations", [self._build_lastfm_group(),
|
||||
self._build_acoustid_group(),
|
||||
@@ -694,13 +694,14 @@ class PreferencesDialog(QDialog):
|
||||
self._viz_pages.addWidget(kaleido)
|
||||
|
||||
self._viz_pages.setCurrentIndex(list(_VISUALIZER_STYLES).index(current))
|
||||
self._fit_viz_pages()
|
||||
column.addWidget(self._viz_pages)
|
||||
|
||||
# For every style: this machine's speakers' latency (config.json).
|
||||
form = QFormLayout()
|
||||
self._sync_slider = self._sync_delay_slider(form)
|
||||
column.addLayout(form)
|
||||
note = QLabel("Double-click the visualizer to see it big.")
|
||||
note = QLabel("Click the visualizer to see it big.")
|
||||
note.setEnabled(False)
|
||||
column.addWidget(note)
|
||||
return group
|
||||
@@ -947,8 +948,22 @@ class PreferencesDialog(QDialog):
|
||||
|
||||
def _on_viz_style(self, key: str):
|
||||
self._viz_pages.setCurrentIndex(list(_VISUALIZER_STYLES).index(key))
|
||||
self._fit_viz_pages()
|
||||
self._prefs.set("visualizer_style", key)
|
||||
|
||||
def _fit_viz_pages(self):
|
||||
"""A stack is as tall as its tallest page (the laser's), which left
|
||||
the other styles over a block of empty space; only the shown page
|
||||
counts toward its size."""
|
||||
stack = self._viz_pages
|
||||
for i in range(stack.count()):
|
||||
page = stack.widget(i)
|
||||
policy = (QSizePolicy.Policy.Preferred if i == stack.currentIndex()
|
||||
else QSizePolicy.Policy.Ignored)
|
||||
page.setSizePolicy(policy, policy)
|
||||
stack.currentWidget().adjustSize()
|
||||
stack.updateGeometry()
|
||||
|
||||
def _build_colors_group(self) -> QGroupBox:
|
||||
"""Light and dark each have a tint and a full set of grays; the
|
||||
Light | Dark switch picks which set the controls show and edit, and
|
||||
|
||||
Reference in New Issue
Block a user