forked from Wobbl/Wobuzz
Made the playlist tabs look prettier by making the tab title editor non-static.
This commit is contained in:
parent
0101cf174c
commit
7ff1ad7a02
7 changed files with 46 additions and 84 deletions
|
@ -19,7 +19,6 @@ class PlaylistTabBar(QTabBar):
|
|||
|
||||
self.tabBarClicked.connect(self.on_click)
|
||||
self.tabBarDoubleClicked.connect(self.on_doubleclick)
|
||||
self.tabMoved.connect(self.on_tab_move)
|
||||
|
||||
def dragEnterEvent(self, event: QDragEnterEvent):
|
||||
index = self.tabAt(event.position().toPoint())
|
||||
|
@ -59,17 +58,7 @@ class PlaylistTabBar(QTabBar):
|
|||
if index == -1: # when no tab was clicked, do nothing
|
||||
return
|
||||
|
||||
title = self.tabButton(index, QTabBar.ButtonPosition.RightSide)
|
||||
playlist_view = self.tab_widget.widget(index)
|
||||
playlist = playlist_view.playlist
|
||||
|
||||
self.context_menu.exec(event.globalPos(), title)
|
||||
|
||||
def on_tab_move(self, i_from, i_to):
|
||||
title = self.tabButton(i_to, QTabBar.ButtonPosition.RightSide)
|
||||
|
||||
# update the index
|
||||
title.index = i_to
|
||||
|
||||
def update_title_indexes(self, after: int):
|
||||
for i in range(after, self.count()):
|
||||
title = self.tabButton(i, QTabBar.ButtonPosition.RightSide)
|
||||
title.index = i
|
||||
self.context_menu.exec(event.globalPos(), index, playlist)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue