Update filename display logic and improve video editor behavior: increase filename length limit and adjust text rendering properties. Maintain project view when switching to video editor, enhancing user interface fluidity.

This commit is contained in:
2025-09-16 09:36:49 +02:00
parent 97e4a140eb
commit d235fa693e

View File

@@ -210,12 +210,12 @@ class ProjectView:
# Draw filename # Draw filename
filename = video_path.name filename = video_path.name
# Truncate if too long # Truncate if too long
if len(filename) > 20: if len(filename) > 25:
filename = filename[:17] + "..." filename = filename[:22] + "..."
text_y = progress_y + self.PROGRESS_BAR_HEIGHT + 20 text_y = progress_y + self.PROGRESS_BAR_HEIGHT + 20
cv2.putText(canvas, filename, (x, text_y), cv2.putText(canvas, filename, (x, text_y),
cv2.FONT_HERSHEY_SIMPLEX, 0.5, self.TEXT_COLOR, 1) cv2.FONT_HERSHEY_SIMPLEX, 0.6, self.TEXT_COLOR, 2)
# Draw progress percentage # Draw progress percentage
if video_path in self.progress_data: if video_path in self.progress_data:
@@ -1143,10 +1143,6 @@ class VideoEditor:
# Save current state before switching # Save current state before switching
self.save_state() self.save_state()
# Switch back to editor mode first
self.project_view_mode = False
self.project_view = None
# Find the video in our video_files list # Find the video in our video_files list
try: try:
video_index = self.video_files.index(video_path) video_index = self.video_files.index(video_path)
@@ -1167,9 +1163,10 @@ class VideoEditor:
print(f"Opened video: {video_path.name}") print(f"Opened video: {video_path.name}")
else: else:
print(f"Could not find video: {video_path.name}") print(f"Could not find video: {video_path.name}")
# Re-enable project view if we couldn't open the video return
self.project_view_mode = True
self.project_view = ProjectView(video_path.parent, self) # Keep project view open but switch focus to video editor
# Don't destroy the project view window - just let the user switch between them
def draw_feedback_message(self, frame): def draw_feedback_message(self, frame):
"""Draw feedback message on frame if visible""" """Draw feedback message on frame if visible"""