feat: compact cover template actions

This commit is contained in:
chengma
2026-07-02 11:26:03 +08:00
parent 86b931b26d
commit 4c7d4fc624
6 changed files with 54 additions and 23 deletions
+20 -12
View File
@@ -811,9 +811,16 @@ if QT_IMPORT_ERROR is None:
self.cover_template_combo.setObjectName("coverTemplateCombo")
self.new_cover_template_button = QPushButton("新建")
self.save_cover_template_button = QPushButton("保存")
self.save_cover_template_as_button = QPushButton("另存为")
self.rename_cover_template_button = QPushButton("重命名")
self.delete_cover_template_button = QPushButton("删除")
self.cover_template_actions_button = QPushButton("模板操作")
self.cover_template_actions_button.setObjectName("coverTemplateActionsButton")
self.cover_template_actions_menu = QMenu(self)
self.save_cover_template_as_action = self.cover_template_actions_menu.addAction("另存为")
self.save_cover_template_as_action.setObjectName("saveCoverTemplateAsAction")
self.rename_cover_template_action = self.cover_template_actions_menu.addAction("重命名")
self.rename_cover_template_action.setObjectName("renameCoverTemplateAction")
self.delete_cover_template_action = self.cover_template_actions_menu.addAction("删除")
self.delete_cover_template_action.setObjectName("deleteCoverTemplateAction")
self.cover_template_actions_button.setMenu(self.cover_template_actions_menu)
self.insert_title_button = QPushButton("插入标题")
self.preview_prompt_button = QPushButton("预览")
self.generate_button = QPushButton("开始生成")
@@ -834,9 +841,8 @@ if QT_IMPORT_ERROR is None:
cover_template_layout = QHBoxLayout()
cover_template_layout.addWidget(self.new_cover_template_button)
cover_template_layout.addWidget(self.save_cover_template_button)
cover_template_layout.addWidget(self.save_cover_template_as_button)
cover_template_layout.addWidget(self.rename_cover_template_button)
cover_template_layout.addWidget(self.delete_cover_template_button)
cover_template_layout.addWidget(self.cover_template_actions_button)
cover_template_layout.addStretch(1)
left_layout.addLayout(cover_template_layout)
left_layout.addWidget(self.cover_prompt_edit, 2)
cover_action_layout = QHBoxLayout()
@@ -931,9 +937,9 @@ if QT_IMPORT_ERROR is None:
self.cover_template_combo.currentIndexChanged.connect(self.load_selected_cover_template)
self.new_cover_template_button.clicked.connect(self.new_cover_template)
self.save_cover_template_button.clicked.connect(self.save_cover_template)
self.save_cover_template_as_button.clicked.connect(self.save_cover_template_as)
self.rename_cover_template_button.clicked.connect(self.rename_cover_template)
self.delete_cover_template_button.clicked.connect(self.delete_cover_template)
self.save_cover_template_as_action.triggered.connect(self.save_cover_template_as)
self.rename_cover_template_action.triggered.connect(self.rename_cover_template)
self.delete_cover_template_action.triggered.connect(self.delete_cover_template)
self.insert_title_button.clicked.connect(self.insert_title_placeholder)
self.preview_prompt_button.clicked.connect(self.preview_cover_prompt)
self.generate_button.clicked.connect(self.start_generate)
@@ -1266,10 +1272,12 @@ if QT_IMPORT_ERROR is None:
self.item_filter.setEnabled(not running)
self.status_filter.setEnabled(not running)
self.save_title_button.setEnabled(not running)
self.new_cover_template_button.setEnabled(not running)
self.save_cover_template_button.setEnabled(not running)
self.save_cover_template_as_button.setEnabled(not running)
self.rename_cover_template_button.setEnabled(not running)
self.delete_cover_template_button.setEnabled(not running)
self.cover_template_actions_button.setEnabled(not running)
self.save_cover_template_as_action.setEnabled(not running)
self.rename_cover_template_action.setEnabled(not running)
self.delete_cover_template_action.setEnabled(not running)
def _forget_generate_thread(self, thread):
if self.generate_thread is thread: