Got the context menu and focusing working.

This commit is contained in:
The Wobbler 2025-01-27 18:02:06 +01:00
parent 60dee10d1a
commit b2aa7ffd8c
4 changed files with 51 additions and 4 deletions

View 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()