fix(app-iced): 方案 B——说明与「安装选项」标签撤出滚动区,滚动区只装控件
六审算术:滚动视口 103px < 内容 130px,说明 0 像素 + chip 底边框被裁 2 行。方案 C(标签并排) 不可行——六枚 chip 已占 404px、正文列 424px,并排必横向溢出裁掉第六枚,等于用一个已完成项 换另一个。按塔授权走 B: - **滚动区**(仅 Shared 档):head + 六枚 chips,间距 X2→X1; - **钉死区**:说明行(有说明时占「加载器版本」标签那一行,否则显示标签)+ 版本菜单 + 实例名。 钉死区高度不变(两者都是一行),列表仍 4 行; - **钉死档保持旧结构**:把标签撤出会让原版面板矮 26px、列表涨到 302px(6.86 行、切出半行), 实测把 `04` 从 531 挪到 563 —— 第一版就是这个坑,已按此回退。 实测:01/02/05 分隔线 437、列表 **176px = 4.00 整行**、说明墨迹带 y 576–587(真像素); 04 **531 未变**;03/06 268 未变;900 档 569 / 308px = 7.00 整行。
This commit is contained in:
1 parent
cb2cffb3ca
commit
7ea3dbf8f0
1 file changed
+70
-8
@@ -98,7 +98,11 @@ pub(crate) fn section<'a>(
|
|||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.align_y(Alignment::Center);
|
.align_y(Alignment::Center);
|
||||||
|
|
||||||
let mut body = column![
|
// 钉死档(原版 / 没有加载器版本列表)**保持旧结构**:标签与说明都在列内。
|
||||||
|
// 为什么不一并改:`04` 是别处基线图的对照,它的面板矮、列表 6 行——把标签撤出会
|
||||||
|
// 让面板矮 26px,列表涨到 302px(6.86 行)反而切出半行。方案 B 只对 Shared 档生效。
|
||||||
|
if !scroll {
|
||||||
|
let mut plain = column![
|
||||||
head,
|
head,
|
||||||
frame::text_role(
|
frame::text_role(
|
||||||
ui,
|
ui,
|
||||||
@@ -111,6 +115,56 @@ pub(crate) fn section<'a>(
|
|||||||
]
|
]
|
||||||
.spacing(ui.space(Space::X2))
|
.spacing(ui.space(Space::X2))
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
if let Some(note) = &options.note {
|
||||||
|
plain = plain.push(frame::text_role(
|
||||||
|
ui,
|
||||||
|
TypeRole::BodySmall,
|
||||||
|
false,
|
||||||
|
note.as_str(),
|
||||||
|
ui.color(Role::OnSurfaceVariant),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
if show_versions(options) {
|
||||||
|
plain = plain.push(frame::text_role(
|
||||||
|
ui,
|
||||||
|
TypeRole::LabelMedium,
|
||||||
|
false,
|
||||||
|
catalog.text(Key::DownloadOptionsLoaderVersion),
|
||||||
|
ui.color(Role::OnSurfaceVariant),
|
||||||
|
));
|
||||||
|
plain = plain.push(version_list(ui, catalog, options));
|
||||||
|
}
|
||||||
|
if let Some(problem) = &options.problem {
|
||||||
|
plain = plain.push(frame::text_role(
|
||||||
|
ui,
|
||||||
|
TypeRole::BodySmall,
|
||||||
|
false,
|
||||||
|
problem.as_str(),
|
||||||
|
ui.color(Role::Error),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
plain = plain.push(text_field(
|
||||||
|
ui,
|
||||||
|
Field::new(options.instance_name.as_str())
|
||||||
|
.variant(FieldVariant::Outlined)
|
||||||
|
.label(catalog.text(Key::DownloadOptionsInstanceName))
|
||||||
|
.placeholder(catalog.text(Key::DownloadOptionsInstanceNameHint)),
|
||||||
|
Message::SetInstanceName,
|
||||||
|
));
|
||||||
|
return plain.into();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 滚动区只剩 head + 六枚 chips(方案 B,D30 六审裁决)。
|
||||||
|
//
|
||||||
|
// 为什么把「安装选项」标签与中性说明都撤出滚动区:
|
||||||
|
// 五审 82px → 六审 103px 的视口里,head(40) + 标签(17) + chips(32) + 两处间距(16) = 105px,
|
||||||
|
// 差 2px 就把 chip 的底边框裁掉;再塞说明(20px)就差 27~29px,说明整块 0 像素。
|
||||||
|
// 并排标签(方案 C)在这里不可行:六枚 chip 实测已占 404px,正文列只有 424px,
|
||||||
|
// 加上「安装选项」必然横向溢出、把第六枚裁掉——那是拿一个已完成项换另一个。
|
||||||
|
// 所以按塔授权的 B 落地:标签与说明都搬到钉死区(见下面的 `pinned`),滚动区只装控件。
|
||||||
|
let mut body = column![head, loader_row(ui, catalog, options)]
|
||||||
|
.spacing(ui.space(Space::X1))
|
||||||
|
.width(Length::Fill);
|
||||||
|
|
||||||
// 中性说明(M222):只解释这一页能装到哪一层,不套错误色、不影响确认键。
|
// 中性说明(M222):只解释这一页能装到哪一层,不套错误色、不影响确认键。
|
||||||
// 换行由 iced 的文本布局负责,长句不会横向溢出;但**视觉验收仍需截图确认**(D30)。
|
// 换行由 iced 的文本布局负责,长句不会横向溢出;但**视觉验收仍需截图确认**(D30)。
|
||||||
@@ -141,13 +195,26 @@ pub(crate) fn section<'a>(
|
|||||||
// 钉死区:加载器版本菜单 + 实例名(都不参与滚动)。见 `section` 的文档。
|
// 钉死区:加载器版本菜单 + 实例名(都不参与滚动)。见 `section` 的文档。
|
||||||
let mut pinned = column![].spacing(ui.space(Space::X2)).width(Length::Fill);
|
let mut pinned = column![].spacing(ui.space(Space::X2)).width(Length::Fill);
|
||||||
if show_versions(options) {
|
if show_versions(options) {
|
||||||
pinned = pinned.push(frame::text_role(
|
// 菜单上方那一行:**有中性说明就显示说明**(它讲的是「这一家的叠法」,
|
||||||
|
// 位置就在版本菜单正上方,语义对得上),没有说明时才退回通用标签。
|
||||||
|
// 高度相同(BodySmall 与 LabelMedium 都是一行),所以钉死区不涨。
|
||||||
|
let line = match &options.note {
|
||||||
|
Some(note) => frame::text_role(
|
||||||
|
ui,
|
||||||
|
TypeRole::BodySmall,
|
||||||
|
false,
|
||||||
|
note.as_str(),
|
||||||
|
ui.color(Role::OnSurfaceVariant),
|
||||||
|
),
|
||||||
|
None => frame::text_role(
|
||||||
ui,
|
ui,
|
||||||
TypeRole::LabelMedium,
|
TypeRole::LabelMedium,
|
||||||
false,
|
false,
|
||||||
catalog.text(Key::DownloadOptionsLoaderVersion),
|
catalog.text(Key::DownloadOptionsLoaderVersion),
|
||||||
ui.color(Role::OnSurfaceVariant),
|
ui.color(Role::OnSurfaceVariant),
|
||||||
));
|
),
|
||||||
|
};
|
||||||
|
pinned = pinned.push(line);
|
||||||
pinned = pinned.push(version_list(ui, catalog, options));
|
pinned = pinned.push(version_list(ui, catalog, options));
|
||||||
}
|
}
|
||||||
pinned = pinned.push(text_field(
|
pinned = pinned.push(text_field(
|
||||||
@@ -159,11 +226,6 @@ pub(crate) fn section<'a>(
|
|||||||
Message::SetInstanceName,
|
Message::SetInstanceName,
|
||||||
));
|
));
|
||||||
|
|
||||||
if !scroll {
|
|
||||||
// 钉死档(三栏 + 无版本列表 / chips 以外的矮面板):行为与以前一致,一列内容到底。
|
|
||||||
body = body.push(Element::from(pinned));
|
|
||||||
return body.into();
|
|
||||||
}
|
|
||||||
column![
|
column![
|
||||||
scrollable(body)
|
scrollable(body)
|
||||||
.height(Length::Fill)
|
.height(Length::Fill)
|
||||||
|
|||||||
Reference in new issue
Block a user