[bugfix/chore] Main Window: Selectable Translation Engines.

・ドロップダウンメニューの文言修正。(CTranslate2の表示修正と、デフォルトである旨を追加)
・幅が規定値より超えた時の処理でエラーが発生するのを修正
This commit is contained in:
Sakamoto Shiina
2024-01-14 19:11:09 +09:00
parent 22e24514e0
commit 6cd56991c3
6 changed files with 35 additions and 27 deletions

View File

@@ -352,28 +352,6 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable):
main_window.translation_engine_dropdown_menu_window = _CreateDropdownMenuWindow(
settings=settings,
view_variable=main_window._view_variable,
window_additional_y_pos=4,
window_border_width=1,
scrollbar_ipadx=(2,2),
scrollbar_width=16,
value_ipadx=(8,0),
value_ipady=(6,6),
value_pady=0,
value_font_size=14,
dropdown_menu_default_min_width=200,
window_bg_color="#1f2022",
window_border_color="#7f8084",
values_bg_color="#323336",
values_hovered_bg_color="#4b4c4f",
values_clicked_bg_color="#292a2d",
values_text_color=settings.ctm.BASIC_TEXT_COLOR,
)
# main_window.translation_engine_dropdown_menu_window = _CreateDropdownMenuWindow(
# settings=settings.config_window,
# view_variable=main_window._view_variable,

View File

@@ -13,6 +13,7 @@ class UiScalingManager():
self.main_window_cover = SimpleNamespace()
self.error_message_window = SimpleNamespace()
self.confirmation_modal = SimpleNamespace()
self.dropdown_menu_window = SimpleNamespace()
self._calculatedUiSizes()
@@ -170,7 +171,7 @@ class UiScalingManager():
self.confirmation_modal.BUTTONS_IPADY = self._calculateUiSize(6)
# Dropdown Menu Window
self.config_window.MARGIN_WIDTH = self._calculateUiSize(16)
self.dropdown_menu_window.MARGIN_WIDTH = self._calculateUiSize(16)
# Config Window
self.config_window.DEFAULT_WIDTH = self._calculateUiSize(1080)

View File

@@ -71,14 +71,37 @@ class VRCT_GUI(CTk):
self.settings = settings
self._view_variable = view_variable
self.translation_engine_dropdown_menu_window = _CreateDropdownMenuWindow(
settings=settings.dropdown_menu_window,
view_variable=self._view_variable,
window_additional_y_pos=4,
window_border_width=1,
scrollbar_ipadx=(2,2),
scrollbar_width=16,
value_ipadx=(8,0),
value_ipady=(6,6),
value_pady=0,
value_font_size=14,
dropdown_menu_default_min_width=200,
window_bg_color="#1f2022",
window_border_color="#7f8084",
values_bg_color="#323336",
values_hovered_bg_color="#4b4c4f",
values_clicked_bg_color="#292a2d",
values_text_color=settings.main.ctm.BASIC_TEXT_COLOR,
)
createMainWindowWidgets(
vrct_gui=self,
settings=self.settings.main,
view_variable=self._view_variable
)
# For Config Window
self.dropdown_menu_window = _CreateDropdownMenuWindow(
settings=self.settings.config_window,
settings=self.settings.dropdown_menu_window,
view_variable=self._view_variable,
window_additional_y_pos=self.settings.config_window.uism.SB__DROPDOWN_MENU_WINDOW_ADDITIONAL_Y_POS,