Got the context menu and focusing working.
This commit is contained in:
parent
60dee10d1a
commit
b2aa7ffd8c
4 changed files with 51 additions and 4 deletions
29
wobuzz/ui/playlist_tabs/tab_context_menu.py
Normal file
29
wobuzz/ui/playlist_tabs/tab_context_menu.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtCore import QPoint
|
||||
from PyQt6.QtGui import QAction
|
||||
from PyQt6.QtWidgets import QMenu, QTabBar
|
||||
|
||||
|
||||
class PlaylistContextMenu(QMenu):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.tab_bar: QTabBar = parent
|
||||
|
||||
self.playlist_title = None
|
||||
|
||||
self.rename_action = QAction("Rename")
|
||||
|
||||
self.addAction(self.rename_action)
|
||||
|
||||
self.rename_action.triggered.connect(self.rename)
|
||||
|
||||
def exec(self, pos: QPoint, title):
|
||||
self.playlist_title = title
|
||||
|
||||
super().exec(pos)
|
||||
|
||||
def rename(self):
|
||||
self.playlist_title.setFocus()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue