MCPcopy Create free account
hub / github.com/BasicProtein/AugmentCode-Free / _create_patch_section

Method _create_patch_section

gui_qt6/main_page.py:224–265  ·  view source on GitHub ↗

创建代码补丁区域

(self, parent_layout)

Source from the content-addressed store, hash-verified

222 self._create_patch_section(parent_layout)
223
224 def _create_patch_section(self, parent_layout):
225 """创建代码补丁区域"""
226 # 补丁区域标题
227 self.patch_title_label = SubtitleLabel(get_text("app.code_patch"))
228 parent_layout.addWidget(self.patch_title_label)
229
230 # 补丁框架
231 patch_frame = SectionFrame()
232 patch_layout = QVBoxLayout(patch_frame)
233 patch_layout.setSpacing(8) # 减少间距
234
235 # 补丁按钮组 - 优化布局
236 patch_btn_layout = QHBoxLayout()
237 patch_btn_layout.setSpacing(12) # 增加间距
238 patch_btn_layout.setContentsMargins(5, 0, 5, 0) # 添加左右边距
239
240 # 应用补丁按钮
241 self.apply_patch_btn = ModernButton(get_text("buttons.apply_patch"), "success")
242 self.apply_patch_btn.setMaximumHeight(35) # 减少高度使布局更紧凑
243 self.apply_patch_btn.setMinimumWidth(150) # 大幅增加最小宽度以适应英文
244 patch_btn_layout.addWidget(self.apply_patch_btn)
245
246 # 恢复原始文件按钮
247 self.restore_patch_btn = ModernButton(get_text("buttons.restore_files"), "warning")
248 self.restore_patch_btn.setMaximumHeight(35)
249 self.restore_patch_btn.setMinimumWidth(150) # 大幅增加最小宽度以适应英文
250 patch_btn_layout.addWidget(self.restore_patch_btn)
251
252 # 扫描状态按钮
253 self.scan_patch_btn = ModernButton(get_text("buttons.scan_status"), "secondary")
254 self.scan_patch_btn.setMaximumHeight(35)
255 self.scan_patch_btn.setMinimumWidth(150) # 大幅增加最小宽度以适应英文
256 patch_btn_layout.addWidget(self.scan_patch_btn)
257
258 patch_layout.addLayout(patch_btn_layout)
259
260 # 补丁状态显示
261 self.patch_status_label = SecondaryLabel(get_text("status.not_scanned"))
262 self.patch_status_label.setStyleSheet("color: #6b7280; font-style: italic; font-size: 10px;")
263 patch_layout.addWidget(self.patch_status_label)
264
265 parent_layout.addWidget(patch_frame)
266
267 def _create_log_section(self, parent_layout):
268 """创建日志区域"""

Callers 1

Calls 5

get_textFunction · 0.90
SubtitleLabelClass · 0.85
SectionFrameClass · 0.85
ModernButtonClass · 0.85
SecondaryLabelClass · 0.85

Tested by

no test coverage detected