Fix flickering when first marking a track as next
Pre-create the infotabs as adding the first one caused the flicker.
This commit is contained in:
parent
b3905e062d
commit
da8272b29b
@ -21,6 +21,14 @@ class InfoTabs(QTabWidget):
|
||||
# re-use the oldest one later)
|
||||
self.last_update: Dict[QWebEngineView, datetime] = {}
|
||||
self.tabtitles: Dict[int, str] = {}
|
||||
count = Config.MAX_INFO_TABS
|
||||
while count:
|
||||
widget = QWebEngineView()
|
||||
widget.setZoomFactor(Config.WEB_ZOOM_FACTOR)
|
||||
self.last_update[widget] = datetime.now()
|
||||
tab_index = self.addTab(widget, "")
|
||||
count -= 1
|
||||
|
||||
|
||||
def open_in_songfacts(self, title):
|
||||
"""Search Songfacts for title"""
|
||||
|
||||
@ -1637,7 +1637,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
# because it isn't quick
|
||||
if self.next_track.title:
|
||||
QTimer.singleShot(
|
||||
1,
|
||||
0,
|
||||
lambda: self.tabInfolist.open_in_wikipedia(
|
||||
self.next_track.title
|
||||
),
|
||||
|
||||
@ -363,6 +363,9 @@ padding-left: 8px;</string>
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabBarAutoHide">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'app/ui/main_window.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.5.1
|
||||
# Created by: PyQt6 UI code generator 6.5.2
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@ -183,6 +183,7 @@ class Ui_MainWindow(object):
|
||||
self.tabInfolist.setDocumentMode(False)
|
||||
self.tabInfolist.setTabsClosable(True)
|
||||
self.tabInfolist.setMovable(True)
|
||||
self.tabInfolist.setTabBarAutoHide(False)
|
||||
self.tabInfolist.setObjectName("tabInfolist")
|
||||
self.gridLayout_4.addWidget(self.splitter, 4, 0, 1, 1)
|
||||
self.InfoFooterFrame = QtWidgets.QFrame(parent=self.centralwidget)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user