55 file_works ,
66 path_choice ,
77 get_fx_chains ,
8- get_path_to_files
8+ get_path_to_files ,
99)
1010from multiprocessing import freeze_support
1111from check_standalone import fix_checker
2323 on_closing ,
2424 buttons_freeze ,
2525 buttons_active ,
26- is_reaper_run
26+ is_reaper_run ,
27+ show_help_window ,
2728)
29+ from help_texts import HELP_DICT
30+ from tkinter import ttk
31+ from tktooltip import ToolTip
2832import multiprocessing as mp
2933import tkinter .messagebox
3034import pysubs2
@@ -424,6 +428,7 @@ def reaper_main(
424428 win32gui .ShowWindow (hwnd , 2 )
425429 reapy .open_project (new_path , in_new_tab = True )
426430 project = reapy .Project ()
431+ RPR .MoveEditCursor (- project .cursor_position , False )
427432 audio_select (audio )
428433 RPR .InsertMedia (video [0 ], 512 | 0 )
429434 project .save (False )
@@ -489,9 +494,7 @@ def resource_path(path):
489494y = (s_height - height ) // 2
490495master .geometry (f'{ width } x{ height } +{ x } +{ y - upper } ' )
491496master .resizable (width = False , height = False )
492- width = master .winfo_screenwidth ()
493- height = master .winfo_screenheight ()
494- master .title ('REAPERSCRIPT' )
497+ master .title ('REAPERSCRIPT v3.07' )
495498img = Image .open (resource_path ('background.png' ))
496499tk_img = ImageTk .PhotoImage (img )
497500background_label = tkinter .Label (master , image = tk_img )
@@ -512,90 +515,92 @@ def resource_path(path):
512515]
513516config = get_config ()
514517checkboxes = {}
518+ checkbox_style = ttk .Style ()
519+ checkbox_style .configure ('TCheckbutton' , background = '#ffc0cb' )
520+ button_style = ttk .Style ()
521+ button_style .configure ('TButton' , background = '#ffc0cb' )
515522for i , option in enumerate (OPTIONS ):
516523 var = tkinter .BooleanVar ()
517524 if option in config ['OPTIONS' ]:
518525 var .set (config ['OPTIONS' ].getboolean (option ))
519526 else :
520527 var .set (False )
521- checkbox = tkinter .Checkbutton (
528+ checkbox = ttk .Checkbutton (
522529 master ,
523530 text = option ,
524531 variable = var ,
525- background = '#ffc0cb' ,
526- bd = 3 ,
527- pady = 3 ,
528- activebackground = '#ffc0cb'
532+ padding = 7 ,
529533 )
530534 checkbox .grid (
531535 row = i ,
532536 column = 0 ,
533537 sticky = tkinter .W
534538 )
539+ ToolTip (checkbox , HELP_DICT [option ])
535540 checkboxes [option ] = var
536541BUTTONS = [
537542 'start' ,
538543 'template' ,
539544 'rfx' ,
540- 'fix_check' ,
545+ 'fixcheck_standalone' ,
546+ 'help' ,
541547]
542- start_bttn = tkinter .Button (
548+ start_bttn = ttk .Button (
543549 master ,
544550 text = 'START' ,
545551 name = 'start' ,
546- background = '#9b93b3' ,
547- activebackground = '#9b93b3' ,
548552 command = lambda : on_save_click (checkboxes , master , BUTTONS )
549553)
550554start_bttn .place (relx = 0.5 , rely = 1.0 , anchor = "s" , y = - 9 )
551- template = tkinter .Button (
555+ ToolTip (start_bttn , HELP_DICT ['start' ])
556+ template_btn = ttk .Button (
552557 master ,
553558 text = 'TEMPLATE' ,
554559 name = 'template' ,
555- background = '#9b93b3' ,
556- activebackground = '#9b93b3' ,
557560 command = lambda : path_choice ('project_path' )
558561)
559- template .grid (
562+ template_btn .grid (
560563 row = (len (OPTIONS ) + 2 ),
561564 column = 0 ,
562565 sticky = tkinter .W ,
563566 padx = 6 ,
564567 pady = 3
565- )
566- rfxchains = tkinter .Button (
568+ )
569+ ToolTip (template_btn , HELP_DICT ['template' ])
570+ rfxchains_btn = ttk .Button (
567571 master ,
568572 text = 'RFXCHAINS' ,
569573 name = 'rfx' ,
570- background = '#9b93b3' ,
571- activebackground = '#9b93b3' ,
572574 command = lambda : path_choice ('fx_chains_folder' )
573575)
574- rfxchains .grid (
576+ rfxchains_btn .grid (
575577 row = (len (OPTIONS ) + 3 ),
576578 column = 0 ,
577579 sticky = tkinter .W ,
578580 padx = 6 ,
579581 pady = 3
580- )
581- fix_check_button = tkinter .Button (
582+ )
583+ ToolTip (rfxchains_btn , HELP_DICT ['rfx' ])
584+ fix_check_btn = ttk .Button (
582585 master ,
583586 text = 'FIXCHECK' ,
584- name = 'fix_check' ,
585- background = '#9b93b3' ,
586- activebackground = '#9b93b3' ,
587+ name = 'fixcheck_standalone' ,
587588 command = lambda : on_fix_check_click (master , BUTTONS )
588589)
589- fix_check_button .place (relx = 0.5 , rely = 1.0 , anchor = "s" , x = 150 , y = - 7 )
590- version = tkinter .Label (
590+ fix_check_btn .place (relx = 0.5 , rely = 1.0 , anchor = "s" , x = 145 , y = - 9 )
591+ ToolTip (fix_check_btn , HELP_DICT ['fixcheck_standalone' ])
592+ help_btn = ttk .Button (
591593 master ,
592- text = 'Version 3.04' ,
593- background = '#9b93b3' ,
594+ text = 'HELP' ,
595+ name = 'help' ,
596+ command = lambda : show_help_window (master ),
594597)
595- version .place (relx = 0.5 , rely = 1.0 , anchor = "s" , x = 150 , y = - 382 )
598+ help_btn .place (relx = 0.5 , rely = 1.0 , anchor = "s" , x = 145 , y = - 377 )
599+ ToolTip (help_btn , HELP_DICT ['help' ])
596600
597601# Чтобы Reaper API подгрузился, Reaper должен быть включен при запуске скрипта
598602if __name__ == '__main__' :
599603 freeze_support ()
600604 is_reaper_run ()
605+ master .focus_force ()
601606 master .mainloop ()
0 commit comments