Compare commits
2 Commits
60b9d4038b
...
d589700d7a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d589700d7a | ||
|
|
76b89dc412 |
2165
video_editor (3).py
Normal file
2165
video_editor (3).py
Normal file
File diff suppressed because it is too large
Load Diff
@ -239,8 +239,8 @@ class ShortsEditorGUI:
|
||||
# If parent exists, create as child window; otherwise create root window
|
||||
self.editor_window = tk.Toplevel(self.parent) if self.parent else tk.Tk()
|
||||
self.editor_window.title("Professional Shorts Editor")
|
||||
self.editor_window.geometry("1200x800") # Optimal size for video editing
|
||||
self.editor_window.minsize(900, 600) # Minimum usable size
|
||||
self.editor_window.geometry("1200x900") # Increased height for Audio 2 visibility
|
||||
self.editor_window.minsize(900, 700) # Increased minimum size
|
||||
self.editor_window.configure(bg=self.colors['bg_primary']) # Apply dark theme
|
||||
|
||||
# Configure responsive layout for window resizing
|
||||
@ -340,14 +340,14 @@ class ShortsEditorGUI:
|
||||
# Professional Timeline Workspace - Multi-track editing environment
|
||||
# Fixed height prevents timeline from shrinking when window is resized
|
||||
# This is where users perform the majority of their editing work
|
||||
timeline_workspace = tk.Frame(player_frame, bg=self.colors['bg_secondary'], height=380)
|
||||
timeline_workspace = tk.Frame(player_frame, bg=self.colors['bg_secondary'], height=480)
|
||||
timeline_workspace.grid(row=1, column=0, sticky="ew", padx=15, pady=(0, 15))
|
||||
timeline_workspace.pack_propagate(False) # Maintain fixed height for consistent layout
|
||||
|
||||
# Timeline header - contains editing mode controls and timeline options
|
||||
# These controls affect how the user interacts with timeline elements
|
||||
header_frame = tk.Frame(timeline_workspace, bg=self.colors['bg_secondary'])
|
||||
header_frame.pack(fill="x", pady=(10, 5))
|
||||
header_frame.pack(fill="x", pady=(5, 5))
|
||||
|
||||
# Left side timeline controls - editing modes and interaction options
|
||||
left_controls = tk.Frame(header_frame, bg=self.colors['bg_secondary'])
|
||||
@ -450,19 +450,24 @@ class ShortsEditorGUI:
|
||||
canvas_frame = tk.Frame(timeline_container, bg=self.colors['bg_tertiary'])
|
||||
canvas_frame.pack(side="right", fill="both", expand=True)
|
||||
|
||||
# Create canvas with scrollbars
|
||||
# Create canvas without internal scrollbars
|
||||
self.timeline_canvas = tk.Canvas(canvas_frame, bg='#1a1a1a',
|
||||
highlightthickness=0, scrollregion=(0, 0, 2000, 400))
|
||||
|
||||
# Scrollbars
|
||||
h_scrollbar = ttk.Scrollbar(canvas_frame, orient="horizontal", command=self.timeline_canvas.xview)
|
||||
v_scrollbar = ttk.Scrollbar(canvas_frame, orient="vertical", command=self.sync_vertical_scroll)
|
||||
self.timeline_canvas.configure(xscrollcommand=h_scrollbar.set, yscrollcommand=v_scrollbar.set)
|
||||
# Pack canvas to fill the frame completely
|
||||
self.timeline_canvas.pack(fill="both", expand=True)
|
||||
|
||||
# Pack scrollbars and canvas
|
||||
h_scrollbar.pack(side="bottom", fill="x")
|
||||
v_scrollbar.pack(side="right", fill="y")
|
||||
self.timeline_canvas.pack(side="left", fill="both", expand=True)
|
||||
# Create external horizontal scrollbar for timeline control
|
||||
# Place it outside the timeline in the workspace area
|
||||
external_scrollbar_frame = tk.Frame(timeline_workspace, bg=self.colors['bg_primary'], height=20)
|
||||
external_scrollbar_frame.pack(side="bottom", fill="x", padx=5, pady=2)
|
||||
external_scrollbar_frame.pack_propagate(False)
|
||||
|
||||
# Horizontal scrollbar outside timeline but controlling it
|
||||
self.external_h_scrollbar = ttk.Scrollbar(external_scrollbar_frame, orient="horizontal",
|
||||
command=self.timeline_canvas.xview)
|
||||
self.timeline_canvas.configure(xscrollcommand=self.external_h_scrollbar.set)
|
||||
self.external_h_scrollbar.pack(fill="x", expand=True)
|
||||
|
||||
# Bind professional timeline events
|
||||
self.timeline_canvas.bind("<Button-1>", self.timeline_click)
|
||||
@ -609,13 +614,13 @@ class ShortsEditorGUI:
|
||||
# Bottom line of track
|
||||
self.track_road_canvas.create_line(
|
||||
0, y_pos + track_height, canvas_width, y_pos + track_height,
|
||||
fill=self.colors['border'], width=1, tags="road_lines"
|
||||
fill=self.colors['border'], width=3, tags="road_lines"
|
||||
)
|
||||
|
||||
# Track type indicator line (left edge with track color)
|
||||
self.track_road_canvas.create_line(
|
||||
0, y_pos, 0, y_pos + track_height,
|
||||
fill=track_info['color'], width=3, tags="road_lines"
|
||||
fill=track_info['color'], width=1, tags="road_lines"
|
||||
)
|
||||
|
||||
# Center dashed line for alignment reference
|
||||
@ -634,11 +639,9 @@ class ShortsEditorGUI:
|
||||
self.editor_window.after(10, self.draw_track_road_lines)
|
||||
|
||||
def sync_vertical_scroll(self, *args):
|
||||
"""Synchronize vertical scrolling between track panel and timeline canvas"""
|
||||
# Scroll both canvases together
|
||||
self.timeline_canvas.yview(*args)
|
||||
if hasattr(self, 'track_road_canvas'):
|
||||
self.track_road_canvas.yview(*args)
|
||||
"""Vertical scrolling disabled - no scrollbars for up/down movement"""
|
||||
# Vertical scrolling removed for cleaner interface
|
||||
pass
|
||||
|
||||
def create_track_control(self, track_id, track_info):
|
||||
"""Create control panel for a single track positioned on road lines"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user