Skip to content

Commit 9ff9946

Browse files
committed
Fix detection of tutorial widget positions and don't show tutorial dock until after window is shown.
1 parent 0a2be85 commit 9ff9946

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/windows/main_window.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,7 @@ def actionTutorial_trigger(self):
25062506
if self.tutorial_manager:
25072507
self.tutorial_manager.exit_manager()
25082508
self.tutorial_manager = TutorialManager(self)
2509+
self.tutorial_manager.process_visibility()
25092510

25102511
def actionInsertTimestamp_trigger(self, event):
25112512
"""Insert the current timestamp into the caption editor
@@ -3848,4 +3849,3 @@ def __init__(self, *args):
38483849

38493850
# Init all Keyboard shortcuts
38503851
self.initShortcuts()
3851-

src/windows/views/tutorial.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,15 @@ def get_object(self, object_id):
276276
elif object_id == "actionPlay":
277277
# Find play/pause button on transport controls toolbar
278278
for w in self.win.actionPlay.associatedWidgets():
279-
if isinstance(w, QToolButton):
279+
if isinstance(w, QToolButton) and w.isVisible():
280+
return w
281+
for w in self.win.actionPause.associatedWidgets():
282+
if isinstance(w, QToolButton) and w.isVisible():
280283
return w
281284
elif object_id == "export_button":
282285
# Find export toolbar button on main window
283-
for w in self.win.actionExportVideo.associatedWidgets():
284-
if isinstance(w, QToolButton):
286+
for w in reversed(self.win.actionExportVideo.associatedWidgets()):
287+
if isinstance(w, QToolButton) and w.isVisible() and w.parent() == self.win.toolBar:
285288
return w
286289

287290
def next_tip(self, tid):
@@ -374,7 +377,8 @@ def re_position_dialog(self):
374377

375378
def process_visibility(self):
376379
"""Handle callbacks when widget visibility changes"""
377-
self.tutorial_timer.start()
380+
if self.tutorial_enabled:
381+
self.tutorial_timer.start()
378382

379383
def __init__(self, win, *args):
380384
# Init QObject superclass
@@ -481,7 +485,3 @@ def __init__(self, win, *args):
481485
self.win.dockProperties.visibilityChanged.connect(self.process_visibility)
482486
self.win.dockVideo.visibilityChanged.connect(self.process_visibility)
483487
self.win.dockEmojis.visibilityChanged.connect(self.process_visibility)
484-
485-
# Process tutorials (1 by 1)
486-
if self.tutorial_enabled:
487-
self.process_visibility()

0 commit comments

Comments
 (0)