def set_track_normal_height(track_index, is_retry=False): track = get_track(track_index) track.height = appconsts.TRACK_HEIGHT_NORMAL # Check that new height tracks can be displayed and cancel if not. new_h = current_sequence().get_tracks_height() allocation = gui.tline_canvas.widget.get_allocation() x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height if new_h > h and is_retry == False: current_paned_pos = gui.editor_window.app_v_paned.get_position() new_paned_pos = current_paned_pos - (new_h - h) - 5 gui.editor_window.app_v_paned.set_position(new_paned_pos) GObject.timeout_add(200, lambda: set_track_normal_height(track_index, True)) return False allocation = gui.tline_canvas.widget.get_allocation() x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height if new_h > h: track.height = appconsts.TRACK_HEIGHT_SMALL dialogutils.warning_message(_("Not enough vertical space on Timeline to expand track"), _("Maximize or resize application window to get more\nspace for tracks if possible."), gui.editor_window.window, True) return False tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() updater.repaint_tline() return False
def set_track_small_height(track_index): track = get_track(track_index) track.height = appconsts.TRACK_HEIGHT_SMALL if editorstate.SCREEN_HEIGHT < 863: track.height = appconsts.TRACK_HEIGHT_SMALLEST tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() updater.repaint_tline()
def window_resized(): # Resize track heights so that all tracks are displayed current_sequence().resize_tracks_to_fit( gui.tline_canvas.widget.get_allocation()) # Place clips in the middle of timeline canvas after window resize tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners( ) # hit areas for track switches need to be recalculated repaint_tline()
def set_timeline_height(): if len(current_sequence().tracks) == 11 or PROJECT().get_project_property(appconsts.P_PROP_TLINE_SHRINK_VERTICAL) == False: tlinewidgets.HEIGHT = appconsts.TLINE_HEIGHT else: tlinewidgets.HEIGHT = current_sequence().get_shrunk_tline_height_min() gui.tline_canvas.widget.set_size_request(tlinewidgets.WIDTH, tlinewidgets.HEIGHT) gui.tline_column.widget.set_size_request(tlinewidgets.COLUMN_WIDTH, tlinewidgets.HEIGHT) current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.get_allocation()) tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() repaint_tline()
def init_editor_state(): """ Called after project load or changing current sequence to initalize editor state. """ render.fill_out_profile_widgets() gui.media_view_filter_selector.set_pixbuf(editorstate.media_view_filter) gui.clip_editor_b.set_sensitive(False) gui.editor_window.window.set_title(editorstate.project.name + " - Flowblade") gui.editor_window.uimanager.get_widget( "/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Redo").set_sensitive(False) # Center tracks vertical display and init some listeners to # new value and repaint tracks column. tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() gui.tline_column.widget.queue_draw() # Clear editors clipeffectseditor.clear_clip() compositeeditor.clear_compositor() # Show first pages on notebooks gui.middle_notebook.set_current_page(0) # Clear clip selection. movemodes.clear_selection_values() # Set initial edit mode gui.editor_window.tool_selector.set_tool_pixbuf( appconsts.TLINE_TOOL_INSERT) editevent.insert_move_mode_pressed() # Create array needed to update compositors after all edits editorstate.current_sequence().restack_compositors() proxyediting.set_menu_to_proxy_state() undo.clear_undos() # Enable edit action GUI updates edit.do_gui_update = True
def window_resized(): # This can get async called from window "size-allocate" signal # during project load before project.c_seq has been build if not(hasattr(editorstate.project, "c_seq")): return if editorstate.project.c_seq == None: return # Resize track heights so that all tracks are displayed current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.allocation) # Place clips in the middle of timeline canvas after window resize tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.allocation) gui.tline_column.init_listeners() # hit areas for track swicthes need to be recalculated repaint_tline()
def window_resized(): # This can get async called from window "size-allocate" signal # during project load before project.c_seq has been build if not(hasattr(editorstate.project, "c_seq")): return if editorstate.project.c_seq == None: return # Resize track heights so that all tracks are displayed current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.get_allocation()) # Place clips in the middle of timeline canvas after window resize tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() # hit areas for track switches need to be recalculated repaint_tline()
def window_resized(): try: # Resize track heights so that all tracks are displayed current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.get_allocation()) # Place clips in the middle of timeline canvas after window resize tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() # hit areas for track switches need to be recalculated repaint_tline() return False except: GObject.timeout_add(200, window_resized) print "window resized FAILED" return False
def window_resized(): try: # Resize track heights so that all tracks are displayed current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.get_allocation()) # Place clips in the middle of timeline canvas after window resize tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() # hit areas for track switches need to be recalculated repaint_tline() return False except: GObject.timeout_add(200, window_resized) print("window resized FAILED") return False
def set_track_normal_height(track_index): track = get_track(track_index) track.height = appconsts.TRACK_HEIGHT_NORMAL # Check that new height tracks can be displayed and cancel if not. new_h = current_sequence().get_tracks_height() x, y, w, h = gui.tline_canvas.widget.allocation if new_h > h: track.height = appconsts.TRACK_HEIGHT_SMALL dialogutils.warning_message( _("Not enough vertical space on Timeline to expand track"), _("Maximize or resize application window to get more\nspace for tracks if possible." ), gui.editor_window.window, True) return tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.allocation) gui.tline_column.init_listeners() updater.repaint_tline()
def init_editor_state(): """ Called after project load or changing current sequence to initalize editor state. """ render.fill_out_profile_widgets() gui.media_view_filter_selector.set_pixbuf(editorstate.media_view_filter) gui.editor_window.window.set_title(editorstate.project.name + " - Flowblade") gui.editor_window.uimanager.get_widget("/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Redo").set_sensitive(False) # Center tracks vertical display and init some listeners to # new value and repaint tracks column. tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() gui.tline_column.widget.queue_draw() # Clear editors clipeffectseditor.clear_clip() clipeffectseditor.effect_selection_changed() # to get No Clip text compositeeditor.clear_compositor() # Show first pages on notebooks gui.middle_notebook.set_current_page(0) # Clear clip selection. movemodes.clear_selection_values() # Set initial edit mode modesetting.set_default_edit_mode() # Create array needed to update compositors after all edits editorstate.current_sequence().restack_compositors() proxyediting.set_menu_to_proxy_state() undo.clear_undos() # Enable edit action GUI updates edit.do_gui_update = True
def set_track_normal_height(track_index): track = get_track(track_index) track.height = appconsts.TRACK_HEIGHT_NORMAL # Check that new height tracks can be displayed and cancel if not. new_h = current_sequence().get_tracks_height() x, y, w, h = gui.tline_canvas.widget.allocation if new_h > h: track.height = appconsts.TRACK_HEIGHT_SMALL dialogutils.warning_message( _("Not enough vertical space on Timeline to expand track"), _("Maximize or resize application window to get more\nspace for tracks if possible."), gui.editor_window.window, True, ) return tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.allocation) gui.tline_column.init_listeners() updater.repaint_tline()
def set_timeline_height(): orig_pos = gui.editor_window.app_v_paned.get_position() orig_height = tlinewidgets.HEIGHT if len(current_sequence().tracks) == 11 or PROJECT().get_project_property(appconsts.P_PROP_TLINE_SHRINK_VERTICAL) == False: tlinewidgets.HEIGHT = appconsts.TLINE_HEIGHT set_v_paned = False else: tlinewidgets.HEIGHT = current_sequence().get_shrunk_tline_height_min() set_v_paned = True gui.tline_canvas.widget.set_size_request(tlinewidgets.WIDTH, tlinewidgets.HEIGHT) gui.tline_column.widget.set_size_request(tlinewidgets.COLUMN_WIDTH, tlinewidgets.HEIGHT) if set_v_paned == True: new_pos = orig_pos + orig_height - tlinewidgets.HEIGHT gui.editor_window.app_v_paned.set_position(new_pos) current_sequence().resize_tracks_to_fit(gui.tline_canvas.widget.get_allocation()) tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() repaint_tline()
def _tracks_resize_update(): tlinewidgets.set_ref_line_y(gui.tline_canvas.widget.get_allocation()) gui.tline_column.init_listeners() updater.repaint_tline() gui.tline_column.widget.queue_draw()