MCPcopy Index your code
hub / github.com/BasicProtein/AugmentCode-Free / _setup_window

Method _setup_window

gui_qt6/main_window.py:49–80  ·  view source on GitHub ↗

设置窗口属性

(self)

Source from the content-addressed store, hash-verified

47 self._show_initial_page()
48
49 def _setup_window(self):
50 """设置窗口属性"""
51 # 窗口标题
52 self.setWindowTitle(get_text("app.title"))
53
54 # 窗口大小和位置
55 geometry = self.config_manager.get_window_geometry()
56 if 'x' in geometry:
57 # 解析几何字符串 "500x750+100+100"
58 parts = geometry.replace('+', 'x').split('x')
59 if len(parts) >= 2:
60 width, height = int(parts[0]), int(parts[1])
61 # 确保最小尺寸:宽度680px,高度780px
62 width = max(width, 680) # 确保最小宽度
63 height = max(height, 780)
64 self.resize(width, height)
65 else:
66 self.resize(680, 780) # 大幅增加宽度以容纳更宽的按钮
67
68 # 禁用窗口大小调整
69 self.setFixedSize(self.size())
70
71 # 居中显示
72 self._center_window()
73
74 # 设置窗口图标(如果有的话)
75 try:
76 # 这里可以设置应用图标
77 # self.setWindowIcon(QIcon("icon.png"))
78 pass
79 except:
80 pass
81
82 def _center_window(self):
83 """将窗口居中显示"""

Callers 1

__init__Method · 0.95

Calls 3

_center_windowMethod · 0.95
get_textFunction · 0.90
get_window_geometryMethod · 0.80

Tested by

no test coverage detected