diff --git a/view.py b/view.py index 5c113939..9baa605f 100644 --- a/view.py +++ b/view.py @@ -39,9 +39,16 @@ class View(): self.view_variable = SimpleNamespace( # Main Window # Sidebar Features + VAR_LABEL_TRANSLATION=StringVar(value="Translation"), CALLBACK_TOGGLE_TRANSLATION=None, + + VAR_LABEL_TRANSCRIPTION_SEND=StringVar(value="Voice2Chatbox"), CALLBACK_TOGGLE_TRANSCRIPTION_SEND=None, + + VAR_LABEL_TRANSCRIPTION_RECEIVE=StringVar(value="Speaker2Log"), CALLBACK_TOGGLE_TRANSCRIPTION_RECEIVE=None, + + VAR_LABEL_FOREGROUND=StringVar(value="Foreground"), CALLBACK_TOGGLE_FOREGROUND=None, # Language Settings @@ -210,12 +217,12 @@ class View(): vrct_gui.CALLBACK_TOGGLE_FOREGROUND = sidebar_features["callback_toggle_foreground"] - vrct_gui.sqls__optionmenu_your_language.configure(values=language_presets["values"]) - vrct_gui.sqls__optionmenu_your_language.configure(command=language_presets["callback_your_language"]) - vrct_gui.sqls__optionmenu_your_language.configure(variable=StringVar(value=config.SELECTED_TAB_YOUR_LANGUAGES[config.SELECTED_TAB_NO])) - vrct_gui.sqls__optionmenu_target_language.configure(values=language_presets["values"]) - vrct_gui.sqls__optionmenu_target_language.configure(command=language_presets["callback_target_language"]) - vrct_gui.sqls__optionmenu_target_language.configure(variable=StringVar(value=config.SELECTED_TAB_TARGET_LANGUAGES[config.SELECTED_TAB_NO])) + vrct_gui.sls__optionmenu_your_language.configure(values=language_presets["values"]) + vrct_gui.sls__optionmenu_your_language.configure(command=language_presets["callback_your_language"]) + vrct_gui.sls__optionmenu_your_language.configure(variable=StringVar(value=config.SELECTED_TAB_YOUR_LANGUAGES[config.SELECTED_TAB_NO])) + vrct_gui.sls__optionmenu_target_language.configure(values=language_presets["values"]) + vrct_gui.sls__optionmenu_target_language.configure(command=language_presets["callback_target_language"]) + vrct_gui.sls__optionmenu_target_language.configure(variable=StringVar(value=config.SELECTED_TAB_TARGET_LANGUAGES[config.SELECTED_TAB_NO])) vrct_gui.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB = language_presets["callback_selected_language_preset_tab"] vrct_gui.setDefaultActiveLanguagePresetTab(tab_no=config.SELECTED_TAB_NO) diff --git a/vrct_gui/_changeMainWindowWidgetsStatus.py b/vrct_gui/_changeMainWindowWidgetsStatus.py index facca16a..af616f92 100644 --- a/vrct_gui/_changeMainWindowWidgetsStatus.py +++ b/vrct_gui/_changeMainWindowWidgetsStatus.py @@ -82,23 +82,23 @@ def _changeMainWindowWidgetsStatus(vrct_gui, settings, status, target_names): case "quick_language_settings": if status == "disabled": - vrct_gui.sqls__container_title.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) - vrct_gui.sqls__title_text_your_language.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) - vrct_gui.sqls__title_text_target_language.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) + vrct_gui.sls__container_title.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) + vrct_gui.sls__title_text_your_language.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) + vrct_gui.sls__title_text_target_language.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR) if settings.IS_SIDEBAR_COMPACT_MODE is False: - vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE) - vrct_gui.sqls__optionmenu_your_language.configure(state="disabled") - vrct_gui.sqls__optionmenu_target_language.configure(state="disabled") + vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE) + vrct_gui.sls__optionmenu_your_language.configure(state="disabled") + vrct_gui.sls__optionmenu_target_language.configure(state="disabled") elif status == "normal": - vrct_gui.sqls__container_title.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) - vrct_gui.sqls__title_text_your_language.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) - vrct_gui.sqls__title_text_target_language.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) + vrct_gui.sls__container_title.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) + vrct_gui.sls__title_text_your_language.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) + vrct_gui.sls__title_text_target_language.configure(text_color=settings.ctm.LABELS_TEXT_COLOR) if settings.IS_SIDEBAR_COMPACT_MODE is False: - vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR) - vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR) - vrct_gui.sqls__optionmenu_your_language.configure(state="normal") - vrct_gui.sqls__optionmenu_target_language.configure(state="normal") + vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR) + vrct_gui.current_active_preset_tab.children["!ctklabel"].configure(text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR) + vrct_gui.sls__optionmenu_your_language.configure(state="normal") + vrct_gui.sls__optionmenu_target_language.configure(state="normal") case "config_button": diff --git a/vrct_gui/main_window/widgets/create_sidebar.py b/vrct_gui/main_window/widgets/create_sidebar.py index 5bdb4721..32d0c0c7 100644 --- a/vrct_gui/main_window/widgets/create_sidebar.py +++ b/vrct_gui/main_window/widgets/create_sidebar.py @@ -34,19 +34,6 @@ def createSidebar(settings, main_window): - def toggleTranslationSwitchBox(e): - main_window.translation_switch_box.toggle() - - def toggleTranscriptionSendSwitchBox(e): - main_window.transcription_send_switch_box.toggle() - - def toggleTranscriptionReceiveSwitchBox(e): - main_window.transcription_receive_switch_box.toggle() - - def toggleForegroundSwitchBox(e): - main_window.foreground_switch_box.toggle() - - def changeSidebarFeaturesColorByEvents(ww, event_name): target_frame_widget = getattr(main_window, ww) if event_name == "enter": @@ -75,26 +62,26 @@ def createSidebar(settings, main_window): def switchActiveAndPassivePresetsTabsColor(target_active_widget): quick_setting_tabs = [ - getattr(main_window, "sqls__presets_button_1"), - getattr(main_window, "sqls__presets_button_2"), - getattr(main_window, "sqls__presets_button_3") + getattr(main_window, "sls__presets_button_1"), + getattr(main_window, "sls__presets_button_2"), + getattr(main_window, "sls__presets_button_3") ] switchTabsColor( target_widget=target_active_widget, tab_buttons=quick_setting_tabs, - active_bg_color=settings.ctm.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR, - active_text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR, + active_bg_color=settings.ctm.SLS__PRESETS_TAB_BG_ACTIVE_COLOR, + active_text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR, passive_bg_color=settings.ctm.SIDEBAR_BG_COLOR, - passive_text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE + passive_text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE ) def switchPresetTabFunction(target_active_widget): switchActiveAndPassivePresetsTabsColor(target_active_widget) - switchActiveTabAndPassiveTab(target_active_widget, main_window.current_active_preset_tab, main_window.current_active_preset_tab.passive_function, settings.ctm.SQLS__PRESETS_TAB_BG_HOVERED_COLOR, settings.ctm.SQLS__PRESETS_TAB_BG_CLICKED_COLOR, settings.ctm.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR) + switchActiveTabAndPassiveTab(target_active_widget, main_window.current_active_preset_tab, main_window.current_active_preset_tab.passive_function, settings.ctm.SLS__PRESETS_TAB_BG_HOVERED_COLOR, settings.ctm.SLS__PRESETS_TAB_BG_CLICKED_COLOR, settings.ctm.SLS__PRESETS_TAB_BG_PASSIVE_COLOR) - main_window.sqls__optionmenu_your_language.set(main_window.view_variable.VAR_YOUR_LANGUAGE.get()) - main_window.sqls__optionmenu_target_language.set(main_window.view_variable.VAR_TARGET_LANGUAGE.get()) + main_window.sls__optionmenu_your_language.set(main_window.view_variable.VAR_YOUR_LANGUAGE.get()) + main_window.sls__optionmenu_target_language.set(main_window.view_variable.VAR_TARGET_LANGUAGE.get()) main_window.current_active_preset_tab = target_active_widget @@ -102,19 +89,19 @@ def createSidebar(settings, main_window): def switchToPreset1(e): print("1") callFunctionIfCallable(main_window.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB, "1") - target_active_widget = getattr(main_window, "sqls__presets_button_1") + target_active_widget = getattr(main_window, "sls__presets_button_1") switchPresetTabFunction(target_active_widget) def switchToPreset2(e): print("2") callFunctionIfCallable(main_window.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB, "2") - target_active_widget = getattr(main_window, "sqls__presets_button_2") + target_active_widget = getattr(main_window, "sls__presets_button_2") switchPresetTabFunction(target_active_widget) def switchToPreset3(e): print("3") callFunctionIfCallable(main_window.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB, "3") - target_active_widget = getattr(main_window, "sqls__presets_button_3") + target_active_widget = getattr(main_window, "sls__presets_button_3") switchPresetTabFunction(target_active_widget) @@ -127,8 +114,8 @@ def createSidebar(settings, main_window): height=30, width=width, values=dropdown_menu_values, - button_color=settings.ctm.SQLS__DROPDOWN_MENU_BG_COLOR, - fg_color=settings.ctm.SQLS__DROPDOWN_MENU_BG_COLOR, + button_color=settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR, + fg_color=settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR, text_color=text_color, font=CTkFont(family=settings.FONT_FAMILY, size=font_size, weight="normal"), variable=variable, @@ -141,42 +128,42 @@ def createSidebar(settings, main_window): def createQuickLanguageSettingBox(parent_widget, title_text, title_text_attr_name, optionmenu_attr_name, dropdown_menu_attr_name, dropdown_menu_values, variable): - sqls__box = CTkFrame(parent_widget, corner_radius=0, fg_color=settings.ctm.SQLS__BOX_BG_COLOR, width=0, height=0) + sls__box = CTkFrame(parent_widget, corner_radius=0, fg_color=settings.ctm.SLS__BOX_BG_COLOR, width=0, height=0) - sqls__box.columnconfigure((0,2), weight=1) + sls__box.columnconfigure((0,2), weight=1) - sqls__box_wrapper = CTkFrame(sqls__box, corner_radius=0, fg_color=settings.ctm.SQLS__BOX_BG_COLOR, width=0, height=0) - sqls__box_wrapper.grid(row=2, column=1, padx=0, pady=settings.uism.SQLS__BOX_IPADY) + sls__box_wrapper = CTkFrame(sls__box, corner_radius=0, fg_color=settings.ctm.SLS__BOX_BG_COLOR, width=0, height=0) + sls__box_wrapper.grid(row=2, column=1, padx=0, pady=settings.uism.SLS__BOX_IPADY) - sqls__label = CTkLabel( - sqls__box_wrapper, + sls__label = CTkLabel( + sls__box_wrapper, text=title_text, height=0, - font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SQLS__BOX_SECTION_TITLE_FONT_SIZE, weight="normal"), - text_color=settings.ctm.SQLS__BOX_SECTION_TITLE_TEXT_COLOR + font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SLS__BOX_SECTION_TITLE_FONT_SIZE, weight="normal"), + text_color=settings.ctm.SLS__BOX_SECTION_TITLE_TEXT_COLOR ) - sqls__label.grid(row=0, column=0, pady=(0,settings.uism.SQLS__BOX_SECTION_TITLE_BOTTOM_PADY)) - setattr(main_window, title_text_attr_name, sqls__label) + sls__label.grid(row=0, column=0, pady=(0,settings.uism.SLS__BOX_SECTION_TITLE_BOTTOM_PADY)) + setattr(main_window, title_text_attr_name, sls__label) createOption_DropdownMenu_for_quickSettings( main_window, - sqls__box_wrapper, + sls__box_wrapper, optionmenu_attr_name, dropdown_menu_attr_name, dropdown_menu_values=dropdown_menu_values, # command=self.fakeCommand, - width=settings.uism.SQLS__BOX_DROPDOWN_MENU_WIDTH, - font_size=settings.uism.SQLS__BOX_DROPDOWN_MENU_FONT_SIZE, + width=settings.uism.SLS__BOX_DROPDOWN_MENU_WIDTH, + font_size=settings.uism.SLS__BOX_DROPDOWN_MENU_FONT_SIZE, text_color=settings.ctm.LABELS_TEXT_COLOR, variable=variable, # variable=StringVar(value="Chinese, Cantonese\n(Traditional Hong Kong)"), ) getattr(main_window, optionmenu_attr_name).grid(row=1, column=0, padx=0, pady=0) - return sqls__box + return sls__box @@ -233,44 +220,44 @@ def createSidebar(settings, main_window): "frame_attr_name": "translation_frame", "command": toggleTranslationFeature, "switch_box_attr_name": "translation_switch_box", - "toggle_switch_box_command": toggleTranslationSwitchBox, + "toggle_switch_box_command": lambda e: main_window.translation_switch_box.toggle(), "label_attr_name": "label_translation", "compact_mode_icon_attr_name": "translation_compact_mode_icon", "selected_mark_attr_name": "translation_selected_mark", - "text": "Translation", + "var_label_text": main_window.view_variable.VAR_LABEL_TRANSLATION, "icon_file_name": settings.image_filename.TRANSLATION_ICON, }, { "frame_attr_name": "transcription_send_frame", "command": toggleTranscriptionSendFeature, "switch_box_attr_name": "transcription_send_switch_box", - "toggle_switch_box_command": toggleTranscriptionSendSwitchBox, + "toggle_switch_box_command": lambda e: main_window.transcription_send_switch_box.toggle(), "label_attr_name": "label_transcription_send", "compact_mode_icon_attr_name": "transcription_send_compact_mode_icon", "selected_mark_attr_name": "transcription_send_selected_mark", - "text": "Voice2Chatbox", + "var_label_text": main_window.view_variable.VAR_LABEL_TRANSCRIPTION_SEND, "icon_file_name": settings.image_filename.MIC_ICON, }, { "frame_attr_name": "transcription_receive_frame", "command": toggleTranscriptionReceiveFeature, "switch_box_attr_name": "transcription_receive_switch_box", - "toggle_switch_box_command": toggleTranscriptionReceiveSwitchBox, + "toggle_switch_box_command": lambda e: main_window.transcription_receive_switch_box.toggle(), "label_attr_name": "label_transcription_receive", "compact_mode_icon_attr_name": "transcription_receive_compact_mode_icon", "selected_mark_attr_name": "transcription_receive_selected_mark", - "text": "Speaker2Log", + "var_label_text": main_window.view_variable.VAR_LABEL_TRANSCRIPTION_RECEIVE, "icon_file_name": settings.image_filename.HEADPHONES_ICON, }, { "frame_attr_name": "foreground_frame", "command": toggleForegroundFeature, "switch_box_attr_name": "foreground_switch_box", - "toggle_switch_box_command": toggleForegroundSwitchBox, + "toggle_switch_box_command": lambda e: main_window.foreground_switch_box.toggle(), "label_attr_name": "label_foreground", "compact_mode_icon_attr_name": "foreground_compact_mode_icon", "selected_mark_attr_name": "foreground_selected_mark", - "text": "Foreground", + "var_label_text": main_window.view_variable.VAR_LABEL_FOREGROUND, "icon_file_name": settings.image_filename.FOREGROUND_ICON, }, ] @@ -286,7 +273,7 @@ def createSidebar(settings, main_window): label_attr_name = sfs["label_attr_name"] compact_mode_icon_attr_name = sfs["compact_mode_icon_attr_name"] selected_mark_attr_name = sfs["selected_mark_attr_name"] - text = sfs["text"] + var_label_text = sfs["var_label_text"] icon_file_name = sfs["icon_file_name"] frame_widget = CTkFrame(main_window.sidebar_features_container, corner_radius=0, fg_color=settings.ctm.SF__BG_COLOR, cursor="hand2", width=0, height=0) @@ -297,7 +284,7 @@ def createSidebar(settings, main_window): label_widget = CTkLabel( frame_widget, - text=text, + textvariable=var_label_text, height=0, corner_radius=0, font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SF__LABEL_FONT_SIZE, weight="normal"), @@ -397,46 +384,46 @@ def createSidebar(settings, main_window): # Sidebar Quick Language Settings, SQLS - main_window.sqls__container = CTkFrame(main_window.sidebar_bg_container, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0) + main_window.sls__container = CTkFrame(main_window.sidebar_bg_container, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0) if settings.IS_SIDEBAR_COMPACT_MODE is False: - main_window.sqls__container.grid(row=2, column=0, sticky="new") + main_window.sls__container.grid(row=2, column=0, sticky="new") - main_window.sqls__container.grid_columnconfigure(0, weight=1) + main_window.sls__container.grid_columnconfigure(0, weight=1) - main_window.sqls__container_title = CTkLabel(main_window.sqls__container, + main_window.sls__container_title = CTkLabel(main_window.sls__container, # text="言語設定", text="Language Settings", height=0, - font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SQLS__TITLE_FONT_SIZE, weight="normal"), - text_color=settings.ctm.SQLS__TITLE_TEXT_COLOR + font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SLS__TITLE_FONT_SIZE, weight="normal"), + text_color=settings.ctm.SLS__TITLE_TEXT_COLOR ) - main_window.sqls__container_title.grid(row=0, column=0, pady=settings.uism.SQLS__TITLE_PADY, sticky="nsew") + main_window.sls__container_title.grid(row=0, column=0, pady=settings.uism.SLS__TITLE_PADY, sticky="nsew") # Presets buttons main_window.sidebar_bg_container.grid_rowconfigure(2, weight=1) - main_window.sqls__presets_buttons_box = CTkFrame(main_window.sqls__container, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0) - main_window.sqls__presets_buttons_box.grid(row=1, column=0, sticky="ew") + main_window.sls__presets_buttons_box = CTkFrame(main_window.sls__container, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0) + main_window.sls__presets_buttons_box.grid(row=1, column=0, sticky="ew") - main_window.sqls__presets_buttons_box.grid_columnconfigure((0,1,2), weight=1) + main_window.sls__presets_buttons_box.grid_columnconfigure((0,1,2), weight=1) preset_tabs_settings = [ { - "preset_tab_attr_name": "sqls__presets_button_1", + "preset_tab_attr_name": "sls__presets_button_1", "command": switchToPreset1, "text": "1", }, { - "preset_tab_attr_name": "sqls__presets_button_2", + "preset_tab_attr_name": "sls__presets_button_2", "command": switchToPreset2, "text": "2", }, { - "preset_tab_attr_name": "sqls__presets_button_3", + "preset_tab_attr_name": "sls__presets_button_3", "command": switchToPreset3, "text": "3", }, @@ -452,9 +439,9 @@ def createSidebar(settings, main_window): main_window, preset_tab_attr_name, CTkFrame( - main_window.sqls__presets_buttons_box, + main_window.sls__presets_buttons_box, corner_radius=0, - fg_color=settings.ctm.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR, + fg_color=settings.ctm.SLS__PRESETS_TAB_BG_PASSIVE_COLOR, width=0, height=30, cursor="hand2", @@ -467,17 +454,17 @@ def createSidebar(settings, main_window): parent_widget, text=text, height=0, - fg_color=settings.ctm.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR, - font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SQLS__PRESET_TAB_NUMBER_FONT_SIZE, weight="bold"), + fg_color=settings.ctm.SLS__PRESETS_TAB_BG_PASSIVE_COLOR, + font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SLS__PRESET_TAB_NUMBER_FONT_SIZE, weight="bold"), anchor="center", - text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE + text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE ) label_widget.place(relx=0.5, rely=0.5, anchor="center") - bindEnterAndLeaveColor([parent_widget, label_widget], settings.ctm.SQLS__PRESETS_TAB_BG_HOVERED_COLOR, settings.ctm.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR) - bindButtonPressColor([parent_widget, label_widget], settings.ctm.SQLS__PRESETS_TAB_BG_CLICKED_COLOR, settings.ctm.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR) + bindEnterAndLeaveColor([parent_widget, label_widget], settings.ctm.SLS__PRESETS_TAB_BG_HOVERED_COLOR, settings.ctm.SLS__PRESETS_TAB_BG_PASSIVE_COLOR) + bindButtonPressColor([parent_widget, label_widget], settings.ctm.SLS__PRESETS_TAB_BG_CLICKED_COLOR, settings.ctm.SLS__PRESETS_TAB_BG_PASSIVE_COLOR) parent_widget.passive_function = command bindButtonReleaseFunction([parent_widget, label_widget], command) @@ -486,72 +473,72 @@ def createSidebar(settings, main_window): # Quick Language settings BOX - main_window.sqls__box_frame = CTkFrame(main_window.sqls__container, corner_radius=0, fg_color=settings.ctm.SQLS__BG_COLOR, width=0, height=0) - main_window.sqls__box_frame.grid(row=2, column=0, sticky="ew") - main_window.sqls__box_frame.grid_columnconfigure(0, weight=1) + main_window.sls__box_frame = CTkFrame(main_window.sls__container, corner_radius=0, fg_color=settings.ctm.SLS__BG_COLOR, width=0, height=0) + main_window.sls__box_frame.grid(row=2, column=0, sticky="ew") + main_window.sls__box_frame.grid_columnconfigure(0, weight=1) # Your language - main_window.sqls__box_your_language = createQuickLanguageSettingBox( - parent_widget=main_window.sqls__box_frame, + main_window.sls__box_your_language = createQuickLanguageSettingBox( + parent_widget=main_window.sls__box_frame, # title_text="あなたの言語", title_text="Your Language", - title_text_attr_name="sqls__title_text_your_language", - optionmenu_attr_name="sqls__optionmenu_your_language", - dropdown_menu_attr_name="sqls__dropdown_menu_your_language", + title_text_attr_name="sls__title_text_your_language", + optionmenu_attr_name="sls__optionmenu_your_language", + dropdown_menu_attr_name="sls__dropdown_menu_your_language", dropdown_menu_values=["1""2","pppp\npppp"], variable=main_window.view_variable.VAR_YOUR_LANGUAGE ) - main_window.sqls__box_your_language.grid(row=2, column=0, padx=0, pady=(settings.uism.SQLS__BOX_TOP_PADY,0),sticky="ew") + main_window.sls__box_your_language.grid(row=2, column=0, padx=0, pady=(settings.uism.SLS__BOX_TOP_PADY,0),sticky="ew") # Both direction arrow icon - main_window.sqls__arrow_direction_box = CTkFrame(main_window.sqls__box_frame, corner_radius=0, fg_color=settings.ctm.SQLS__BG_COLOR, width=0, height=0) - main_window.sqls__arrow_direction_box.grid(row=3, column=0, padx=0, pady=settings.uism.SQLS__BOX_ARROWS_PADY,sticky="ew") + main_window.sls__arrow_direction_box = CTkFrame(main_window.sls__box_frame, corner_radius=0, fg_color=settings.ctm.SLS__BG_COLOR, width=0, height=0) + main_window.sls__arrow_direction_box.grid(row=3, column=0, padx=0, pady=settings.uism.SLS__BOX_ARROWS_PADY,sticky="ew") - main_window.sqls__arrow_direction_box.grid_columnconfigure((0,4), weight=1) + main_window.sls__arrow_direction_box.grid_columnconfigure((0,4), weight=1) - main_window.sqls__both_direction_up = CTkLabel( - main_window.sqls__arrow_direction_box, + main_window.sls__both_direction_up = CTkLabel( + main_window.sls__arrow_direction_box, text=None, height=0, - image=CTkImage(getImageFileFromUiUtils(settings.image_filename.NARROW_ARROW_DOWN).rotate(180),size=settings.uism.SQLS__BOX_ARROWS_IMAGE_SIZE) + image=CTkImage(getImageFileFromUiUtils(settings.image_filename.NARROW_ARROW_DOWN).rotate(180),size=settings.uism.SLS__BOX_ARROWS_IMAGE_SIZE) ) - main_window.sqls__both_direction_up.grid(row=0, column=1, pady=0) + main_window.sls__both_direction_up.grid(row=0, column=1, pady=0) - main_window.sqls__both_direction_desc = CTkLabel( - main_window.sqls__arrow_direction_box, + main_window.sls__both_direction_desc = CTkLabel( + main_window.sls__arrow_direction_box, # text="双方向に翻訳", text="Translate Each Other", height=0, - font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SQLS__BOX_ARROWS_DESC_FONT_SIZE, weight="normal"), - text_color=settings.ctm.SQLS__BOX_ARROWS_TEXT_COLOR, + font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.SLS__BOX_ARROWS_DESC_FONT_SIZE, weight="normal"), + text_color=settings.ctm.SLS__BOX_ARROWS_TEXT_COLOR, ) - main_window.sqls__both_direction_desc.grid(row=0, column=2, padx=settings.uism.SQLS__BOX_ARROWS_DESC_PADX, pady=0) + main_window.sls__both_direction_desc.grid(row=0, column=2, padx=settings.uism.SLS__BOX_ARROWS_DESC_PADX, pady=0) - main_window.sqls__both_direction_label_down = CTkLabel( - main_window.sqls__arrow_direction_box, + main_window.sls__both_direction_label_down = CTkLabel( + main_window.sls__arrow_direction_box, text=None, height=0, - image=CTkImage(getImageFileFromUiUtils(settings.image_filename.NARROW_ARROW_DOWN).rotate(0),size=settings.uism.SQLS__BOX_ARROWS_IMAGE_SIZE) + image=CTkImage(getImageFileFromUiUtils(settings.image_filename.NARROW_ARROW_DOWN).rotate(0),size=settings.uism.SLS__BOX_ARROWS_IMAGE_SIZE) ) - main_window.sqls__both_direction_label_down.grid(row=0, column=3, pady=0) + main_window.sls__both_direction_label_down.grid(row=0, column=3, pady=0) # Target language - main_window.sqls__box_target_language = createQuickLanguageSettingBox( - parent_widget=main_window.sqls__box_frame, + main_window.sls__box_target_language = createQuickLanguageSettingBox( + parent_widget=main_window.sls__box_frame, # title_text="相手の言語", title_text="Target Language", - title_text_attr_name="sqls__title_text_target_language", - optionmenu_attr_name="sqls__optionmenu_target_language", - dropdown_menu_attr_name="sqls__dropdown_menu_target_language", + title_text_attr_name="sls__title_text_target_language", + optionmenu_attr_name="sls__optionmenu_target_language", + dropdown_menu_attr_name="sls__dropdown_menu_target_language", dropdown_menu_values=["1""2","pppp\npppp2"], variable=main_window.view_variable.VAR_TARGET_LANGUAGE ) - main_window.sqls__box_target_language.grid(row=4, column=0, padx=0, pady=(0,0),sticky="ew") + main_window.sls__box_target_language.grid(row=4, column=0, padx=0, pady=(0,0),sticky="ew") diff --git a/vrct_gui/main_window/widgets/create_textbox.py b/vrct_gui/main_window/widgets/create_textbox.py index c2d6f813..eb301ba5 100644 --- a/vrct_gui/main_window/widgets/create_textbox.py +++ b/vrct_gui/main_window/widgets/create_textbox.py @@ -52,7 +52,7 @@ def createTextbox(settings, main_window): target_widget=target_active_widget, tab_buttons=textbox_tabs, active_bg_color=settings.ctm.TEXTBOX_BG_COLOR, - active_text_color=settings.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR, + active_text_color=settings.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR, passive_bg_color=settings.ctm.TEXTBOX_TAB_BG_PASSIVE_COLOR, passive_text_color=settings.ctm.TEXTBOX_TAB_TEXT_PASSIVE_COLOR ) diff --git a/vrct_gui/ui_managers/ColorThemeManager.py b/vrct_gui/ui_managers/ColorThemeManager.py index 5e229326..9189035b 100644 --- a/vrct_gui/ui_managers/ColorThemeManager.py +++ b/vrct_gui/ui_managers/ColorThemeManager.py @@ -116,23 +116,23 @@ class ColorThemeManager(): self.main.SF__SELECTED_MARK_DISABLE_BG_COLOR = self.main.SF__SWITCH_BOX_DISABLE_BG_COLOR - # Sidebar quick settings - self.main.SQLS__TITLE_TEXT_COLOR = self.DARK_400_COLOR + # Sidebar Languages Settings + self.main.SLS__TITLE_TEXT_COLOR = self.DARK_400_COLOR - self.main.SQLS__BG_COLOR = self.DARK_825_COLOR + self.main.SLS__BG_COLOR = self.DARK_825_COLOR - self.main.SQLS__PRESETS_TAB_BG_HOVERED_COLOR = self.DARK_850_COLOR - self.main.SQLS__PRESETS_TAB_BG_CLICKED_COLOR = self.DARK_888_COLOR - self.main.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR = self.main.SIDEBAR_BG_COLOR - self.main.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR = self.main.SQLS__BG_COLOR - self.main.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE = self.DARK_600_COLOR - self.main.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR = self.main.BASIC_TEXT_COLOR + self.main.SLS__PRESETS_TAB_BG_HOVERED_COLOR = self.DARK_850_COLOR + self.main.SLS__PRESETS_TAB_BG_CLICKED_COLOR = self.DARK_888_COLOR + self.main.SLS__PRESETS_TAB_BG_PASSIVE_COLOR = self.main.SIDEBAR_BG_COLOR + self.main.SLS__PRESETS_TAB_BG_ACTIVE_COLOR = self.main.SLS__BG_COLOR + self.main.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE = self.DARK_600_COLOR + self.main.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR = self.main.BASIC_TEXT_COLOR - self.main.SQLS__BOX_BG_COLOR = self.DARK_850_COLOR - self.main.SQLS__BOX_SECTION_TITLE_TEXT_COLOR = self.DARK_400_COLOR - self.main.SQLS__BOX_ARROWS_TEXT_COLOR = self.DARK_500_COLOR + self.main.SLS__BOX_BG_COLOR = self.DARK_850_COLOR + self.main.SLS__BOX_SECTION_TITLE_TEXT_COLOR = self.DARK_400_COLOR + self.main.SLS__BOX_ARROWS_TEXT_COLOR = self.DARK_500_COLOR - self.main.SQLS__DROPDOWN_MENU_BG_COLOR = self.DARK_900_COLOR + self.main.SLS__DROPDOWN_MENU_BG_COLOR = self.DARK_900_COLOR self.main.CONFIG_BUTTON_BG_COLOR = self.main.SIDEBAR_BG_COLOR @@ -267,22 +267,22 @@ class ColorThemeManager(): # Sidebar quick settings - self.main.SQLS__TITLE_TEXT_COLOR = self.LIGHT_800_COLOR + self.main.SLS__TITLE_TEXT_COLOR = self.LIGHT_800_COLOR - self.main.SQLS__BG_COLOR = self.LIGHT_300_COLOR + self.main.SLS__BG_COLOR = self.LIGHT_300_COLOR - self.main.SQLS__PRESETS_TAB_BG_HOVERED_COLOR = self.LIGHT_350_COLOR - self.main.SQLS__PRESETS_TAB_BG_CLICKED_COLOR = self.LIGHT_800_COLOR - self.main.SQLS__PRESETS_TAB_BG_PASSIVE_COLOR = self.main.SIDEBAR_BG_COLOR - self.main.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR = self.main.SQLS__BG_COLOR - self.main.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE = self.LIGHT_600_COLOR - self.main.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR = self.main.BASIC_TEXT_COLOR + self.main.SLS__PRESETS_TAB_BG_HOVERED_COLOR = self.LIGHT_350_COLOR + self.main.SLS__PRESETS_TAB_BG_CLICKED_COLOR = self.LIGHT_800_COLOR + self.main.SLS__PRESETS_TAB_BG_PASSIVE_COLOR = self.main.SIDEBAR_BG_COLOR + self.main.SLS__PRESETS_TAB_BG_ACTIVE_COLOR = self.main.SLS__BG_COLOR + self.main.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR_PASSIVE = self.LIGHT_600_COLOR + self.main.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR = self.main.BASIC_TEXT_COLOR - self.main.SQLS__BOX_BG_COLOR = self.LIGHT_350_COLOR - self.main.SQLS__BOX_SECTION_TITLE_TEXT_COLOR = self.LIGHT_800_COLOR - self.main.SQLS__BOX_ARROWS_TEXT_COLOR = self.LIGHT_700_COLOR + self.main.SLS__BOX_BG_COLOR = self.LIGHT_350_COLOR + self.main.SLS__BOX_SECTION_TITLE_TEXT_COLOR = self.LIGHT_800_COLOR + self.main.SLS__BOX_ARROWS_TEXT_COLOR = self.LIGHT_700_COLOR - self.main.SQLS__DROPDOWN_MENU_BG_COLOR = self.LIGHT_500_COLOR + self.main.SLS__DROPDOWN_MENU_BG_COLOR = self.LIGHT_500_COLOR self.main.CONFIG_BUTTON_BG_COLOR = self.main.SIDEBAR_BG_COLOR diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index 2cbb2142..e7d244b2 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -55,21 +55,21 @@ class UiScalingManager(): # Sidebar Quick Language Settings, SQLS - self.main.SQLS__TITLE_FONT_SIZE = self._calculateUiSize(16) - self.main.SQLS__TITLE_PADY = (self._calculateUiSize(12), self._calculateUiSize(6)) + self.main.SLS__TITLE_FONT_SIZE = self._calculateUiSize(16) + self.main.SLS__TITLE_PADY = (self._calculateUiSize(12), self._calculateUiSize(6)) - self.main.SQLS__PRESET_TAB_NUMBER_FONT_SIZE = self._calculateUiSize(16) + self.main.SLS__PRESET_TAB_NUMBER_FONT_SIZE = self._calculateUiSize(16) - self.main.SQLS__BOX_SECTION_TITLE_FONT_SIZE = self._calculateUiSize(16) - self.main.SQLS__BOX_SECTION_TITLE_BOTTOM_PADY = self._calculateUiSize(10) - self.main.SQLS__BOX_IPADY = (self._calculateUiSize(8),self._calculateUiSize(18)) - self.main.SQLS__BOX_DROPDOWN_MENU_FONT_SIZE = self._calculateUiSize(14) - self.main.SQLS__BOX_DROPDOWN_MENU_WIDTH = self._calculateUiSize(200) - self.main.SQLS__BOX_ARROWS_PADY = self._calculateUiSize(10) - self.main.SQLS__BOX_ARROWS_IMAGE_SIZE = self.dupTuple(self._calculateUiSize(16)) - self.main.SQLS__BOX_ARROWS_DESC_FONT_SIZE = self._calculateUiSize(12) - self.main.SQLS__BOX_ARROWS_DESC_PADX = self._calculateUiSize(6) - self.main.SQLS__BOX_TOP_PADY = self._calculateUiSize(16) + self.main.SLS__BOX_SECTION_TITLE_FONT_SIZE = self._calculateUiSize(16) + self.main.SLS__BOX_SECTION_TITLE_BOTTOM_PADY = self._calculateUiSize(10) + self.main.SLS__BOX_IPADY = (self._calculateUiSize(8),self._calculateUiSize(18)) + self.main.SLS__BOX_DROPDOWN_MENU_FONT_SIZE = self._calculateUiSize(14) + self.main.SLS__BOX_DROPDOWN_MENU_WIDTH = self._calculateUiSize(200) + self.main.SLS__BOX_ARROWS_PADY = self._calculateUiSize(10) + self.main.SLS__BOX_ARROWS_IMAGE_SIZE = self.dupTuple(self._calculateUiSize(16)) + self.main.SLS__BOX_ARROWS_DESC_FONT_SIZE = self._calculateUiSize(12) + self.main.SLS__BOX_ARROWS_DESC_PADX = self._calculateUiSize(6) + self.main.SLS__BOX_TOP_PADY = self._calculateUiSize(16) self.main.SIDEBAR_CONFIG_BUTTON_CORNER_RADIUS = self._calculateUiSize(6) self.main.SIDEBAR_CONFIG_BUTTON_PADX = self._calculateUiSize(10) diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index 89e7804c..94de0c32 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -69,11 +69,11 @@ class VRCT_GUI(CTk): ) def setDefaultActiveLanguagePresetTab(self, tab_no:str): - self.current_active_preset_tab = getattr(self, f"sqls__presets_button_{tab_no}") + self.current_active_preset_tab = getattr(self, f"sls__presets_button_{tab_no}") _setDefaultActiveTab( active_tab_widget=self.current_active_preset_tab, - active_bg_color=self.settings.main.ctm.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR, - active_text_color=self.settings.main.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR + active_bg_color=self.settings.main.ctm.SLS__PRESETS_TAB_BG_ACTIVE_COLOR, + active_text_color=self.settings.main.ctm.SLS__PRESETS_TAB_ACTIVE_TEXT_COLOR )