From 731056c8a1439e0f95e74d6d6b7ad715d80857d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Mon, 25 Nov 2024 00:27:40 +0800 Subject: [PATCH] . --- .../gui/dialog_savedgame_setting.py | 14 ++++- py/LunaTranslator/gui/setting_textinput.py | 57 ------------------- 2 files changed, 11 insertions(+), 60 deletions(-) diff --git a/py/LunaTranslator/gui/dialog_savedgame_setting.py b/py/LunaTranslator/gui/dialog_savedgame_setting.py index d61f5cc6..cddd59a3 100644 --- a/py/LunaTranslator/gui/dialog_savedgame_setting.py +++ b/py/LunaTranslator/gui/dialog_savedgame_setting.py @@ -807,12 +807,20 @@ class dialog_setting_game_internal(QWidget): table = TableViewW() - table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeMode.Stretch) + table.setModel(model) + table.horizontalHeader().setSectionResizeMode( + 2, QHeaderView.ResizeMode.ResizeToContents + ) + table.horizontalHeader().setSectionResizeMode( + 1, QHeaderView.ResizeMode.ResizeToContents + ) + table.horizontalHeader().setSectionResizeMode( + 0, QHeaderView.ResizeMode.Stretch + ) table.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers) table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) table.setSelectionMode((QAbstractItemView.SelectionMode.SingleSelection)) table.setWordWrap(False) - table.setModel(model) table.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) table.customContextMenuRequested.connect(self.__privatetextproc_showmenu) @@ -876,7 +884,7 @@ class dialog_setting_game_internal(QWidget): self.__textprocinternalmodel.insertRow( row, [ - QStandardItem(postprocessconfig[_internal]["name"]), + QStandardItem(_TR(postprocessconfig[_internal]["name"])), QStandardItem(), QStandardItem(), ], diff --git a/py/LunaTranslator/gui/setting_textinput.py b/py/LunaTranslator/gui/setting_textinput.py index da6cd679..e6e9988b 100644 --- a/py/LunaTranslator/gui/setting_textinput.py +++ b/py/LunaTranslator/gui/setting_textinput.py @@ -429,63 +429,6 @@ def filetranslate(self): "group", ), ], - [ - ( - dict( - title="LiveCaptions", - type="grid", - grid=[ - [ - "开始", - D_getsimpleswitch( - globalconfig["sourcestatus2"]["livecaptions"], - "use", - name="livecaptions", - parent=self, - callback=functools.partial( - yuitsu_switch, - self, - globalconfig["sourcestatus2"], - "sourceswitchs", - "livecaptions", - gobject.baseobject.starttextsource, - ), - pair="sourceswitchs", - ), - ], - [ - "截取行数", - D_getspinbox( - 1, - 10, - globalconfig, - "livecaptions_cachesentence", - ), - ], - [ - "刷新延迟_(ms)", - D_getspinbox( - 10, - 100000, - globalconfig, - "livecaptions_delay", - ), - ], - [ - "最长等待时间_(ms)", - D_getspinbox( - 10, - 100000, - globalconfig, - "livecaptions_maxwait", - ), - ], - ], - ), - 0, - "group", - ), - ], ] return grids