@@ -349,45 +349,6 @@ def _enforce_log_pane_min_height(self, event=None):
349349 except tk .TclError :
350350 pass
351351
352- def _on_yaw_section_toggled (self , is_open ):
353- def _apply ():
354- if not hasattr (self , "main_content_paned_window" ):
355- return
356- try :
357- if not is_open :
358- self ._yaw_selector_sashpos = self .main_content_paned_window .sashpos (0 )
359- self .update_idletasks ()
360- collapsed_height = self .yaw_selector_module_labelframe .winfo_reqheight ()
361- self .main_content_paned_window .sashpos (0 , collapsed_height )
362- else :
363- previous = getattr (self , "_yaw_selector_sashpos" , None )
364- if previous is not None :
365- self .main_content_paned_window .sashpos (0 , previous )
366- except tk .TclError :
367- pass
368- self .after_idle (_apply )
369-
370- def _adjust_main_content_sash_for_bottom (self ):
371- if not hasattr (self , "main_content_paned_window" ) or not hasattr (self , "bottom_content_frame" ):
372- return
373- if hasattr (self , "yaw_selector_toggle_var" ) and not self .yaw_selector_toggle_var .get ():
374- return
375- try :
376- self .update_idletasks ()
377- total_height = self .main_content_paned_window .winfo_height ()
378- if total_height <= 1 :
379- return
380- bottom_req = self .bottom_content_frame .winfo_reqheight ()
381- if bottom_req <= 0 :
382- return
383- bottom_req = min (bottom_req , total_height )
384- self .main_content_paned_window .sashpos (0 , total_height - bottom_req )
385- except tk .TclError :
386- pass
387-
388- def _on_bottom_section_toggled (self , is_open ):
389- self .after_idle (self ._adjust_main_content_sash_for_bottom )
390-
391352 def create_collapsible_section (self , parent , title , default_open = True , body_pack_opts = None , on_toggle = None ):
392353 if body_pack_opts is None :
393354 body_pack_opts = {"fill" : tk .X }
@@ -451,8 +412,18 @@ def create_widgets(self): # pylint: disable=too-many-statements
451412 self .settings_container = ttk .Frame (self .main_paned_window )
452413 self .main_paned_window .add (self .settings_container , weight = 3 )
453414
454- self .settings_canvas = tk .Canvas (self .settings_container , highlightthickness = 0 , borderwidth = 0 )
455- self .settings_scrollbar = ttk .Scrollbar (self .settings_container , orient = tk .VERTICAL , command = self .settings_canvas .yview )
415+ self .log_pane_minsize = 140
416+ self .log_container = ttk .Frame (self .main_paned_window )
417+ self .main_paned_window .add (self .log_container , weight = 2 )
418+
419+ self .settings_container .columnconfigure (0 , weight = 1 )
420+ self .settings_container .rowconfigure (0 , weight = 1 )
421+
422+ self .settings_scroll_area = ttk .Frame (self .settings_container )
423+ self .settings_scroll_area .grid (row = 0 , column = 0 , sticky = tk .NSEW )
424+
425+ self .settings_canvas = tk .Canvas (self .settings_scroll_area , highlightthickness = 0 , borderwidth = 0 )
426+ self .settings_scrollbar = ttk .Scrollbar (self .settings_scroll_area , orient = tk .VERTICAL , command = self .settings_canvas .yview )
456427 self .settings_canvas .configure (yscrollcommand = self .settings_scrollbar .set )
457428
458429 self .settings_canvas .pack (side = tk .LEFT , fill = tk .BOTH , expand = True )
@@ -471,10 +442,6 @@ def create_widgets(self): # pylint: disable=too-many-statements
471442 self ._settings_mousewheel_bound = False
472443 self ._settings_mousewheel_bindings = []
473444
474- self .log_pane_minsize = 140
475- self .log_container = ttk .Frame (self .main_paned_window )
476- self .main_paned_window .add (self .log_container , weight = 2 )
477-
478445 self .io_frame = ttk .LabelFrame (self .settings_frame , text = "" , padding = "5" )
479446 self .io_frame .pack (fill = tk .X , pady = 2 , side = tk .TOP )
480447 self .input_file_label = ttk .Label (self .io_frame , text = "" )
@@ -494,41 +461,46 @@ def create_widgets(self): # pylint: disable=too-many-statements
494461 self .browse_output_button .grid (row = 1 , column = 2 , padx = 5 , pady = 2 )
495462 self .io_frame .columnconfigure (1 , weight = 1 )
496463
497- self .main_content_paned_window = ttk .PanedWindow (self .settings_frame , orient = tk .VERTICAL )
498- self .main_content_paned_window .pack (fill = tk .BOTH , expand = True , pady = (2 ,0 ), side = tk .TOP )
499-
500- self ._yaw_selector_sashpos = None
501- self .yaw_selector_module_labelframe , yaw_body , self .yaw_selector_toggle_var , self .yaw_selector_header_label = (
464+ self .output_settings_frame , self .output_settings_body , self .output_settings_toggle_var , self .output_settings_header_label = (
502465 self .create_collapsible_section (
503- self .main_content_paned_window ,
466+ self .settings_frame ,
504467 title = "" ,
505468 default_open = True ,
506- body_pack_opts = {"fill" : tk .BOTH , "expand" : True },
507- on_toggle = self ._on_yaw_section_toggled
469+ body_pack_opts = {"fill" : tk .X , "expand" : False }
508470 )
509471 )
510- self .main_content_paned_window . add ( self . yaw_selector_module_labelframe , weight = 3 )
472+ self .output_settings_frame . pack ( fill = tk . X , pady = 2 , side = tk . TOP )
511473
512- self .yaw_selector_widget = AdvancedYawSelector (
513- yaw_body ,
514- initial_pitches_str = AYS_DEFAULT_PITCHES_STR ,
515- on_selection_change_callback = self .on_yaw_selector_updated
516- )
517- self .yaw_selector_widget .pack (fill = tk .BOTH , expand = True )
474+ self .control_frame_outer = ttk .Frame (self .output_settings_body , padding = (5 ,0 ))
475+ self .control_frame_outer .pack (fill = tk .X , pady = (0 ,2 ), side = tk .TOP )
518476
519- self .bottom_content_frame = ttk .Frame (self .main_content_paned_window )
520- self .main_content_paned_window .add (self .bottom_content_frame , weight = 2 )
477+ self .parallel_control_frame = ttk .Frame (self .control_frame_outer )
478+ self .parallel_control_frame .pack (fill = tk .X )
479+ self .parallel_label = ttk .Label (self .parallel_control_frame , text = "" )
480+ self .parallel_label .pack (side = tk .LEFT , padx = (5 ,0 ))
521481
522- self .output_settings_frame , self .output_settings_body , self .output_settings_toggle_var , self .output_settings_header_label = (
523- self .create_collapsible_section (
524- self .bottom_content_frame ,
525- title = "" ,
526- default_open = True ,
527- body_pack_opts = {"fill" : tk .X , "expand" : False },
528- on_toggle = self ._on_bottom_section_toggled
529- )
530- )
531- self .output_settings_frame .pack (fill = tk .X , pady = 2 , side = tk .TOP )
482+ self .parallel_combo = ttk .Combobox (self .parallel_control_frame , textvariable = self .parallel_processes_var ,
483+ values = self .parallel_options , width = 5 , state = "readonly" )
484+ self .parallel_combo .pack (side = tk .LEFT , padx = 5 )
485+
486+ self .button_time_frame = ttk .Frame (self .control_frame_outer )
487+ self .button_time_frame .pack (fill = tk .X , pady = (5 ,0 ))
488+ self .start_button = ttk .Button (self .button_time_frame , text = "" , command = self .start_conversion_mp )
489+ self .start_button .pack (side = tk .LEFT , padx = 5 )
490+
491+ self .cancel_button = ttk .Button (self .button_time_frame , text = "" , command = self .cancel_conversion_mp , state = "disabled" )
492+ self .cancel_button .pack (side = tk .LEFT , padx = 5 )
493+
494+ self .time_label = ttk .Label (self .button_time_frame , text = "" )
495+ self .time_label .pack (side = tk .LEFT , padx = 10 , pady = (0 ,3 ))
496+
497+ self .progress_display_frame = ttk .Frame (self .control_frame_outer )
498+ self .progress_display_frame .pack (fill = tk .X , pady = (2 ,0 ))
499+ self .viewpoint_progress_label = ttk .Label (self .progress_display_frame , textvariable = self .viewpoint_progress_text_var )
500+ self .viewpoint_progress_label .pack (side = tk .LEFT , padx = 5 )
501+
502+ self .progress_bar = ttk .Progressbar (self .progress_display_frame , orient = "horizontal" , length = 200 , mode = "determinate" )
503+ self .progress_bar .pack (side = tk .LEFT , padx = 5 , fill = tk .X , expand = True )
532504
533505 common_opts_line1_frame = ttk .Frame (self .output_settings_body )
534506 common_opts_line1_frame .pack (fill = tk .X , pady = 2 )
@@ -625,44 +597,29 @@ def create_widgets(self): # pylint: disable=too-many-statements
625597 self .cq_entry .pack (side = tk .LEFT , padx = (0 ,5 ))
626598 format_options_main_frame .columnconfigure (1 , weight = 1 )
627599
628- self .control_frame_outer = ttk .Frame (self .bottom_content_frame , padding = (5 ,0 ))
629- self .control_frame_outer .pack (fill = tk .X , pady = 2 , side = tk .TOP )
630-
631- self .parallel_control_frame = ttk .Frame (self .control_frame_outer )
632- self .parallel_control_frame .pack (fill = tk .X )
633- self .parallel_label = ttk .Label (self .parallel_control_frame , text = "" )
634- self .parallel_label .pack (side = tk .LEFT , padx = (5 ,0 ))
635-
636- self .parallel_combo = ttk .Combobox (self .parallel_control_frame , textvariable = self .parallel_processes_var ,
637- values = self .parallel_options , width = 5 , state = "readonly" )
638- self .parallel_combo .pack (side = tk .LEFT , padx = 5 )
639-
640- self .button_time_frame = ttk .Frame (self .control_frame_outer )
641- self .button_time_frame .pack (fill = tk .X , pady = (5 ,0 ))
642- self .start_button = ttk .Button (self .button_time_frame , text = "" , command = self .start_conversion_mp )
643- self .start_button .pack (side = tk .LEFT , padx = 5 )
644-
645- self .cancel_button = ttk .Button (self .button_time_frame , text = "" , command = self .cancel_conversion_mp , state = "disabled" )
646- self .cancel_button .pack (side = tk .LEFT , padx = 5 )
647-
648- self .time_label = ttk .Label (self .button_time_frame , text = "" )
649- self .time_label .pack (side = tk .LEFT , padx = 10 , pady = (0 ,3 ))
650-
651- self .progress_display_frame = ttk .Frame (self .control_frame_outer )
652- self .progress_display_frame .pack (fill = tk .X , pady = (2 ,0 ))
653- self .viewpoint_progress_label = ttk .Label (self .progress_display_frame , textvariable = self .viewpoint_progress_text_var )
654- self .viewpoint_progress_label .pack (side = tk .LEFT , padx = 5 )
600+ self .yaw_selector_module_labelframe , yaw_body , self .yaw_selector_toggle_var , self .yaw_selector_header_label = (
601+ self .create_collapsible_section (
602+ self .settings_frame ,
603+ title = "" ,
604+ default_open = True ,
605+ body_pack_opts = {"fill" : tk .X , "expand" : False }
606+ )
607+ )
608+ self .yaw_selector_module_labelframe .pack (fill = tk .X , pady = 2 , side = tk .TOP )
655609
656- self .progress_bar = ttk .Progressbar (self .progress_display_frame , orient = "horizontal" , length = 200 , mode = "determinate" )
657- self .progress_bar .pack (side = tk .LEFT , padx = 5 , fill = tk .X , expand = True )
610+ self .yaw_selector_widget = AdvancedYawSelector (
611+ yaw_body ,
612+ initial_pitches_str = AYS_DEFAULT_PITCHES_STR ,
613+ on_selection_change_callback = self .on_yaw_selector_updated
614+ )
615+ self .yaw_selector_widget .pack (fill = tk .BOTH , expand = True )
658616
659617 self .colmap_pipeline_frame , self .colmap_pipeline_body , self .colmap_pipeline_toggle_var , self .colmap_pipeline_header_label = (
660618 self .create_collapsible_section (
661- self .bottom_content_frame ,
619+ self .settings_frame ,
662620 title = "" ,
663- default_open = False ,
664- body_pack_opts = {"fill" : tk .X , "expand" : False },
665- on_toggle = self ._on_bottom_section_toggled
621+ default_open = True ,
622+ body_pack_opts = {"fill" : tk .X , "expand" : False }
666623 )
667624 )
668625 self .colmap_pipeline_frame .pack (fill = tk .X , pady = 2 , side = tk .TOP )
@@ -738,7 +695,6 @@ def create_widgets(self): # pylint: disable=too-many-statements
738695 self .ffmpeg_log_area .pack (expand = True , fill = tk .BOTH )
739696
740697 self ._update_settings_scrollregion ()
741- self .after (0 , self ._adjust_main_content_sash_for_bottom )
742698 self .after (0 , self ._set_main_paned_sash )
743699
744700
0 commit comments