From 4c0f356ee195955ff08df31ac34c33b8e81dccd3 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:58:33 +0900 Subject: [PATCH 1/7] [Chore] remove the code that is no longer in use. and fixed some comments. --- view.py | 13 +++++-------- vrct_gui/_printToTextbox.py | 28 ++-------------------------- vrct_gui/vrct_gui.py | 5 ++--- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/view.py b/view.py index d1b8d688..2015937c 100644 --- a/view.py +++ b/view.py @@ -350,6 +350,7 @@ class View(): self.view_variable.CALLBACK_SET_OSC_IP_ADDRESS = config_window_registers.get("callback_set_osc_ip_address", None) self.view_variable.CALLBACK_SET_OSC_PORT = config_window_registers.get("callback_set_osc_port", None) + # Insert sample conversation for testing. # self._insertSampleConversationToTextbox() @@ -446,16 +447,15 @@ class View(): - def printToTextbox_SentMessage(self, original_message, translated_message, actual_sent_message=None): - self._printToTextbox_Sent(original_message, translated_message, actual_sent_message) + def printToTextbox_SentMessage(self, original_message, translated_message): + self._printToTextbox_Sent(original_message, translated_message) @staticmethod - def _printToTextbox_Sent(original_message, translated_message, actual_sent_message=None): + def _printToTextbox_Sent(original_message, translated_message): vrct_gui.printToTextbox( target_type="SENT", original_message=original_message, translated_message=translated_message, - actual_sent_message=actual_sent_message, ) @@ -628,7 +628,7 @@ class View(): - # These conversation is generated by ChatGPT + # These conversations are generated by ChatGPT def _insertSampleConversationToTextbox(self): self.printToTextbox_enableTranscriptionSend() @@ -738,10 +738,7 @@ class View(): ] for data in conversation_data: if data.get("me", None) is not None: - # actual_sent_message = config.MESSAGE_FORMAT.replace("[message]", data.get("me", None)) - # actual_sent_message = actual_sent_message.replace("[translation]", data.get("me_t", None)) self.printToTextbox_SentMessage(data.get("me", None), data.get("me_t", None)) - # self.printToTextbox_SentMessage(data.get("me", None), data.get("me_t", None), actual_sent_message) if data.get("target", None) is not None: self.printToTextbox_ReceivedMessage(data.get("target", None), data.get("target_t", None)) diff --git a/vrct_gui/_printToTextbox.py b/vrct_gui/_printToTextbox.py index 8854071f..cb732f81 100644 --- a/vrct_gui/_printToTextbox.py +++ b/vrct_gui/_printToTextbox.py @@ -1,7 +1,7 @@ from datetime import datetime from customtkinter import CTkFont -def _printToTextbox(vrct_gui, settings, target_type, original_message=None, translated_message=None, actual_sent_message=None, tags=None, disable_print_to_textbox_all:bool=False): +def _printToTextbox(vrct_gui, settings, target_type, original_message=None, translated_message=None, tags=None, disable_print_to_textbox_all:bool=False): now_raw_data = datetime.now() # now = now_raw_data.strftime("%H:%M:%S") now_hm = now_raw_data.strftime("%H:%M") @@ -72,8 +72,6 @@ def _printToTextbox(vrct_gui, settings, target_type, original_message=None, tran target_textbox.insert("end", original_message, ("SENT_SUB_TEXT", "SENT_SECONDARY_TEXT_FONT", "JUSTIFY_RIGHT")) target_textbox.insert("end", "\n") target_textbox.insert("end", translated_message, ("SENT_TEXT", "SENT_MAIN_TEXT_FONT", "JUSTIFY_RIGHT")) - # _actual_sent_message = "" if actual_sent_message is None else actual_sent_message - # target_textbox.insert("end", _actual_sent_message, ("SENT_TEXT", "SENT_MAIN_TEXT_FONT", "JUSTIFY_RIGHT")) else: target_textbox.insert("end", original_message, ("SENT_TEXT", "SENT_MAIN_TEXT_FONT", "JUSTIFY_RIGHT")) @@ -95,26 +93,4 @@ def _printToTextbox(vrct_gui, settings, target_type, original_message=None, tran printEachTextbox(target_textbox) # To automatically print the same log to the textbox_all widget as well. - if disable_print_to_textbox_all is not True: printEachTextbox(vrct_gui.textbox_all) - - - - # target_textbox.tag_config("ERROR", foreground="#FF0000") - - # target_textbox.tag_config("SYSTEM", justify="center") - # target_textbox.tag_config("SYSTEM_TAG", foreground="#1BFF00") - - # target_textbox.tag_config("SENT", justify="left") - # target_textbox.tag_config("SENT_COLOR", foreground="#0378e2") - - # target_textbox.tag_config("RECEIVED", justify="left") - # target_textbox.tag_config("RECEIVED_COLOR", foreground="#ffa500") - - - # target_textbox.configure(state="normal") - # target_textbox.insert("end", f"[{tags}] ", ("START", "LABEL", tags, f"{tags}_COLOR")) - # target_textbox.insert("end", f"{now_hm} ", ("TIMESTAMP", tags)) - # target_textbox.insert("end", f"{original_message}\n", ("SECONDARY_TEXT_FONT", "MAIN_TEXT_COLOR", tags)) - # target_textbox.insert("end", f"{translated_message}\n", ("MAIN_TEXT_FONT", "MAIN_TEXT_COLOR", tags)) - # target_textbox.configure(state="disabled") - # target_textbox.see("end") \ No newline at end of file + if disable_print_to_textbox_all is not True: printEachTextbox(vrct_gui.textbox_all) \ No newline at end of file diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index ea23f65b..25c67b57 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -14,7 +14,7 @@ from .main_window import createMainWindowWidgets from .config_window import ConfigWindow from .ui_utils import _setDefaultActiveTab -from .main_window.widgets import createSidebar, createMinimizeSidebarButton +from .main_window.widgets import createMinimizeSidebarButton class VRCT_GUI(CTk): @@ -125,14 +125,13 @@ class VRCT_GUI(CTk): target_names=target_names, ) - def printToTextbox(self, target_type, original_message=None, translated_message=None, actual_sent_message=None): + def printToTextbox(self, target_type, original_message=None, translated_message=None): _printToTextbox( vrct_gui=self, settings=self.settings.main, target_type=target_type, original_message=original_message, translated_message=translated_message, - actual_sent_message=actual_sent_message, tags=target_type, ) From 34cd261128329b82ae8e400a858cc0f9062d82d0 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:40:36 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[Add]=20Config=20Window=E9=96=8B=E9=96=89?= =?UTF-8?q?=E6=99=82=E3=81=AECALLBACK=E9=96=A2=E6=95=B0=E3=81=AE=E5=8F=97?= =?UTF-8?q?=E3=81=91=E5=8F=96=E3=82=8A=E3=80=81=E5=AE=9F=E8=A1=8C=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 +++++ view.py | 14 ++++++++++++++ vrct_gui/vrct_gui.py | 5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8ac04026..81071fc4 100644 --- a/main.py +++ b/main.py @@ -540,6 +540,11 @@ if config.ENABLE_LOGGER is True: # set UI and callback view.register( + window_action_registers={ + "callback_open_config_window": callbackOpenConfigWindow, + "callback_close_config_window": callbackCloseConfigWindow, + }, + sidebar_features_registers={ "callback_toggle_translation": callbackToggleTranslation, "callback_toggle_transcription_send": callbackToggleTranscriptionSend, diff --git a/view.py b/view.py index 2015937c..ea7d1e71 100644 --- a/view.py +++ b/view.py @@ -43,6 +43,11 @@ class View(): ) self.view_variable = SimpleNamespace( + # Open Config Window + CALLBACK_OPEN_CONFIG_WINDOW=None, + CALLBACK_CLOSE_CONFIG_WINDOW=None, + + # Main Window # Sidebar # Sidebar Compact Mode @@ -255,12 +260,21 @@ class View(): def register( self, + window_action_registers=None, sidebar_features_registers=None, language_presets_registers=None, entry_message_box_registers=None, config_window_registers=None ): + + # Open Config Window + if window_action_registers is not None: + self.view_variable.CALLBACK_OPEN_CONFIG_WINDOW=window_action_registers.get("callback_open_config_window", None) + self.view_variable.CALLBACK_CLOSE_CONFIG_WINDOW=window_action_registers.get("callback_close_config_window", None) + + + self.view_variable.CALLBACK_TOGGLE_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = self._toggleMainWindowSidebarCompactMode if sidebar_features_registers is not None: diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index 25c67b57..8ac42492 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -1,5 +1,3 @@ -from types import SimpleNamespace - from customtkinter import CTk, CTkImage # from window_help_and_info import ToplevelWindowInformation @@ -16,6 +14,7 @@ from .ui_utils import _setDefaultActiveTab from .main_window.widgets import createMinimizeSidebarButton +from utils import callFunctionIfCallable class VRCT_GUI(CTk): def __init__(self): @@ -54,12 +53,14 @@ class VRCT_GUI(CTk): def openConfigWindow(self, e): + callFunctionIfCallable(self._view_variable.CALLBACK_OPEN_CONFIG_WINDOW) self.config_window.deiconify() self.config_window.focus_set() self.config_window.focus() self.config_window.grab_set() def closeConfigWindow(self): + callFunctionIfCallable(self._view_variable.CALLBACK_CLOSE_CONFIG_WINDOW) self.config_window.withdraw() self.config_window.grab_release() From 41d8e9ca87ec8a8ee7eb7390cb1b2fc4b991cf14 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:33:44 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[Refactor]=20view.py=E7=B3=BB=E3=81=AE?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E5=90=8D=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 46 +++++++++++++++++++--------------------------- view.py | 16 ++++++++-------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/main.py b/main.py index 81071fc4..a4f60f3f 100644 --- a/main.py +++ b/main.py @@ -248,18 +248,18 @@ def callbackCloseConfigWindow(): def callbackEnableConfigWindowCompactMode(): config.IS_CONFIG_WINDOW_COMPACT_MODE = True model.stopCheckMicEnergy() - view.replaceConfigWindowMicThresholdCheckButtonToPassive() + view.replaceMicThresholdCheckButton_Passive() model.stopCheckSpeakerEnergy() - view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() + view.replaceSpeakerThresholdCheckButton_Passive() view.reloadConfigWindowSettingBoxContainer() def callbackDisableConfigWindowCompactMode(): config.IS_CONFIG_WINDOW_COMPACT_MODE = False model.stopCheckMicEnergy() - view.replaceConfigWindowMicThresholdCheckButtonToPassive() + view.replaceMicThresholdCheckButton_Passive() model.stopCheckSpeakerEnergy() - view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() + view.replaceSpeakerThresholdCheckButton_Passive() view.reloadConfigWindowSettingBoxContainer() @@ -308,14 +308,14 @@ def callbackSetMicHost(value): view.updateList_MicDevice(model.getListInputDevice()) model.stopCheckMicEnergy() - view.replaceConfigWindowMicThresholdCheckButtonToPassive() + view.replaceMicThresholdCheckButton_Passive() def callbackSetMicDevice(value): print("callbackSetMicDevice", value) config.CHOICE_MIC_DEVICE = value model.stopCheckMicEnergy() - view.replaceConfigWindowMicThresholdCheckButtonToPassive() + view.replaceMicThresholdCheckButton_Passive() def callbackSetMicEnergyThreshold(value): print("callbackSetMicEnergyThreshold", value) @@ -344,19 +344,15 @@ def setProgressBarMicEnergy(energy): def callbackCheckMicThreshold(is_turned_on): print("callbackCheckMicThreshold", is_turned_on) if is_turned_on is True: - # view.setConfigWindowCompactModeSwitchStatusToDisabled() - - view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() + view.setWidgetsStatus_ThresholdCheckButton_Disabled() model.startCheckMicEnergy(setProgressBarMicEnergy) - view.replaceConfigWindowMicThresholdCheckButtonToActive() - view.setConfigWindowThresholdCheckWidgetsStatusToNormal() + view.replaceMicThresholdCheckButton_Active() + view.setWidgetsStatus_ThresholdCheckButton_Normal() else: - view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() + view.setWidgetsStatus_ThresholdCheckButton_Disabled() model.stopCheckMicEnergy() - view.replaceConfigWindowMicThresholdCheckButtonToPassive() - view.setConfigWindowThresholdCheckWidgetsStatusToNormal() - - # view.setConfigWindowCompactModeSwitchStatusToNormal() + view.replaceMicThresholdCheckButton_Passive() + view.setWidgetsStatus_ThresholdCheckButton_Normal() def callbackSetMicRecordTimeout(value): print("callbackSetMicRecordTimeout", value) @@ -407,7 +403,7 @@ def callbackSetSpeakerDevice(value): config.CHOICE_SPEAKER_DEVICE = value model.stopCheckSpeakerEnergy() - view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() + view.replaceSpeakerThresholdCheckButton_Passive() def callbackSetSpeakerEnergyThreshold(value): print("callbackSetSpeakerEnergyThreshold", value) @@ -436,20 +432,16 @@ def setProgressBarSpeakerEnergy(energy): def callbackCheckSpeakerThreshold(is_turned_on): print("callbackCheckSpeakerThreshold", is_turned_on) if is_turned_on is True: - # view.setConfigWindowCompactModeSwitchStatusToDisabled() - - view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() + view.setWidgetsStatus_ThresholdCheckButton_Disabled() model.startCheckSpeakerEnergy(setProgressBarSpeakerEnergy) - view.replaceConfigWindowSpeakerThresholdCheckButtonToActive() - view.setConfigWindowThresholdCheckWidgetsStatusToNormal() + view.replaceSpeakerThresholdCheckButton_Active() + view.setWidgetsStatus_ThresholdCheckButton_Normal() else: - view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() + view.setWidgetsStatus_ThresholdCheckButton_Disabled() model.stopCheckSpeakerEnergy() - view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() - view.setConfigWindowThresholdCheckWidgetsStatusToNormal() - - # view.setConfigWindowCompactModeSwitchStatusToNormal() + view.replaceSpeakerThresholdCheckButton_Passive() + view.setWidgetsStatus_ThresholdCheckButton_Normal() def callbackSetSpeakerRecordTimeout(value): print("callbackSetSpeakerRecordTimeout", value) diff --git a/view.py b/view.py index ea7d1e71..1bd1d44a 100644 --- a/view.py +++ b/view.py @@ -509,15 +509,15 @@ class View(): # Config Window @staticmethod - def setConfigWindowCompactModeSwitchStatusToDisabled(): + def setWidgetsStatus_ConfigWindowCompactModeSwitch_Disabled(): vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="disabled") @staticmethod - def setConfigWindowCompactModeSwitchStatusToNormal(): + def setWidgetsStatus_ConfigWindowCompactModeSwitch_Normal(): vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="normal") @staticmethod - def setConfigWindowThresholdCheckWidgetsStatusToDisabled(): + def setWidgetsStatus_ThresholdCheckButton_Disabled(): vrct_gui.changeConfigWindowWidgetsStatus( status="disabled", target_names=[ @@ -527,7 +527,7 @@ class View(): ) @staticmethod - def setConfigWindowThresholdCheckWidgetsStatusToNormal(): + def setWidgetsStatus_ThresholdCheckButton_Normal(): vrct_gui.changeConfigWindowWidgetsStatus( status="normal", target_names=[ @@ -537,24 +537,24 @@ class View(): ) @staticmethod - def replaceConfigWindowMicThresholdCheckButtonToActive(): + def replaceMicThresholdCheckButton_Active(): vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid_remove() vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid() @staticmethod - def replaceConfigWindowMicThresholdCheckButtonToPassive(): + def replaceMicThresholdCheckButton_Passive(): vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid_remove() vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid() @staticmethod - def replaceConfigWindowSpeakerThresholdCheckButtonToActive(): + def replaceSpeakerThresholdCheckButton_Active(): vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid_remove() vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid() @staticmethod - def replaceConfigWindowSpeakerThresholdCheckButtonToPassive(): + def replaceSpeakerThresholdCheckButton_Passive(): vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid_remove() vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid() From 23b15a8a67dd0202bf1ccb006c3c053435f985f1 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:52:54 +0900 Subject: [PATCH 4/7] [bugfix] Config Window: Add functions that replaces the threshold check button's passive/active state within the callbackCloseConfigWindow function(main.py). --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index a4f60f3f..1979f3ee 100644 --- a/main.py +++ b/main.py @@ -242,7 +242,9 @@ def callbackCloseConfigWindow(): if config.ENABLE_TRANSCRIPTION_RECEIVE is True: startThreadingTranscriptionReceiveMessage() model.stopCheckMicEnergy() + view.replaceMicThresholdCheckButton_Passive() model.stopCheckSpeakerEnergy() + view.replaceSpeakerThresholdCheckButton_Passive() # Compact Mode Switch def callbackEnableConfigWindowCompactMode(): From 0ea26a53879b1d7d3c1a5b51a531c5211ec8c247 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:42:14 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[bugfix]=20=E8=A8=AD=E5=AE=9A=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E9=96=89=E3=81=98=E3=81=9F=E6=99=82=E3=81=AB=E3=80=81?= =?UTF-8?q?=E3=83=9E=E3=82=A4=E3=82=AF/=E3=82=B9=E3=83=94=E3=83=BC?= =?UTF-8?q?=E3=82=AB=E3=83=BC=20=E3=82=B9=E3=83=AC=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=AB=E3=83=89=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C=E3=81=9D=E3=81=AE=E3=81=BE?= =?UTF-8?q?=E3=81=BE=E3=81=AA=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20Progre?= =?UTF-8?q?ssBar=E3=81=AB0=E3=82=92=E3=82=BB=E3=83=83=E3=83=88=E3=81=99?= =?UTF-8?q?=E3=82=8B=E9=96=A2=E6=95=B0=E3=82=92view.py=E3=81=AB=E3=81=A8?= =?UTF-8?q?=E3=82=8A=E3=81=82=E3=81=88=E3=81=9A=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 +++ view.py | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 1979f3ee..c09a0755 100644 --- a/main.py +++ b/main.py @@ -243,8 +243,11 @@ def callbackCloseConfigWindow(): startThreadingTranscriptionReceiveMessage() model.stopCheckMicEnergy() view.replaceMicThresholdCheckButton_Passive() + # view.initProgressBar_MicEnergy() # ProgressBarに0をセットしたい + model.stopCheckSpeakerEnergy() view.replaceSpeakerThresholdCheckButton_Passive() + # view.initProgressBar_SpeakerEnergy() # ProgressBarに0をセットしたい # Compact Mode Switch def callbackEnableConfigWindowCompactMode(): diff --git a/view.py b/view.py index 1bd1d44a..00c1bf96 100644 --- a/view.py +++ b/view.py @@ -580,16 +580,28 @@ class View(): def updateSelected_MicDevice(self, default_selected_mic_device_name:str): self.view_variable.VAR_MIC_DEVICE.set(default_selected_mic_device_name) - def updateSetProgressBar_MicEnergy(self, new_mic_energy): + + @staticmethod + def updateSetProgressBar_MicEnergy(new_mic_energy): vrct_gui.config_window.sb__progressbar_x_slider__progressbar_mic_energy_threshold.set(new_mic_energy/config.MAX_MIC_ENERGY_THRESHOLD) + @staticmethod + def initProgressBar_MicEnergy(): + vrct_gui.config_window.sb__progressbar_x_slider__progressbar_mic_energy_threshold.set(0) + + def updateList_SpeakerDevice(self, new_speaker_device_list): self.view_variable.LIST_SPEAKER_DEVICE = new_speaker_device_list vrct_gui.config_window.sb__optionmenu_speaker_device.configure(values=new_speaker_device_list) - def updateSetProgressBar_SpeakerEnergy(self, new_speaker_energy): + @staticmethod + def updateSetProgressBar_SpeakerEnergy(new_speaker_energy): vrct_gui.config_window.sb__progressbar_x_slider__progressbar_speaker_energy_threshold.set(new_speaker_energy/config.MAX_SPEAKER_ENERGY_THRESHOLD) + @staticmethod + def initProgressBar_SpeakerEnergy(): + vrct_gui.config_window.sb__progressbar_x_slider__progressbar_speaker_energy_threshold.set(0) + def setGuiVariable_MicEnergyThreshold(self, slider_value:int, entry_value:Union[None, str]=None): From cdc8495f9947a05fe4c6825afa1f430ccfac34c4 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:03:50 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[Update]=20Main=20Window:=20Sidebar=20Langu?= =?UTF-8?q?age=20Settings=E3=81=AEDropdownMenu=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E3=83=9B=E3=83=90=E3=83=BC=E6=99=82=E3=81=AB=E3=80=81?= =?UTF-8?q?=E3=82=AB=E3=83=BC=E3=82=BD=E3=83=AB=E5=A4=89=E6=9B=B4=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82=20[bugfix]=20=E7=9F=A2=E5=8D=B0img?= =?UTF-8?q?=E9=83=A8=E5=88=86=E3=83=9B=E3=83=90=E3=83=BC=E6=99=82=E3=81=AE?= =?UTF-8?q?=E8=89=B2=E5=A4=89=E6=9B=B4=E5=87=A6=E7=90=86=E3=81=97=E5=BF=98?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_create_sidebar/createSidebarLanguagesSettings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vrct_gui/main_window/widgets/_create_sidebar/createSidebarLanguagesSettings.py b/vrct_gui/main_window/widgets/_create_sidebar/createSidebarLanguagesSettings.py index 08dd9c70..5ed03a2c 100644 --- a/vrct_gui/main_window/widgets/_create_sidebar/createSidebarLanguagesSettings.py +++ b/vrct_gui/main_window/widgets/_create_sidebar/createSidebarLanguagesSettings.py @@ -74,7 +74,7 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable): - sls__selected_language_box = CTkFrame(sls__box_wrapper, corner_radius=0, fg_color=settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR) + sls__selected_language_box = CTkFrame(sls__box_wrapper, corner_radius=0, fg_color=settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR, cursor="hand2") sls__selected_language_box.grid(row=1, column=0) @@ -111,8 +111,8 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable): - bindEnterAndLeaveColor([sls__selected_language_label_frame, sls__selected_language_box, sls__selected_language_label], settings.ctm.SLS__DROPDOWN_MENU_HOVERED_BG_COLOR, settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR) - bindButtonPressColor([sls__selected_language_label_frame, sls__selected_language_box, sls__selected_language_label], settings.ctm.SLS__DROPDOWN_MENU_CLICKED_BG_COLOR, settings.ctm.SLS__DROPDOWN_MENU_HOVERED_BG_COLOR) + bindEnterAndLeaveColor([sls__selected_language_label_frame, sls__selected_language_box, sls__selected_language_label, sls__selected_language_arrow_img], settings.ctm.SLS__DROPDOWN_MENU_HOVERED_BG_COLOR, settings.ctm.SLS__DROPDOWN_MENU_BG_COLOR) + bindButtonPressColor([sls__selected_language_label_frame, sls__selected_language_box, sls__selected_language_label, sls__selected_language_arrow_img], settings.ctm.SLS__DROPDOWN_MENU_CLICKED_BG_COLOR, settings.ctm.SLS__DROPDOWN_MENU_HOVERED_BG_COLOR) From 5d7c34a6bfe53cee44763ea7d9bc9d34f91dccf2 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:50:14 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[bugfix](Not=20enough)=20Sidebar=20Language?= =?UTF-8?q?=20Settings=20DropdownMenu=E3=83=9C=E3=82=BF=E3=83=B3=E8=87=AA?= =?UTF-8?q?=E4=BD=93=E3=82=92=E6=8A=BC=E3=81=97=E3=81=9F=E6=99=82=E3=81=AE?= =?UTF-8?q?=E9=96=8B=E9=96=89=E3=81=8C=E6=A9=9F=E8=83=BD=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=82=E3=81=9F=E3=81=A0=E7=84=A1=E7=90=86?= =?UTF-8?q?=E3=82=84=E3=82=8A=E3=81=AA=E3=81=86=E3=81=88=E3=81=AB=E6=A0=B9?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E3=81=AA=E8=A7=A3=E6=B1=BA=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E3=80=81=E9=95=B7=E6=8A=BC?= =?UTF-8?q?=E3=81=97=E3=81=A0=E3=81=A3=E3=81=9F=E3=82=8A=E3=80=81=E6=97=A9?= =?UTF-8?q?=E3=81=84=E6=93=8D=E4=BD=9C=E3=81=A0=E3=81=A3=E3=81=9F=E3=82=8A?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=A8=E7=8F=BE=E7=8A=B6=E4=BA=88=E6=9C=9F?= =?UTF-8?q?=E3=81=9B=E3=81=AC=E5=8B=95=E4=BD=9C=E3=81=AF=E8=B5=B7=E3=81=93?= =?UTF-8?q?=E3=82=8B=E3=80=82(=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E5=87=BA=E3=82=8B=E3=82=8F=E3=81=91=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=84=E8=A6=8B=E3=81=9F=E7=9B=AE=E3=81=AE=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=80=82=E9=96=8B=E9=96=89=E3=81=8C=E6=AD=A3=E3=81=97=E3=81=8F?= =?UTF-8?q?=E8=A1=8C=E3=82=8F=E3=82=8C=E3=81=AA=E3=81=84=E3=81=AA=E3=81=A9?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vrct_gui/vrct_gui.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index 8ac42492..383bf4cd 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -68,6 +68,9 @@ class VRCT_GUI(CTk): def openSelectableLanguagesWindow(self, selectable_language_window_type): + # print("___________________________________open____________________________________________________") + # print("your", self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW) + # print("target", self._view_variable.IS_OPENED_SELECTABLE_TARGET_LANGUAGE_WINDOW) if selectable_language_window_type == "your_language": if self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW is False: self.sls__arrow_img_your_language.configure(image=CTkImage((self.settings.main.image_file.ARROW_LEFT),size=(20,20))) @@ -97,8 +100,16 @@ class VRCT_GUI(CTk): self.sls__arrow_img_your_language.configure(image=CTkImage((self.settings.main.image_file.ARROW_LEFT).rotate(180),size=(20,20))) self.sls__arrow_img_target_language.configure(image=CTkImage((self.settings.main.image_file.ARROW_LEFT).rotate(180),size=(20,20))) self.selectable_languages_window.withdraw() - self._view_variable.IS_OPENED_SELECTABLE_TARGET_LANGUAGE_WINDOW = False - self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW = False + + + # print("______________________________________close_________________________________________________") + # print("your", self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW) + # print("target", self._view_variable.IS_OPENED_SELECTABLE_TARGET_LANGUAGE_WINDOW) + if self._view_variable.IS_OPENED_SELECTABLE_TARGET_LANGUAGE_WINDOW is not False or self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW is not False: + def callback(): + self._view_variable.IS_OPENED_SELECTABLE_TARGET_LANGUAGE_WINDOW = False + self._view_variable.IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW = False + self.after(500,callback)