refactor(gui/sidebar): 重组导航为四模块 + 扁平无框蓝色高亮主题 + 中括号移除
数据层(panel_registry.py):13 个 step 从「阶段一/二/三/四」重组为四个模块 模块一 影像预处理(step 1-3) 模块二 特征工程与数据(step 4-7) 模块三 模型训练与反演(step 8-10) 模块四 制图与成果汇编(step 11-13) step_id 顺序、tab_index、面板绑定、Tab 路由全部保持零变化 文本层(water_quality_gui.py / v2):移除 └─ 字符前缀 样式层(styles.py:get_sidebar_stylesheet):扁平无框 + 蓝色高亮主题 - 容器 QListWidget 无框化(border: none / outline: none / 透明背景) - 步骤项 padding 8px 6px + margin 2px 8px + border-radius 4px - hover 极浅蓝灰 #F0F4F8;selected 饱和蓝 #0078D4 + 白字 #FFFFFF - 分类头(stage_header):!enabled 选择器锁定 → 蓝色 #0078D4 + 加粗 + 上下间距 Python 代码侧:stage_item.setForeground 硬编码 #0078D4、stage_font.setBold(True) 作为 QSS 失效兜底 + 代码意图自解释 末尾迭代:四个模块名移除 [ ] 中括号(极简风)
This commit is contained in:
@ -538,8 +538,21 @@ class ModernStylesheet:
|
||||
|
||||
@staticmethod
|
||||
def get_sidebar_stylesheet():
|
||||
"""获取左侧边栏样式表"""
|
||||
"""获取左侧边栏样式表
|
||||
|
||||
设计主题:扁平无框 + 蓝色高亮。
|
||||
结构契约:
|
||||
- 分类头 stage_header 项已通过 setFlags(~Qt.ItemIsEnabled) 禁用,
|
||||
因此 :!enabled 选择器可精确锁定分类头(蓝色加粗)。
|
||||
- 可点击的步骤项保持 enabled,进入 :enabled 通道
|
||||
(padding/margin 留白 + 圆角 + hover/selected 蓝色现代感)。
|
||||
"""
|
||||
colors = ModernStylesheet.COLORS
|
||||
# 主题色板(蓝色高亮)
|
||||
stage_header_color = '#0078D4' # 分类头:亮蓝色加粗
|
||||
step_hover_bg = '#F0F4F8' # hover(极浅蓝灰)
|
||||
step_selected_bg = '#0078D4' # selected(饱和蓝)
|
||||
step_selected_fg = '#FFFFFF' # selected(白字)
|
||||
return f"""
|
||||
QWidget {{
|
||||
background-color: {colors['panel_bg']};
|
||||
@ -549,22 +562,47 @@ class ModernStylesheet:
|
||||
color: {colors['text_primary']};
|
||||
font-weight: bold;
|
||||
}}
|
||||
/* ── 容器:无框化、零描边、零焦点环 ── */
|
||||
QListWidget {{
|
||||
background-color: {colors['panel_bg']};
|
||||
border: 0px;
|
||||
border-right: 1px solid {colors['border_light']};
|
||||
}}
|
||||
QListWidget::item {{
|
||||
padding: 8px;
|
||||
border-left: 3px solid transparent;
|
||||
}}
|
||||
QListWidget::item:hover {{
|
||||
background-color: {colors['hover']};
|
||||
}}
|
||||
QListWidget::item:selected {{
|
||||
border: none;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
color: {colors['accent']};
|
||||
border-left: 3px solid {colors['accent']};
|
||||
}}
|
||||
/* ── 分类头(stage_header,禁用态):亮蓝色 + 加粗 + 上下间距 ── */
|
||||
QListWidget::item:!enabled {{
|
||||
color: {stage_header_color};
|
||||
font-weight: bold;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 14px 8px 6px 8px;
|
||||
margin-top: 4px;
|
||||
}}
|
||||
/* ── 步骤项(enabled):padding/margin 留白 + 圆角过渡 ── */
|
||||
QListWidget::item:enabled {{
|
||||
color: {colors['text_secondary']};
|
||||
padding: 8px 6px;
|
||||
margin: 2px 8px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
}}
|
||||
/* ── 步骤项 hover(未选中态):极浅蓝灰悬浮 ── */
|
||||
QListWidget::item:enabled:hover:!selected {{
|
||||
background-color: {step_hover_bg};
|
||||
color: {colors['text_primary']};
|
||||
}}
|
||||
/* ── 步骤项 selected:饱和蓝高亮 + 白字 ── */
|
||||
QListWidget::item:enabled:selected {{
|
||||
background-color: {step_selected_bg};
|
||||
color: {step_selected_fg};
|
||||
border: none;
|
||||
font-weight: bold;
|
||||
}}
|
||||
/* ── 分隔符占位项:完全透明,零干扰 ── */
|
||||
QListWidget::item[separator="true"] {{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
min-height: 4px;
|
||||
}}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user