[Update] Main Window Sidebar: 翻訳機能を使わない時は、そもそも翻訳機能のボタンを表示しないように。

音声認識処理中などのボタンdisabled時、スイッチの色をもっと無効感がでるように変更。
This commit is contained in:
Sakamoto Shiina
2024-01-20 18:13:18 +09:00
parent ef76621a86
commit b0def64cf1
4 changed files with 10 additions and 2 deletions

View File

@@ -884,18 +884,24 @@ class View():
self.openCtranslate2WeightTypeWidget()
self.setTranslationSwitchStatus("normal", release_locked_state=True)
vrct_gui.sls__box_translation_optionmenu_wrapper.grid()
vrct_gui.compact_mode_translation_frame.grid()
vrct_gui.translation_frame.grid()
vrct_gui.update()
elif state == "Disable":
view.closeCtranslate2WeightTypeWidget()
view.setTranslationSwitchStatus("disabled", to_lock_state=True)
vrct_gui.sls__box_translation_optionmenu_wrapper.grid_remove()
vrct_gui.compact_mode_translation_frame.grid_remove()
vrct_gui.translation_frame.grid_remove()
vrct_gui.update()
elif state == "Restart":
view.setLatestCTranslate2WeightType()
view.setTranslationSwitchStatus("disabled", to_lock_state=True)
vrct_gui.sls__box_translation_optionmenu_wrapper.grid()
vrct_gui.compact_mode_translation_frame.grid()
vrct_gui.translation_frame.grid()
vrct_gui.update()
vrct_gui.config_window.lift()

View File

@@ -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

View File

@@ -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,

View File

@@ -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,