Wobuzz/wobuzz/ui/track_control.py

34 lines
1.1 KiB
Python
Raw Normal View History

2024-12-20 18:02:59 +01:00
#!/usr/bin/python3
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QIcon
2024-12-23 16:02:22 +01:00
from PyQt6.QtWidgets import QToolBar, QLabel
from .track_progress_slider import TrackProgressSlider
2024-12-20 18:02:59 +01:00
class TrackControl(QToolBar):
def __init__(self, parent=None):
super().__init__(parent)
icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaSkipBackward)
self.previous_button = self.addAction(icon, "Previous")
icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStart)
self.toggle_play_button = self.addAction(icon, "Play/Pause")
icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStop)
self.stop_button = self.addAction(icon, "Stop")
icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaSkipForward)
self.next_button = self.addAction(icon, "Next")
self.progress_indicator = QLabel("0:00")
self.addWidget(self.progress_indicator)
self.track_progress_slider = TrackProgressSlider(Qt.Orientation.Horizontal, self)
2024-12-21 19:00:06 +01:00
self.addWidget(self.track_progress_slider)
2024-12-20 18:02:59 +01:00
self.track_length_indicator = QLabel("0:00")
self.addWidget(self.track_length_indicator)