Moved playlist tabs related widgets to its own files.
This commit is contained in:
parent
9d844ae2dd
commit
649ad1d647
5 changed files with 97 additions and 78 deletions
27
wobuzz/ui/playlist_tabs/tab_title.py
Normal file
27
wobuzz/ui/playlist_tabs/tab_title.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtGui import QMouseEvent
|
||||
from PyQt6.QtWidgets import QLineEdit
|
||||
|
||||
from .tab_bar import PlaylistTabBar
|
||||
|
||||
|
||||
class TabTitle(QLineEdit):
|
||||
def __init__(self, label, parent, index: int):
|
||||
super().__init__(label, parent)
|
||||
|
||||
self.tab_bar: PlaylistTabBar = parent
|
||||
self.index = index
|
||||
|
||||
self.setStyleSheet("QLineEdit {background: transparent;}")
|
||||
|
||||
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
|
||||
def mouseDoubleClickEvent(self, event: QMouseEvent):
|
||||
self.tab_bar.tabBarDoubleClicked.emit(self.index)
|
||||
|
||||
def mousePressEvent(self, event: QMouseEvent):
|
||||
self.tab_bar.tabBarClicked.emit(self.index)
|
||||
self.tab_bar.setCurrentIndex(self.index)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue