Main Window: Language Settingの変数YOUR_LANGUAGEとTARGET_LANGUAGEをview.pyに移動。

tab切り替わり時に、UI側でvariableをなぜか新たにセットしていたので修正(set関数を使って)
This commit is contained in:
Sakamoto Shiina
2023-09-02 05:27:52 +09:00
parent fa82961eb3
commit ce65a36b8d
4 changed files with 12 additions and 22 deletions

View File

@@ -8,14 +8,6 @@ from ..ui_utils import createButtonWithImage, getImagePath
def createMainWindowWidgets(vrct_gui, settings):
vrct_gui.protocol("WM_DELETE_WINDOW", vrct_gui.quitVRCT)
# self.IS_DEVELOPER_MODE = False
# self.IS_DEVELOPER_MODE = True
# self.YOUR_LANGUAGE = "Japanese\n(Japan)"
# self.TARGET_LANGUAGE = "English\n(United States)"
vrct_gui.iconbitmap(getImagePath("app.ico"))
vrct_gui.title("VRCT")
@@ -27,7 +19,6 @@ def createMainWindowWidgets(vrct_gui, settings):
vrct_gui.grid_columnconfigure(1, weight=1)
vrct_gui.configure(fg_color="#ff7f50")
# return
# Main Container

View File

@@ -93,8 +93,8 @@ def createSidebar(settings, main_window):
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)
main_window.sqls__optionmenu_your_language.configure(variable=StringVar(value=main_window.YOUR_LANGUAGE))
main_window.sqls__optionmenu_target_language.configure(variable=StringVar(value=main_window.TARGET_LANGUAGE))
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.current_active_preset_tab = target_active_widget
@@ -499,7 +499,7 @@ def createSidebar(settings, main_window):
optionmenu_attr_name="sqls__optionmenu_your_language",
dropdown_menu_attr_name="sqls__dropdown_menu_your_language",
dropdown_menu_values=["1""2","pppp\npppp"],
variable=StringVar(value=main_window.YOUR_LANGUAGE)
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")
@@ -549,7 +549,7 @@ def createSidebar(settings, main_window):
optionmenu_attr_name="sqls__optionmenu_target_language",
dropdown_menu_attr_name="sqls__dropdown_menu_target_language",
dropdown_menu_values=["1""2","pppp\npppp2"],
variable=StringVar(value=main_window.TARGET_LANGUAGE)
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")