Improved settings layout and deleted old file settings and behavior settings classes.
This commit is contained in:
parent
2b239e57f0
commit
829dc05c49
4 changed files with 13 additions and 48 deletions
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtWidgets import QWidget, QFormLayout, QCheckBox
|
||||
|
||||
|
||||
class BehaviourSettings(QWidget):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.layout = QFormLayout(self)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
self.load_on_start = QCheckBox(self)
|
||||
self.layout.addRow("Load playlists on start", self.load_on_start)
|
||||
|
||||
self.clear_track_cache = QCheckBox(self)
|
||||
self.layout.addRow("Clear track cache immediately when finished", self.clear_track_cache)
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtGui import QPalette
|
||||
from PyQt6.QtWidgets import QWidget, QLineEdit, QFormLayout
|
||||
|
||||
|
||||
class FileSettings(QWidget):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.layout = QFormLayout(self)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
self.library_path_input = QLineEdit(self)
|
||||
|
||||
self.layout.addRow("Library Path:", self.library_path_input)
|
||||
|
|
@ -40,7 +40,7 @@ class Settings(QDockWidget):
|
|||
|
||||
self.file_settings = Category()
|
||||
|
||||
self.file_settings.paths = SubCategory("Paths", "Path related settings")
|
||||
self.file_settings.paths = SubCategory("Paths")
|
||||
self.file_settings.add_sub_category(self.file_settings.paths)
|
||||
|
||||
self.file_settings.paths.library_path_input = QLineEdit()
|
||||
|
@ -50,13 +50,13 @@ class Settings(QDockWidget):
|
|||
|
||||
self.behavior_settings = Category()
|
||||
|
||||
self.behavior_settings.playlist = SubCategory("Playlist", "Playlist behavior")
|
||||
self.behavior_settings.playlist = SubCategory("Playlist",)
|
||||
self.behavior_settings.add_sub_category(self.behavior_settings.playlist)
|
||||
|
||||
self.behavior_settings.playlist.load_on_start = QCheckBox()
|
||||
self.behavior_settings.playlist.add_setting("Load on start:", self.behavior_settings.playlist.load_on_start)
|
||||
|
||||
self.behavior_settings.track = SubCategory("Track", "Track behavior")
|
||||
self.behavior_settings.track = SubCategory("Track",)
|
||||
self.behavior_settings.add_sub_category(self.behavior_settings.track)
|
||||
|
||||
self.behavior_settings.track.clear_cache = QCheckBox()
|
||||
|
@ -70,10 +70,7 @@ class Settings(QDockWidget):
|
|||
|
||||
self.appearance_settings = Category()
|
||||
|
||||
self.appearance_settings.track_info = SubCategory(
|
||||
"Track Info",
|
||||
"Settings related to the appearance of the track info bar"
|
||||
)
|
||||
self.appearance_settings.track_info = SubCategory("Track Info")
|
||||
self.appearance_settings.add_sub_category(self.appearance_settings.track_info)
|
||||
|
||||
self.appearance_settings.track_info.cover_size = QSpinBox()
|
||||
|
@ -94,7 +91,7 @@ class Settings(QDockWidget):
|
|||
# self.performance_settings.memory = SubCategory("Memory", "Memory related settings")
|
||||
# self.performance_settings.add_sub_category(self.performance_settings.memory)
|
||||
|
||||
self.performance_settings.cpu = SubCategory("CPU", "CPU related settings")
|
||||
self.performance_settings.cpu = SubCategory("CPU",)
|
||||
self.performance_settings.add_sub_category(self.performance_settings.cpu)
|
||||
|
||||
self.performance_settings.cpu.gui_update_rate = QSpinBox()
|
||||
|
@ -105,8 +102,9 @@ class Settings(QDockWidget):
|
|||
self.performance_settings.cpu.add_setting(
|
||||
"GUI update rate:",
|
||||
self.performance_settings.cpu.gui_update_rate,
|
||||
"The rate at which gui-elements like the track-progress-slider get updated. Values above 20 "
|
||||
"don't really make sense on most monitors. Decreasing this value will reduce the CPU usage."
|
||||
"The rate at which gui-elements like the track-progress-slider get updated.\n"
|
||||
"Values above 20 don't really make sense for most monitors.\n"
|
||||
"Decreasing this value will reduce the CPU usage."
|
||||
)
|
||||
|
||||
self.tabs.addTab(self.performance_settings, "Performance")
|
||||
|
|
|
@ -9,7 +9,7 @@ class SubCategory(QGroupBox):
|
|||
description_font = QFont()
|
||||
description_font.setPointSize(8)
|
||||
|
||||
def __init__(self, title: str, description: str, parent=None):
|
||||
def __init__(self, title: str, description: str=None, parent=None):
|
||||
super().__init__(title, parent)
|
||||
|
||||
self.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed)
|
||||
|
@ -20,14 +20,15 @@ class SubCategory(QGroupBox):
|
|||
self.layout = QFormLayout()
|
||||
self.setLayout(self.layout)
|
||||
|
||||
self.description = QLabel(description + "\n", self)
|
||||
self.layout.addRow(self.description)
|
||||
if description is not None:
|
||||
self.description = QLabel(description + "\n", self)
|
||||
self.layout.addRow(self.description)
|
||||
|
||||
def add_setting(self, text: str, setting, description: str=None):
|
||||
self.layout.addRow(text, setting)
|
||||
|
||||
if description is not None:
|
||||
description_label = QLabel(" " + description)
|
||||
description_label = QLabel(" " + description.replace("\n", "\n "))
|
||||
description_label.setFont(self.description_font)
|
||||
self.layout.addRow(description_label)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue