[Update] Main Window: (WIP UI) CTranslate2、内部翻訳機能などの追加により、メイン画面にUI追加。デザインは確定ではなく、UI Scaling未対応などテスト状態です。

This commit is contained in:
Sakamoto Shiina
2024-01-13 12:37:37 +09:00
parent 017963bb0b
commit 8c64b91839
8 changed files with 202 additions and 20 deletions

View File

@@ -42,6 +42,17 @@ def getLongestText(text_list:list):
longest_text = text
return longest_text
def getLongestText_Dict(text_dict:dict):
max_length = 0
longest_text = ""
for key, text in text_dict.items():
if len(text) > max_length:
max_length = len(text)
longest_text = text
return longest_text
def calculateUiSize(default_size, scaling_float, is_allowed_odd:bool=False, is_zero_allowed:bool=False):
size = int(default_size * scaling_float)
size += 1 if not is_allowed_odd and size % 2 != 0 else 0