Merge branch 'change_ctranslate2_model' into develop
This commit is contained in:
10
config.py
10
config.py
@@ -197,6 +197,15 @@ class Config:
|
||||
if value in list(translation_lang.keys()):
|
||||
self._CHOICE_OUTPUT_TRANSLATOR = value
|
||||
|
||||
@property
|
||||
def IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION(self):
|
||||
return self._IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION
|
||||
|
||||
@IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION.setter
|
||||
def IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION(self, value):
|
||||
if isinstance(value, bool):
|
||||
self._IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = value
|
||||
|
||||
# Save Json Data
|
||||
## Main Window
|
||||
@property
|
||||
@@ -761,6 +770,7 @@ class Config:
|
||||
self._SOURCE_COUNTRY = "Japan"
|
||||
self._TARGET_LANGUAGE = "English"
|
||||
self._TARGET_COUNTRY = "United States"
|
||||
self._IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
|
||||
|
||||
# Save Json Data
|
||||
## Main Window
|
||||
|
||||
@@ -489,22 +489,39 @@ def callbackSetUseTranslationFeature(value):
|
||||
if config.USE_TRANSLATION_FEATURE is True:
|
||||
view.useTranslationFeatureProcess("Normal")
|
||||
if model.checkCTranslatorCTranslate2ModelWeight():
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
|
||||
def callback():
|
||||
model.changeTranslatorCTranslate2Model()
|
||||
th_callback = Thread(target=callback)
|
||||
th_callback.daemon = True
|
||||
th_callback.start()
|
||||
else:
|
||||
view.useTranslationFeatureProcess("Disable")
|
||||
# CTranslate2 weight is not downloaded
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = True
|
||||
view.useTranslationFeatureProcess("Restart")
|
||||
else:
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
|
||||
view.useTranslationFeatureProcess("Disable")
|
||||
view.showRestartButtonIfRequired()
|
||||
|
||||
def callbackSetCtranslate2WeightType(value):
|
||||
print("callbackSetCtranslate2WeightType", value)
|
||||
config.WEIGHT_TYPE = str(value)
|
||||
view.updateSelectedCtranslate2WeightType(config.WEIGHT_TYPE)
|
||||
view.setWidgetsStatus_changeWeightType_Pending()
|
||||
if model.checkCTranslatorCTranslate2ModelWeight():
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
|
||||
def callback():
|
||||
model.changeTranslatorCTranslate2Model()
|
||||
view.useTranslationFeatureProcess("Normal")
|
||||
view.setWidgetsStatus_changeWeightType_Done()
|
||||
th_callback = Thread(target=callback)
|
||||
th_callback.daemon = True
|
||||
th_callback.start()
|
||||
else:
|
||||
view.useTranslationFeatureProcess("Disable")
|
||||
# CTranslate2 weight is not downloaded
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = True
|
||||
view.useTranslationFeatureProcess("Restart")
|
||||
view.setWidgetsStatus_changeWeightType_Done()
|
||||
view.showRestartButtonIfRequired()
|
||||
|
||||
def callbackSetDeeplAuthKey(value):
|
||||
print("callbackSetDeeplAuthKey", str(value))
|
||||
|
||||
@@ -6,7 +6,7 @@ main_window:
|
||||
|
||||
language_settings: Language Settings
|
||||
your_language: Your Language
|
||||
both_direction_desc: Translate Each Other
|
||||
translate_each_other_label: Translate Each Other
|
||||
swap_button_label: Swap Languages
|
||||
target_language: Target Language
|
||||
translator: Translator
|
||||
|
||||
@@ -6,7 +6,7 @@ main_window:
|
||||
|
||||
language_settings: 言語設定
|
||||
your_language: あなたの言語
|
||||
both_direction_desc: 双方向に翻訳
|
||||
translate_each_other_label: 双方向に翻訳
|
||||
swap_button_label: 言語を入れ替え
|
||||
target_language: 相手の言語
|
||||
translator: 翻訳エンジン
|
||||
|
||||
@@ -6,7 +6,7 @@ main_window:
|
||||
|
||||
language_settings: 언어 설정
|
||||
your_language: 당신의 언어
|
||||
both_direction_desc: 양방향으로 번역
|
||||
translate_each_other_label: 양방향으로 번역
|
||||
swap_button_label: 언어 교체
|
||||
target_language: 상대방의 언어
|
||||
|
||||
|
||||
76
view.py
76
view.py
@@ -28,6 +28,7 @@ class View():
|
||||
ui_scaling=config.UI_SCALING,
|
||||
font_family=config.FONT_FAMILY,
|
||||
ui_language=config.UI_LANGUAGE,
|
||||
is_reset_button_displayed_for_translation=config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION,
|
||||
)
|
||||
|
||||
if config.ENABLE_SPEAKER2CHATBOX is False:
|
||||
@@ -161,9 +162,10 @@ class View():
|
||||
IS_OPENED_SELECTABLE_YOUR_LANGUAGE_WINDOW=False,
|
||||
CALLBACK_SELECTED_YOUR_LANGUAGE=None,
|
||||
|
||||
VAR_LABEL_BOTH_DIRECTION_DESC=StringVar(value=i18n.t("main_window.both_direction_desc")),
|
||||
VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON=StringVar(value=i18n.t("main_window.swap_button_label")),
|
||||
VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON=StringVar(value=""),
|
||||
CALLBACK_SWAP_LANGUAGES=None,
|
||||
CALLBACK_ENTERED_SWAP_LANGUAGES_BUTTON=self._enteredSwapLanguagesButton,
|
||||
CALLBACK_LEAVED_SWAP_LANGUAGES_BUTTON=self._leavedSwapLanguagesButton,
|
||||
|
||||
VAR_LABEL_TARGET_LANGUAGE=StringVar(value=i18n.t("main_window.target_language")),
|
||||
VAR_TARGET_LANGUAGE = StringVar(value=f"{config.TARGET_LANGUAGE}\n({config.TARGET_COUNTRY})"),
|
||||
@@ -650,7 +652,9 @@ class View():
|
||||
|
||||
if config.USE_TRANSLATION_FEATURE is True:
|
||||
self.useTranslationFeatureProcess("Normal")
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.translate_each_other_label"))
|
||||
else:
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.swap_button_label"))
|
||||
self.useTranslationFeatureProcess("Disable")
|
||||
|
||||
if config.CHOICE_MIC_HOST == "NoHost":
|
||||
@@ -878,18 +882,38 @@ class View():
|
||||
}
|
||||
|
||||
def useTranslationFeatureProcess(self, state:str):
|
||||
def changeWidget_UseTranslationFeature():
|
||||
vrct_gui.sls__box_translation_optionmenu_wrapper.grid()
|
||||
vrct_gui.compact_mode_translation_frame.grid()
|
||||
vrct_gui.translation_frame.grid()
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.translate_each_other_label"))
|
||||
|
||||
def changeWidget_DontUseTranslationFeature():
|
||||
vrct_gui.sls__box_translation_optionmenu_wrapper.grid_remove()
|
||||
vrct_gui.compact_mode_translation_frame.grid_remove()
|
||||
vrct_gui.translation_frame.grid_remove()
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.swap_button_label"))
|
||||
|
||||
|
||||
if state == "Normal":
|
||||
self.setLatestCTranslate2WeightType()
|
||||
self.openCtranslate2WeightTypeWidget()
|
||||
self.setTranslationSwitchStatus("normal", release_locked_state=True)
|
||||
vrct_gui.sls__box_translation_optionmenu_wrapper.grid()
|
||||
vrct_gui.config_window.after(200, vrct_gui.config_window.lift)
|
||||
changeWidget_UseTranslationFeature()
|
||||
|
||||
elif state == "Disable":
|
||||
view.closeCtranslate2WeightTypeWidget()
|
||||
view.setTranslationSwitchStatus("disabled", to_lock_state=True)
|
||||
vrct_gui.sls__box_translation_optionmenu_wrapper.grid_remove()
|
||||
vrct_gui.config_window.after(200, vrct_gui.config_window.lift)
|
||||
changeWidget_DontUseTranslationFeature()
|
||||
|
||||
elif state == "Restart":
|
||||
view.setLatestCTranslate2WeightType()
|
||||
view.setTranslationSwitchStatus("disabled", to_lock_state=True)
|
||||
changeWidget_UseTranslationFeature()
|
||||
|
||||
vrct_gui.update()
|
||||
vrct_gui.config_window.lift()
|
||||
|
||||
|
||||
# Open Webpage Functions
|
||||
def openWebPage_Booth(self):
|
||||
@@ -984,7 +1008,8 @@ class View():
|
||||
self.restart_required_configs_pre_data.appearance_theme == config.APPEARANCE_THEME and
|
||||
self.restart_required_configs_pre_data.ui_scaling == config.UI_SCALING and
|
||||
self.restart_required_configs_pre_data.font_family == config.FONT_FAMILY and
|
||||
self.restart_required_configs_pre_data.ui_language == config.UI_LANGUAGE
|
||||
self.restart_required_configs_pre_data.ui_language == config.UI_LANGUAGE and
|
||||
self.restart_required_configs_pre_data.is_reset_button_displayed_for_translation == config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION
|
||||
)
|
||||
|
||||
if locale is None:
|
||||
@@ -1013,6 +1038,28 @@ class View():
|
||||
vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="normal")
|
||||
|
||||
|
||||
@staticmethod
|
||||
def setWidgetsStatus_changeWeightType_Pending():
|
||||
vrct_gui.config_window.sb__switch_use_translation_feature.configure(state="disabled")
|
||||
vrct_gui._changeConfigWindowWidgetsStatus(
|
||||
status="disabled",
|
||||
target_names=[
|
||||
"sb__switch_use_translation_feature",
|
||||
"sb__optionmenu_ctranslate2_weight_type",
|
||||
]
|
||||
)
|
||||
@staticmethod
|
||||
def setWidgetsStatus_changeWeightType_Done():
|
||||
vrct_gui.config_window.sb__switch_use_translation_feature.configure(state="normal")
|
||||
vrct_gui._changeConfigWindowWidgetsStatus(
|
||||
status="normal",
|
||||
target_names=[
|
||||
"sb__switch_use_translation_feature",
|
||||
"sb__optionmenu_ctranslate2_weight_type",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def updateSelectedCtranslate2WeightType(self, selected_weight_type:str):
|
||||
self.view_variable.VAR_CTRANSLATE2_WEIGHT_TYPE.set(self.getSelectableCtranslate2WeightTypeDict()[selected_weight_type])
|
||||
|
||||
@@ -1206,7 +1253,7 @@ class View():
|
||||
self._clearEntryBox(vrct_gui.config_window.sb__entry_mic_word_filter_list)
|
||||
|
||||
|
||||
# Widget Control (Whole)
|
||||
# Widget Control
|
||||
def foregroundOnIfForegroundEnabled(self):
|
||||
if config.ENABLE_FOREGROUND:
|
||||
self.foregroundOn()
|
||||
@@ -1264,6 +1311,19 @@ class View():
|
||||
vrct_gui.main_send_message_button_container.grid()
|
||||
vrct_gui.config_window.after(200, vrct_gui.config_window.lift)
|
||||
|
||||
def _enteredSwapLanguagesButton(self):
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.swap_button_label"))
|
||||
vrct_gui.sls__both_direction_desc.configure(
|
||||
text_color=self.settings.main.ctm.SLS__BOX_ARROWS_SWAP_BUTTON_TEXT_COLOR,
|
||||
)
|
||||
|
||||
def _leavedSwapLanguagesButton(self):
|
||||
if config.USE_TRANSLATION_FEATURE is True:
|
||||
self.view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON.set(i18n.t("main_window.translate_each_other_label"))
|
||||
vrct_gui.sls__both_direction_desc.configure(
|
||||
text_color=self.settings.main.ctm.SLS__BOX_ARROWS_TEXT_COLOR,
|
||||
)
|
||||
|
||||
# Function
|
||||
def _adjustUiSizeAndRestart(self):
|
||||
current_percentage = int(config.UI_SCALING.replace("%",""))
|
||||
|
||||
@@ -326,9 +326,18 @@ class _CreateDropdownMenuWindow(CTkToplevel):
|
||||
|
||||
def _withdraw(self, e=None):
|
||||
self.withdraw()
|
||||
try:
|
||||
self.attach_widget.winfo_toplevel().unbind("<Configure>", self.BIND_CONFIGURE_FUNC_ID)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
self.attach_widget.unbind("<Unmap>", self.BIND_UNMAP_FUNC_ID)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
self.attach_widget.winfo_toplevel().unbind("<Button-1>", self.BIND_BUTTON_1_FUNC_ID)
|
||||
except Exception:
|
||||
pass
|
||||
self.hide = True
|
||||
|
||||
|
||||
|
||||
@@ -10,37 +10,75 @@ def _changeConfigWindowWidgetsStatus(config_window, settings, view_variable, sta
|
||||
if target_widget.desc_widget is not None:
|
||||
target_widget.desc_widget.configure(text_color=settings.ctm.LABELS_TEXT_DISABLED_COLOR)
|
||||
|
||||
def normalLabelsWidgets(target_widget):
|
||||
target_widget.label_widget.configure(text_color=settings.ctm.LABELS_TEXT_COLOR)
|
||||
if target_widget.desc_widget is not None:
|
||||
target_widget.desc_widget.configure(text_color=settings.ctm.LABELS_DESC_TEXT_COLOR)
|
||||
|
||||
|
||||
def disableOptionmenuWidget(target_widget):
|
||||
disableLabelsWidgets(target_widget)
|
||||
target_widget.optionmenu_label_widget.configure(text_color=settings.ctm.LABELS_TEXT_DISABLED_COLOR)
|
||||
target_widget.optionmenu_img_widget.configure(image=CTkImage(settings.image_file.ARROW_LEFT_DISABLED.rotate(90), size=settings.uism.SB__OPTIONMENU_IMG_SIZE))
|
||||
target_widget.optionmenu_box.unbindFunction()
|
||||
target_widget.optionmenu_box.configure(cursor="")
|
||||
|
||||
def normalOptionmenuWidget(target_widget):
|
||||
target_widget.optionmenu_label_widget.configure(text_color=settings.ctm.LABELS_TEXT_COLOR)
|
||||
target_widget.optionmenu_img_widget.configure(image=CTkImage(settings.image_file.ARROW_LEFT.rotate(90), size=settings.uism.SB__OPTIONMENU_IMG_SIZE))
|
||||
target_widget.optionmenu_box.bindFunction()
|
||||
target_widget.optionmenu_box.configure(cursor="hand2")
|
||||
|
||||
|
||||
for target_name in target_names:
|
||||
match target_name:
|
||||
case "sb__optionmenu_mic_host":
|
||||
if status == "disabled":
|
||||
target_widget = config_window.sb__widgets["sb__optionmenu_mic_host"]
|
||||
disableLabelsWidgets(target_widget)
|
||||
disableOptionmenuWidget(target_widget)
|
||||
|
||||
case "sb__optionmenu_mic_device":
|
||||
if status == "disabled":
|
||||
target_widget = config_window.sb__widgets["sb__optionmenu_mic_device"]
|
||||
disableLabelsWidgets(target_widget)
|
||||
disableOptionmenuWidget(target_widget)
|
||||
|
||||
case "sb__optionmenu_appearance_theme":
|
||||
if status == "disabled":
|
||||
target_widget = config_window.sb__widgets["sb__optionmenu_appearance_theme"]
|
||||
disableLabelsWidgets(target_widget)
|
||||
disableOptionmenuWidget(target_widget)
|
||||
|
||||
case "sb__optionmenu_ctranslate2_weight_type":
|
||||
target_widget = config_window.sb__widgets["sb__optionmenu_ctranslate2_weight_type"]
|
||||
if status == "disabled":
|
||||
disableOptionmenuWidget(target_widget)
|
||||
elif status == "normal":
|
||||
normalOptionmenuWidget(target_widget)
|
||||
|
||||
|
||||
case "sb__switch_use_translation_feature":
|
||||
target_widget = config_window.sb__widgets["sb__switch_use_translation_feature"]
|
||||
if status == "disabled":
|
||||
target_widget.switch_box.configure(
|
||||
state="disabled",
|
||||
fg_color=settings.ctm.SB__SWITCH_BOX_BG_DISABLED_COLOR,
|
||||
progress_color=settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_DISABLED_COLOR,
|
||||
button_color=settings.ctm.SB__SWITCH_BOX_BUTTON_DISABLED_COLOR,
|
||||
)
|
||||
elif status == "normal":
|
||||
target_widget.switch_box.configure(
|
||||
state="normal",
|
||||
fg_color=settings.ctm.SB__SWITCH_BOX_BG_COLOR,
|
||||
progress_color=settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR,
|
||||
button_color=settings.ctm.SB__SWITCH_BOX_BUTTON_COLOR,
|
||||
)
|
||||
|
||||
case "sb__checkbox_enable_send_received_message_to_vrc":
|
||||
if status == "disabled":
|
||||
target_widget = config_window.sb__widgets["sb__checkbox_enable_send_received_message_to_vrc"]
|
||||
disableLabelsWidgets(target_widget)
|
||||
config_window.sb__checkbox_enable_send_received_message_to_vrc.configure(
|
||||
target_widget.checkbox.configure(
|
||||
state="disabled",
|
||||
border_color=settings.ctm.SB__CHECKBOX_BORDER_DISABLED_COLOR
|
||||
)
|
||||
|
||||
@@ -28,13 +28,13 @@ def _changeMainWindowWidgetsStatus(vrct_gui, settings, view_variable, status, ta
|
||||
if status == "disabled":
|
||||
widget_frame.configure(cursor="")
|
||||
widget_label.configure(text_color=settings.ctm.SF__TEXT_DISABLED_COLOR)
|
||||
widget_switch_box.configure(state="disabled", progress_color=settings.ctm.SF__SWITCH_BOX_DISABLE_BG_COLOR)
|
||||
widget_switch_box.configure(state="disabled", progress_color=settings.ctm.SF__SWITCH_BOX_DISABLE_BG_COLOR, button_color=settings.ctm.SF__SWITCH_BOX_BUTTON_DISABLED_COLOR)
|
||||
widget_selected_mark.configure(fg_color=settings.ctm.SF__SELECTED_MARK_DISABLE_BG_COLOR)
|
||||
icon_file = disabled_icon_name
|
||||
elif status == "normal":
|
||||
widget_frame.configure(cursor="hand2")
|
||||
widget_label.configure(text_color=settings.ctm.LABELS_TEXT_COLOR)
|
||||
widget_switch_box.configure(state="normal", progress_color=settings.ctm.SF__SWITCH_BOX_ACTIVE_BG_COLOR)
|
||||
widget_switch_box.configure(state="normal", progress_color=settings.ctm.SF__SWITCH_BOX_ACTIVE_BG_COLOR, button_color=settings.ctm.SF__SWITCH_BOX_BUTTON_COLOR)
|
||||
widget_selected_mark.configure(fg_color=settings.ctm.SF__SELECTED_MARK_ACTIVE_BG_COLOR)
|
||||
icon_file = icon_name
|
||||
|
||||
|
||||
@@ -210,6 +210,8 @@ class _SettingBoxGenerator():
|
||||
)
|
||||
setattr(self.config_window, switch_attr_name, switch_widget)
|
||||
|
||||
self.config_window.sb__widgets[switch_attr_name].switch_box = switch_widget
|
||||
|
||||
switch_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e")
|
||||
|
||||
return setting_box_frame
|
||||
@@ -245,6 +247,8 @@ class _SettingBoxGenerator():
|
||||
)
|
||||
setattr(self.config_window, checkbox_attr_name, checkbox_widget)
|
||||
|
||||
self.config_window.sb__widgets[checkbox_attr_name].checkbox = checkbox_widget
|
||||
|
||||
checkbox_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e")
|
||||
|
||||
return setting_box_frame
|
||||
|
||||
@@ -250,7 +250,7 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable):
|
||||
|
||||
main_window.sls__both_direction_desc = CTkLabel(
|
||||
main_window.sls__arrow_direction_swap_box,
|
||||
textvariable=view_variable.VAR_LABEL_BOTH_DIRECTION_DESC,
|
||||
textvariable=view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON,
|
||||
height=0,
|
||||
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,
|
||||
@@ -286,16 +286,10 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable):
|
||||
|
||||
|
||||
def adjustedCommand_Entered():
|
||||
main_window.sls__both_direction_desc.configure(
|
||||
textvariable=view_variable.VAR_LABEL_BOTH_DIRECTION_SWAP_BUTTON,
|
||||
text_color=settings.ctm.SLS__BOX_ARROWS_SWAP_BUTTON_TEXT_COLOR,
|
||||
)
|
||||
callFunctionIfCallable(view_variable.CALLBACK_ENTERED_SWAP_LANGUAGES_BUTTON)
|
||||
|
||||
def adjustedCommand_Leaved():
|
||||
main_window.sls__both_direction_desc.configure(
|
||||
textvariable=view_variable.VAR_LABEL_BOTH_DIRECTION_DESC,
|
||||
text_color=settings.ctm.SLS__BOX_ARROWS_TEXT_COLOR,
|
||||
)
|
||||
callFunctionIfCallable(view_variable.CALLBACK_LEAVED_SWAP_LANGUAGES_BUTTON)
|
||||
|
||||
bindEnterAndLeaveFunction(
|
||||
target_widgets=[
|
||||
|
||||
@@ -58,6 +58,7 @@ def _darkTheme(base_color):
|
||||
SF__SWITCH_BOX_DISABLE_BG_COLOR = base_color.PRIMARY_800_COLOR,
|
||||
|
||||
SF__SWITCH_BOX_BUTTON_COLOR = base_color.DARK_400_COLOR,
|
||||
SF__SWITCH_BOX_BUTTON_DISABLED_COLOR = base_color.DARK_600_COLOR,
|
||||
# It's not working because It overrode internally.
|
||||
SF__SWITCH_BOX_BUTTON_HOVERED_COLOR = base_color.DARK_350_COLOR,
|
||||
|
||||
@@ -215,8 +216,11 @@ def _darkTheme(base_color):
|
||||
SB__SLIDER_TOOLTIP_TEXT_COLOR = base_color.DARK_200_COLOR,
|
||||
|
||||
SB__SWITCH_BOX_BG_COLOR = base_color.DARK_800_COLOR,
|
||||
SB__SWITCH_BOX_BG_DISABLED_COLOR = base_color.DARK_900_COLOR,
|
||||
SB__SWITCH_BOX_ACTIVE_BG_COLOR = base_color.PRIMARY_500_COLOR,
|
||||
SB__SWITCH_BOX_ACTIVE_BG_DISABLED_COLOR = base_color.PRIMARY_700_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_COLOR = base_color.DARK_400_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_DISABLED_COLOR = base_color.DARK_700_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_HOVERED_COLOR = base_color.DARK_350_COLOR,
|
||||
|
||||
SB__CHECKBOX_BORDER_COLOR = base_color.DARK_600_COLOR,
|
||||
|
||||
@@ -58,6 +58,7 @@ def _lightTheme(base_color):
|
||||
SF__SWITCH_BOX_DISABLE_BG_COLOR = base_color.PRIMARY_200_COLOR,
|
||||
|
||||
SF__SWITCH_BOX_BUTTON_COLOR = base_color.LIGHT_150_COLOR,
|
||||
SF__SWITCH_BOX_BUTTON_DISABLED_COLOR = base_color.LIGHT_300_COLOR,
|
||||
# It's not working because It overrode internally.
|
||||
SF__SWITCH_BOX_BUTTON_HOVERED_COLOR = base_color.LIGHT_300_COLOR,
|
||||
|
||||
@@ -208,8 +209,11 @@ def _lightTheme(base_color):
|
||||
SB__SLIDER_TOOLTIP_TEXT_COLOR = base_color.LIGHT_800_COLOR,
|
||||
|
||||
SB__SWITCH_BOX_BG_COLOR = base_color.LIGHT_400_COLOR,
|
||||
SB__SWITCH_BOX_BG_DISABLED_COLOR = base_color.LIGHT_200_COLOR,
|
||||
SB__SWITCH_BOX_ACTIVE_BG_COLOR = base_color.PRIMARY_300_COLOR,
|
||||
SB__SWITCH_BOX_ACTIVE_BG_DISABLED_COLOR = base_color.PRIMARY_150_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_COLOR = base_color.LIGHT_300_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_DISABLED_COLOR = base_color.LIGHT_150_COLOR,
|
||||
SB__SWITCH_BOX_BUTTON_HOVERED_COLOR = base_color.LIGHT_200_COLOR,
|
||||
|
||||
SB__CHECKBOX_BORDER_COLOR = base_color.LIGHT_600_COLOR,
|
||||
|
||||
@@ -205,10 +205,15 @@ def createLabelButton(parent_widget, label_button_bg_color, label_button_hovered
|
||||
|
||||
bindButtonReleaseFunction([label_button_label_wrapper, label_button_box, label_button_label_widget], label_button_clicked_command)
|
||||
|
||||
def bindEventFromWidgets():
|
||||
bindButtonReleaseFunction([label_button_label_wrapper, label_button_box, label_button_label_widget], label_button_clicked_command)
|
||||
bindEventFromWidgets()
|
||||
|
||||
def unbindEventFromWidgets():
|
||||
unbindEnterLEaveButtonPressButtonReleaseFunction([label_button_label_wrapper, label_button_box, label_button_label_widget])
|
||||
|
||||
label_button_box.unbindFunction = unbindEventFromWidgets
|
||||
label_button_box.bindFunction = bindEventFromWidgets
|
||||
|
||||
|
||||
return (label_button_box, label_button_label_widget)
|
||||
@@ -265,13 +270,15 @@ def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_b
|
||||
bindButtonPressColor([optionmenu_label_wrapper, option_menu_box, optionmenu_label_widget, optionmenu_img_widget], optionmenu_clicked_bg_color, optionmenu_hovered_bg_color)
|
||||
|
||||
|
||||
|
||||
def bindEventFromWidgets():
|
||||
bindButtonReleaseFunction([optionmenu_label_wrapper, option_menu_box, optionmenu_label_widget, optionmenu_img_widget], optionmenu_clicked_command)
|
||||
bindEventFromWidgets()
|
||||
|
||||
def unbindEventFromWidgets():
|
||||
unbindEnterLEaveButtonPressButtonReleaseFunction([optionmenu_label_wrapper, option_menu_box, optionmenu_label_widget, optionmenu_img_widget])
|
||||
|
||||
option_menu_box.unbindFunction = unbindEventFromWidgets
|
||||
option_menu_box.bindFunction = bindEventFromWidgets
|
||||
|
||||
|
||||
return (option_menu_box, optionmenu_label_widget, optionmenu_img_widget)
|
||||
|
||||
Reference in New Issue
Block a user