Merge branch 'speaker2chatbox' into develop

This commit is contained in:
misyaguziya
2023-11-25 22:53:05 +09:00
9 changed files with 246 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ from ._createSettingBoxContainer import _createSettingBoxContainer
from .setting_box_containers.setting_box_appearance import createSettingBox_Appearance
from .setting_box_containers.setting_box_transcription import createSettingBox_Mic, createSettingBox_Speaker
from .setting_box_containers.setting_box_others import createSettingBox_Others
from .setting_box_containers.setting_box_others import createSettingBox_Others, createSettingBox_Others_Additional
from .setting_box_containers.setting_box_advanced_settings import createSettingBox_AdvancedSettings
from .setting_box_containers.setting_box_translation import createSettingBox_Translation
@@ -106,6 +106,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings, view_variabl
"setting_box_container_attr_name": "setting_box_container_others",
"setting_boxes": [
{ "var_section_title": None, "setting_box": createSettingBox_Others },
{ "var_section_title": view_variable.VAR_SECOND_TITLE_OTHERS_SPEAKER2CHATBOX, "setting_box": createSettingBox_Others_Additional },
]
},
},

View File

@@ -109,8 +109,9 @@ class _SettingBoxGenerator():
def createSettingBox_Labels(
self,
for_var_label_text, for_var_desc_text,
for_var_label_text,
labels_attr_name,
for_var_desc_text=None,
):
setting_box_frame= self._createSettingBoxFrame(labels_attr_name, for_var_label_text, for_var_desc_text, expand_label_frame=True)
@@ -216,10 +217,11 @@ class _SettingBoxGenerator():
def createSettingBoxCheckbox(self,
for_var_label_text, for_var_desc_text,
for_var_label_text,
checkbox_attr_name,
command,
variable,
for_var_desc_text=None,
):
(setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(checkbox_attr_name, for_var_label_text, for_var_desc_text)
@@ -543,6 +545,8 @@ class _SettingBoxGenerator():
entry_textvariable_2,
textvariable_0,
textvariable_1,
example_label_textvariable,
swap_button_command,
entry_bind__Any_KeyRelease,
entry_bind__FocusOut=None,
):
@@ -577,7 +581,7 @@ class _SettingBoxGenerator():
example_frame_widget.grid_columnconfigure((0,2), weight=1)
example_label_widget = CTkLabel(
example_frame_widget,
textvariable=self.view_variable.VAR_LABEL_EXAMPLE_TEXT_MESSAGE_FORMAT,
textvariable=example_label_textvariable,
anchor="center",
justify="center",
wraplength=self.settings.uism.SB__MESSAGE_FORMAT__EXAMPLE_WRAP_LENGTH,
@@ -713,10 +717,6 @@ class _SettingBoxGenerator():
)
swap_button_label_1.grid(row=1, column=3)
def adjustedCommand():
callFunctionIfCallable(self.view_variable.CALLBACK_SWAP_MESSAGE_FORMAT_REQUIRED_TEXT)
bindButtonFunctionAndColor(
target_widgets=[
swap_button,
@@ -728,7 +728,7 @@ class _SettingBoxGenerator():
enter_color=self.settings.ctm.SB__MESSAGE_FORMAT__SWAP_BUTTON_HOVERED_COLOR,
leave_color=self.settings.ctm.SB__MESSAGE_FORMAT__SWAP_BUTTON_COLOR,
clicked_color=self.settings.ctm.SB__MESSAGE_FORMAT__SWAP_BUTTON_CLICKED_COLOR,
buttonReleasedFunction=lambda _e: adjustedCommand(),
buttonReleasedFunction=swap_button_command,
)

View File

@@ -1 +1,2 @@
from .createSettingBox_Others import createSettingBox_Others
from .createSettingBox_Others import createSettingBox_Others
from .createSettingBox_Others_Additional import createSettingBox_Others_Additional

View File

@@ -33,6 +33,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
def entry_message_format_callback(value):
callFunctionIfCallable(view_variable.CALLBACK_SET_MESSAGE_FORMAT, value)
def entry_swap_message_format_callback(_e):
callFunctionIfCallable(view_variable.CALLBACK_SWAP_MESSAGE_FORMAT_REQUIRED_TEXT)
row=0
config_window.sb__auto_clear_message_box = createSettingBoxCheckbox(
@@ -85,7 +88,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
entry_textvariable_2=view_variable.VAR_ENTRY_2_MESSAGE_FORMAT,
textvariable_0=view_variable.VAR_TEXT_REQUIRED_0_MESSAGE_FORMAT,
textvariable_1=view_variable.VAR_TEXT_REQUIRED_1_MESSAGE_FORMAT,
example_label_textvariable=view_variable.VAR_LABEL_EXAMPLE_TEXT_MESSAGE_FORMAT,
entry_bind__Any_KeyRelease=lambda value: entry_message_format_callback(value),
swap_button_command=entry_swap_message_format_callback,
# entry_textvariable=view_variable.VAR_MESSAGE_FORMAT,
entry_bind__FocusOut=view_variable.CALLBACK_FOCUS_OUT_MESSAGE_FORMAT,
)

View File

@@ -0,0 +1,56 @@
from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Others_Additional(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
createSettingBox_Labels = sbg.createSettingBox_Labels
createSettingBoxMessageFormatEntries = sbg.createSettingBoxMessageFormatEntries
def checkbox_enable_send_received_message_to_vrc_callback(checkbox_box_widget):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC, checkbox_box_widget.get())
def entry_received_message_format_callback(value):
callFunctionIfCallable(view_variable.CALLBACK_SET_RECEIVED_MESSAGE_FORMAT, value)
def entry_swap_received_message_format_callback(_e):
callFunctionIfCallable(view_variable.CALLBACK_SWAP_RECEIVED_MESSAGE_FORMAT_REQUIRED_TEXT)
row=0
config_window.sb__received_message_format_labels = createSettingBox_Labels(
for_var_label_text=view_variable.VAR_LABEL_RECEIVED_MESSAGE_FORMAT,
# for_var_desc_text=view_variable.VAR_DESC_RECEIVED_MESSAGE_FORMAT,
labels_attr_name="sb__labels_message_format",
)
config_window.sb__received_message_format_labels.grid(row=row, pady=0)
row+=1
config_window.sb__received_message_format = createSettingBoxMessageFormatEntries(
base_entry_attr_name="sb__entry_received_message_format",
# entry_width=settings.uism.RESPONSIVE_UI_SIZE_INT_150,
entry_textvariable_0=view_variable.VAR_ENTRY_0_RECEIVED_MESSAGE_FORMAT,
entry_textvariable_1=view_variable.VAR_ENTRY_1_RECEIVED_MESSAGE_FORMAT,
entry_textvariable_2=view_variable.VAR_ENTRY_2_RECEIVED_MESSAGE_FORMAT,
textvariable_0=view_variable.VAR_TEXT_REQUIRED_0_RECEIVED_MESSAGE_FORMAT,
textvariable_1=view_variable.VAR_TEXT_REQUIRED_1_RECEIVED_MESSAGE_FORMAT,
example_label_textvariable=view_variable.VAR_LABEL_EXAMPLE_TEXT_RECEIVED_MESSAGE_FORMAT,
entry_bind__Any_KeyRelease=lambda value: entry_received_message_format_callback(value),
swap_button_command=entry_swap_received_message_format_callback,
# entry_textvariable=view_variable.VAR_RECEIVED_MESSAGE_FORMAT,
entry_bind__FocusOut=view_variable.CALLBACK_FOCUS_OUT_RECEIVED_MESSAGE_FORMAT,
)
config_window.sb__received_message_format.grid(row=row)
row+=1
config_window.sb__enable_send_received_message_to_vrc = createSettingBoxCheckbox(
for_var_label_text=view_variable.VAR_LABEL_ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC,
# for_var_desc_text=view_variable.VAR_DESC_ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC,
checkbox_attr_name="sb__checkbox_enable_send_received_message_to_vrc",
command=lambda: checkbox_enable_send_received_message_to_vrc_callback(config_window.sb__checkbox_enable_send_received_message_to_vrc),
variable=view_variable.VAR_ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC,
)
config_window.sb__enable_send_received_message_to_vrc.grid(row=row, pady=0)
row+=1