Added "Track Control" gui.
This commit is contained in:
commit
b158a234fd
6 changed files with 91 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
__pycache__
|
||||
.idea/
|
10
wobuzz/gui.py
Normal file
10
wobuzz/gui.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from ui.main_window import MainWindow
|
||||
|
||||
|
||||
class GUI:
|
||||
def __init__(self):
|
||||
self.window = MainWindow()
|
||||
|
||||
self.window.show()
|
17
wobuzz/main.py
Normal file
17
wobuzz/main.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
from gui import GUI
|
||||
|
||||
|
||||
class Wobuzz:
|
||||
def __init__(self):
|
||||
self.qt_app = QApplication(sys.argv)
|
||||
|
||||
self.gui = GUI()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
wobuzz = Wobuzz()
|
||||
sys.exit(wobuzz.qt_app.exec())
|
17
wobuzz/ui/main_container.py
Normal file
17
wobuzz/ui/main_container.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtWidgets import QWidget, QGridLayout
|
||||
from ui.track_control import TrackControl
|
||||
|
||||
|
||||
class MainContainer(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.layout = QGridLayout()
|
||||
|
||||
self.track_control = TrackControl(self)
|
||||
self.layout.addWidget(self.track_control)
|
||||
|
||||
self.setLayout(self.layout)
|
||||
|
19
wobuzz/ui/main_window.py
Normal file
19
wobuzz/ui/main_window.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtWidgets import QMainWindow, QMenu
|
||||
from ui.main_container import MainContainer
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.setWindowTitle("WoBuzz")
|
||||
|
||||
self.menu_bar = self.menuBar()
|
||||
self.menu_bar.addMenu(QMenu("&File", self))
|
||||
|
||||
self.main_container = MainContainer(self)
|
||||
|
||||
self.setCentralWidget(self.main_container)
|
||||
|
26
wobuzz/ui/track_control.py
Normal file
26
wobuzz/ui/track_control.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtGui import QIcon
|
||||
from PyQt6.QtWidgets import QToolBar, QSlider, QStyle
|
||||
|
||||
|
||||
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.play_position_slider = QSlider(Qt.Orientation.Horizontal, self)
|
||||
self.addWidget(self.play_position_slider)
|
||||
|
Loading…
Add table
Reference in a new issue