def create_widgets(): """ Widgets for editing clip effects properties. """ # Aug-2019 - SvdB - BB prefs = editorpersistance.prefs widgets.clip_info = guicomponents.ClipInfoPanel() widgets.exit_button = Gtk.Button() icon = Gtk.Image.new_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU) widgets.exit_button.set_image(icon) widgets.exit_button.connect("clicked", lambda w: _quit_editing_clip_clicked()) widgets.exit_button.set_tooltip_text(_("Quit editing Clip in editor")) widgets.effect_stack_view = guicomponents.FilterSwitchListView(lambda ts: effect_selection_changed(), toggle_filter_active, dnd_row_deleted, dnd_row_inserted) widgets.effect_stack_view.treeview.connect("button-press-event", lambda w,e, wtf: stack_view_pressed(), None) gui.effect_stack_list_view = widgets.effect_stack_view widgets.value_edit_box = Gtk.VBox() widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE) widgets.value_edit_frame.add(widgets.value_edit_box) widgets.add_effect_b = Gtk.Button() widgets.add_effect_b.set_image(guiutils.get_image("filter_add")) widgets.del_effect_b = Gtk.Button() widgets.del_effect_b.set_image(guiutils.get_image("filter_delete")) widgets.toggle_all = Gtk.Button() widgets.toggle_all.set_image(guiutils.get_image("filters_all_toggle")) filter_mask_surfaces = [guiutils.get_cairo_image("filters_mask_add"), guiutils.get_cairo_image("filters_mask_add_not_active")] widgets.add_filter_mask = guicomponents.HamburgerPressLaunch(_filter_mask_launch_pressed, filter_mask_surfaces, 26) guiutils.set_margins(widgets.add_filter_mask.widget, 10, 0, 1, 0) widgets.add_effect_b.connect("clicked", lambda w,e: add_effect_pressed(), None) widgets.del_effect_b.connect("clicked", lambda w,e: delete_effect_pressed(), None) widgets.toggle_all.connect("clicked", lambda w: toggle_all_pressed()) widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch(_hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 6, 8, 1, 0) # These are created elsewhere and then monkeypatched here widgets.group_combo = None widgets.effect_list_view = None widgets.clip_info.set_tooltip_text(_("Clip being edited")) widgets.effect_stack_view.set_tooltip_text(_("Clip Filter Stack")) widgets.add_effect_b.set_tooltip_text(_("Add Filter to Clip Filter Stack")) widgets.del_effect_b.set_tooltip_text(_("Delete Filter from Clip Filter Stack")) widgets.toggle_all.set_tooltip_text(_("Toggle all Filters On/Off")) widgets.add_filter_mask.widget.set_tooltip_text(_("Add Filter Mask"))
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, hamburger_launch_pressed, filtering_cb): # Create buttons and connect signals add_media_b = Gtk.Button(_("Add")) del_media_b = Gtk.Button(_("Delete")) add_media_b.connect("clicked", add_cb, None) del_media_b.connect("clicked", del_cb, None) add_media_b.set_tooltip_text(_("Add Media File to Bin")) del_media_b.set_tooltip_text(_("Delete Media File from Bin")) hamburger_launcher = guicomponents.HamburgerPressLaunch( hamburger_launch_pressed) guiutils.set_margins(hamburger_launcher.widget, 2, 0, 4, 12) columns_img = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "columns.png") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22, h=22) columns_launcher.surface_y = 6 columns_launcher.widget.set_tooltip_text( _("Number of Media File columns.")) all_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_all_files.png") audio_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_audio_files.png") graphics_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_graphics_files.png") video_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_video_files.png") imgseq_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_imgseq_files.png") pattern_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_pattern_producers.png") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf ], 24, 22) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 4 files_filter_launcher.widget.set_tooltip_text( _("Visible Media File types.")) gui.media_view_filter_selector = files_filter_launcher buttons_box = Gtk.HBox(False, 1) buttons_box.pack_start(hamburger_launcher.widget, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(media_list_view, True, True, 0) panel.pack_start(buttons_box, False, True, 0) return panel
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, hamburger_launch_pressed, filtering_cb): # Aug-2019 - SvdB - BB size_adj = 1 prefs = editorpersistance.prefs if prefs.double_track_hights: size_adj = 2 hamburger_launcher = guicomponents.HamburgerPressLaunch( hamburger_launch_pressed) guiutils.set_margins(hamburger_launcher.widget, 2, 0, 4, 12) columns_img = guiutils.get_cairo_image("columns") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22 * size_adj, h=22 * size_adj) columns_launcher.surface_y = 6 columns_launcher.widget.set_tooltip_text( _("Number of Media File columns.")) all_pixbuf = guiutils.get_cairo_image("show_all_files") audio_pixbuf = guiutils.get_cairo_image("show_audio_files") graphics_pixbuf = guiutils.get_cairo_image("show_graphics_files") video_pixbuf = guiutils.get_cairo_image("show_video_files") imgseq_pixbuf = guiutils.get_cairo_image("show_imgseq_files") pattern_pixbuf = guiutils.get_cairo_image("show_pattern_producers") unused_pixbuf = guiutils.get_cairo_image("show_unused_files") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf, unused_pixbuf ], 24 * size_adj, 22 * size_adj) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 4 files_filter_launcher.widget.set_tooltip_text( _("Visible Media File types.")) gui.media_view_filter_selector = files_filter_launcher bin_info = guicomponents.BinInfoPanel() buttons_box = Gtk.HBox(False, 1) buttons_box.pack_start(hamburger_launcher.widget, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) buttons_box.pack_start(bin_info, False, False, 0) #buttons_box.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(media_list_view, True, True, 0) panel.pack_start(buttons_box, False, True, 0) return (panel, bin_info)
def _create_widgets(): """ Widgets for editing clip effects properties. """ widgets.clip_info = guicomponents.ClipInfoPanel() widgets.value_edit_box = Gtk.VBox() widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE) widgets.value_edit_frame.add(widgets.value_edit_box) widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch( _hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 6, 8, 1, 0)
def create_widgets(): """ Widgets for editing compositing properties. """ widgets.compositor_info = guicomponents.CompositorInfoPanel() widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch(_hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 4, 6, 6, 0) # Edit area widgets.empty_label = Gtk.Label(label=_("No Compositor")) widgets.value_edit_box = Gtk.VBox() widgets.value_edit_box.pack_start(widgets.empty_label, True, True, 0) widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.add(widgets.value_edit_box) widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE)
def get_jobs_panel(): global _jobs_list_view actions_menu = guicomponents.HamburgerPressLaunch(_menu_action_pressed) guiutils.set_margins(actions_menu.widget, 8, 2, 2, 18) row2 = Gtk.HBox() row2.pack_start(actions_menu.widget, False, True, 0) row2.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(_jobs_list_view, True, True, 0) panel.pack_start(row2, False, True, 0) panel.set_size_request(400, 10) return panel
def create_widgets(): """ Widgets for editing compositing properties. """ widgets.compositor_info = guicomponents.CompositorInfoPanel() widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch(_hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 4, 6, 6, 0) # empty_label text has no effect on runtime behaviour, look to remove # _display_compositor_edit_box() clearly overwrites anything we do here before user gets shown anything widgets.empty_label = Gtk.Label(label=_("No Compositor")) # Edit area widgets.value_edit_box = Gtk.VBox() widgets.value_edit_box.pack_start(widgets.empty_label, True, True, 0) widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.add(widgets.value_edit_box) widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE)
def get_jobs_panel(): global _jobs_list_view actions_menu = guicomponents.HamburgerPressLaunch(_menu_action_pressed) guiutils.set_margins(actions_menu.widget, 8, 2, 2, 18) row2 = Gtk.HBox() row2.pack_start(actions_menu.widget, False, True, 0) row2.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(_jobs_list_view, True, True, 0) panel.pack_start(row2, False, True, 0) panel.set_size_request(400, 10) if editorpersistance.prefs.theme == appconsts.FLOWBLADE_THEME_GRAY: panel.override_background_color(Gtk.StateFlags.NORMAL, gui.get_light_gray_light_color()) return panel
def get_media_log_events_panel(events_list_view): global widgets group_actions_menu = guicomponents.HamburgerPressLaunch( _group_action_pressed) guiutils.set_margins(group_actions_menu.widget, 10, 0, 2, 18) star_check = Gtk.CheckButton() star_check.set_active(True) star_check.connect("clicked", lambda w: media_log_filtering_changed()) widgets.star_check = star_check star_label = Gtk.Image() # Aug-2019 - SvdB - BB star_label.set_from_file(respaths.IMAGE_PATH + guiutils.get_image_name( "star", double_height=editorpersistance.prefs.double_track_hights)) star_not_active_check = Gtk.CheckButton() star_not_active_check.set_active(True) star_not_active_check.connect("clicked", lambda w: media_log_filtering_changed()) widgets.star_not_active_check = star_not_active_check star_not_active_label = Gtk.Image() # Aug-2019 - SvdB - BB star_not_active_label.set_from_file( respaths.IMAGE_PATH + guiutils.get_image_name( "star_not_active", double_height=editorpersistance.prefs.double_track_hights)) star_button = Gtk.Button() # Aug-2019 - SvdB - BB star_button.set_image(guiutils.get_image("star")) star_button.connect("clicked", lambda w: media_log_star_button_pressed()) no_star_button = Gtk.Button() # Aug-2019 - SvdB - BB no_star_button.set_image(guiutils.get_image("star_not_active")) no_star_button.connect("clicked", lambda w: media_log_no_star_button_pressed()) widgets.group_box = Gtk.HBox() _create_group_select() widgets.group_view_select.set_active(0) row1 = Gtk.HBox() row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(widgets.group_box, False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(star_check, False, True, 0) row1.pack_start(star_label, False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(star_not_active_check, False, True, 0) row1.pack_start(star_not_active_label, False, True, 0) row1.pack_start(guiutils.pad_label(12, 12), False, False, 0) row1.pack_start(star_button, False, True, 0) row1.pack_start(no_star_button, False, True, 0) row1.pack_start(Gtk.Label(), True, True, 0) # Aug-2019 - SvdB - BB prefs = editorpersistance.prefs size_adj = 1 if prefs.double_track_hights: size_adj = 2 widgets.log_range = Gtk.Button() widgets.log_range.set_image(guiutils.get_image("log_range")) widgets.log_range.set_size_request(80, 30) widgets.log_range.connect("clicked", lambda w: log_range_clicked()) delete_button = Gtk.Button() delete_button.set_image(guiutils.get_image("delete_log_range")) delete_button.set_size_request(80, 30) delete_button.connect("clicked", lambda w: delete_selected()) insert_displayed = Gtk.Button() insert_displayed.set_image(guiutils.get_image("insert_media_log")) insert_displayed.set_size_request(80, 22) insert_displayed.connect("clicked", lambda w: insert_selected_log_events()) append_displayed = Gtk.Button() append_displayed.set_image(guiutils.get_image("append_media_log")) append_displayed.set_size_request(80, 22) append_displayed.connect("clicked", lambda w: append_log_events()) row2 = Gtk.HBox() row2.pack_start(group_actions_menu.widget, False, True, 0) row2.pack_start(widgets.log_range, False, True, 0) row2.pack_start(delete_button, False, True, 0) row2.pack_start(Gtk.Label(), True, True, 0) row2.pack_start(insert_displayed, False, True, 0) row2.pack_start(append_displayed, False, True, 0) panel = Gtk.VBox() panel.pack_start(row1, False, True, 0) panel.pack_start(events_list_view, True, True, 0) panel.pack_start(row2, False, True, 0) panel.set_size_request(400, 10) star_check.set_tooltip_text(_("Display starred ranges")) star_not_active_check.set_tooltip_text(_("Display non-starred ranges")) star_button.set_tooltip_text(_("Set selected ranges starred")) no_star_button.set_tooltip_text(_("Set selected ranges non-starred")) widgets.log_range.set_tooltip_text(_("Log current marked range")) delete_button.set_tooltip_text(_("Delete selected ranges")) insert_displayed.set_tooltip_text(_("Insert selected ranges on Timeline")) append_displayed.set_tooltip_text(_("Append displayed ranges on Timeline")) dnd.connect_range_log(events_list_view.treeview) return panel
def __init__(self, save_args_callback, load_args_callback, display_selection_callback, set_default_values_callback): self.load_args_callback = load_args_callback self.save_args_callback = save_args_callback self.display_selection_callback = display_selection_callback self.set_default_values_callback = set_default_values_callback self.use_project_label = Gtk.Label(label=_("Use Project Profile")) self.use_args_label = Gtk.Label(label=_("Render using args")) self.text_buffer = None # only used for small screen heights with dialog for setting args, but this value is tested to determine where to get args from. self.use_args_check = Gtk.CheckButton() self.use_args_check.connect("toggled", self.use_args_toggled) self.ext_label = Gtk.Label(label=_("Ext.:")) self.ext_label.set_sensitive(False) self.ext_entry = Gtk.Entry() self.ext_entry.set_width_chars(5) self.ext_entry.set_sensitive(False) self.opts_view = Gtk.TextView() self.opts_view.set_sensitive(False) self.opts_view.set_pixels_above_lines(2) self.opts_view.set_left_margin(2) self.open_in_bin = Gtk.CheckButton() use_opts_row = Gtk.HBox() use_opts_row.pack_start(self.use_args_check, False, False, 0) use_opts_row.pack_start(guiutils.get_pad_label(4, 1), False, False, 0) use_opts_row.pack_start(self.use_args_label, False, False, 0) use_opts_row.pack_start(Gtk.Label(), True, True, 0) sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) sw.add(self.opts_view) sw.set_size_request(*FFMPEG_VIEW_SIZE) scroll_frame = Gtk.Frame() scroll_frame.add(sw) self.hamburger_launch = guicomponents.HamburgerPressLaunch( self.hamburger_launch_pressed) guiutils.set_margins(self.hamburger_launch.widget, 5, 0, 0, 0) opts_buttons_row = Gtk.HBox(False) opts_buttons_row.pack_start(self.hamburger_launch.widget, False, False, 0) opts_buttons_row.pack_start(Gtk.Label(), True, True, 0) opts_buttons_row.pack_start(self.ext_label, False, False, 0) opts_buttons_row.pack_start(self.ext_entry, False, False, 0) self.use_args_check.set_tooltip_text( _("Render using key=value rendering options")) self.opts_view.set_tooltip_text(_("Edit render options")) self.vbox = Gtk.VBox(False, 2) self.vbox.pack_start(use_opts_row, False, False, 0) self.vbox.pack_start(scroll_frame, True, True, 0) self.vbox.pack_start(opts_buttons_row, False, False, 0)
def get_media_log_events_panel(events_list_view): global widgets group_actions_menu = guicomponents.HamburgerPressLaunch( _group_action_pressed) guiutils.set_margins(group_actions_menu.widget, 10, 0, 2, 18) star_check = Gtk.CheckButton() star_check.set_active(True) star_check.connect("clicked", lambda w: media_log_filtering_changed()) widgets.star_check = star_check star_label = Gtk.Image() star_label.set_from_file(respaths.IMAGE_PATH + "star.png") star_not_active_check = Gtk.CheckButton() star_not_active_check.set_active(True) star_not_active_check.connect("clicked", lambda w: media_log_filtering_changed()) widgets.star_not_active_check = star_not_active_check star_not_active_label = Gtk.Image() star_not_active_label.set_from_file(respaths.IMAGE_PATH + "star_not_active.png") star_button = Gtk.Button() star_button.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "star.png")) star_button.connect("clicked", lambda w: media_log_star_button_pressed()) no_star_button = Gtk.Button() no_star_button.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "star_not_active.png")) no_star_button.connect("clicked", lambda w: media_log_no_star_button_pressed()) widgets.group_box = Gtk.HBox() _create_group_select() widgets.group_view_select.set_active(0) row1 = Gtk.HBox() row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(widgets.group_box, False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(star_check, False, True, 0) row1.pack_start(star_label, False, True, 0) row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0) row1.pack_start(star_not_active_check, False, True, 0) row1.pack_start(star_not_active_label, False, True, 0) row1.pack_start(guiutils.pad_label(12, 12), False, False, 0) row1.pack_start(star_button, False, True, 0) row1.pack_start(no_star_button, False, True, 0) row1.pack_start(Gtk.Label(), True, True, 0) widgets.log_range = Gtk.Button() widgets.log_range.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "log_range.png")) widgets.log_range.set_size_request(80, 30) widgets.log_range.connect("clicked", lambda w: log_range_clicked()) delete_button = Gtk.Button() delete_button.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "delete_log_range.png")) delete_button.set_size_request(80, 30) delete_button.connect("clicked", lambda w: delete_selected()) use_comments_label = Gtk.Label(label=_("Use Comments as Clip Names")) use_comments_check = Gtk.CheckButton() use_comments_check.set_active(False) widgets.use_comments_check = use_comments_check insert_displayed = Gtk.Button() insert_displayed.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "insert_media_log.png")) insert_displayed.set_size_request(80, 22) insert_displayed.connect("clicked", lambda w: insert_selected_log_events()) append_displayed = Gtk.Button() append_displayed.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "append_media_log.png")) append_displayed.set_size_request(80, 22) append_displayed.connect("clicked", lambda w: append_log_events()) row2 = Gtk.HBox() row2.pack_start(group_actions_menu.widget, False, True, 0) row2.pack_start(widgets.log_range, False, True, 0) row2.pack_start(delete_button, False, True, 0) row2.pack_start(Gtk.Label(), True, True, 0) row2.pack_start(use_comments_label, False, True, 0) row2.pack_start(use_comments_check, False, True, 0) row2.pack_start(Gtk.Label(), True, True, 0) row2.pack_start(insert_displayed, False, True, 0) row2.pack_start(append_displayed, False, True, 0) panel = Gtk.VBox() panel.pack_start(row1, False, True, 0) panel.pack_start(events_list_view, True, True, 0) panel.pack_start(row2, False, True, 0) panel.set_size_request(400, 10) star_check.set_tooltip_text(_("Display starred ranges")) star_not_active_check.set_tooltip_text(_("Display non-starred ranges")) star_button.set_tooltip_text(_("Set selected ranges starred")) no_star_button.set_tooltip_text(_("Set selected ranges non-starred")) widgets.log_range.set_tooltip_text(_("Log current marked range")) delete_button.set_tooltip_text(_("Delete selected ranges")) insert_displayed.set_tooltip_text(_("Insert selected ranges on Timeline")) append_displayed.set_tooltip_text(_("Append displayed ranges on Timeline")) dnd.connect_range_log(events_list_view.treeview) return panel