跨端: 宽屏两栏各自圆角(原来只有外壳有,内部两半是直角)

用户:「同时邮件展示左侧没有圆角」。

WebUI 宽屏的真结构是**三个独立圆角面板并排**(App.tsx:262):
    <div className="app-shell">        ← padding/gap = 10px
      <Sidebar/>  {list}  {main}        ← 每个子元素各自 border-radius:14px
    </div>
(index.css:968 的 .app-shell > * 统一给 border-radius,第 1070 行在壁纸态再加
 overflow:hidden + 阴影)。所以列表栏与详情栏**各有自己的四个圆角**,
中间的缝里透出壁纸。

我们这边是一个 Navigation,由系统 Split 成 navBar + content 两半,
圆角只加在**外壳**上 ⇒ 内部这两半是直角。实测(模拟器 3184×2232):
详情栏白区左缘在 y=145 与 y=2195 都是 x=1152 —— **完全垂直,没有圆角**。

修法:给两栏**各自**补圆角 + 裁切(与 WebUI 的 .app-shell > * 逐条对应),
左栏在 navBar 内容根、右栏在 NavDestination 上。
修后实测白区左缘:y=145→x=1178、y=165→1156、y=185→1152(圆弧正确),
下角同理(y=2190→1165、y=2196→1172)。

★ 顺带给 MailDetailDestination 补 bgActive 参数(圆角要在壁纸开启时才有 ——
  与 WebUI 一致:非壁纸态 .app-shell > * 也圆角,但那时底色是实心的,
  圆角看不出来;壁纸态才需要圆角把缝让出来)。
This commit is contained in:
2026-09-20 11:14:05 +08:00
parent 6ca0113fd2
commit ed1ae02441

View File

@ -123,6 +123,8 @@ struct MailDetailDestination {
@State accountId: string = '';
/** 底部悬浮条高度(窄屏非 0)——透传给详情页,让它的回复球抬过条 */
@Prop navReserve: number = 0;
/** 壁纸是否开启。宽屏下本栏要**自己**有圆角(WebUI `app-shell > *` 的对应物) */
@Prop bgActive: boolean = false;
private pathStack: NavPathStack = new NavPathStack();
handleReady(ctx: NavDestinationContext): void {
@ -150,6 +152,26 @@ struct MailDetailDestination {
}
}
.hideTitleBar(true)
/*
* ★★ 2026-09-20 修(用户:「邮件展示左侧没有圆角」)。
*
* WebUI 宽屏的真结构是**三个独立圆角面板并排**(`App.tsx:262`):
*
* <div className="app-shell"> ← padding/gap = 10px
* <Sidebar/> {list} {main} ← 每个子元素各自 border-radius:14px
* </div>
*
* 所以列表栏和详情栏**各有自己的四个圆角**,中间的缝里透出壁纸。
*
* 我们这边是一个 `Navigation`,由系统 Split 成 navBar + content 两半,
* 圆角只加在**外壳**(那个 `Row` 里的内容列)上 ⇒ 内部这两半变成直角,
* 实测详情栏白区左缘在 y=145 与 y=2195 都是 `x=1152`(**完全垂直、无圆角**)。
*
* 修法:给**右栏**(`NavDestination`)自己补上圆角 + 裁切,
* 与 WebUI 的 `app-shell > *` 逐条对应;左栏(navBar 内容)在它的根容器上补。
*/
.borderRadius(this.bgActive ? Theme.glassRadius : 0)
.clip(this.bgActive)
.onReady((ctx: NavDestinationContext) => { this.handleReady(ctx); })
}
}
@ -1456,7 +1478,7 @@ struct CommPage {
@Builder
DestinationBuilder(name: string, param: Object) {
if (name === MAIL_DETAIL_ROUTE) {
MailDetailDestination({ navReserve: this.navReserve })
MailDetailDestination({ navReserve: this.navReserve, bgActive: this.bgActive })
}
}
@ -1516,6 +1538,21 @@ struct CommPage {
* `.bg-white .bg-white { backdrop-filter: none }` 明确禁止的事。
*/
.attributeModifier(PaneModifier.of(this.bgActive))
/*
* ★★ 2026-09-20(用户:「邮件展示左侧没有圆角」)。
*
* 这一层是**左栏(列表)**的根。WebUI 宽屏是三个**独立圆角面板**并排
* (`App.tsx:262` 的 `.app-shell` 下 `<Sidebar/>{list}{main}`,
* `index.css:968` 给 `.app-shell > *` 统一 `border-radius` + 裁切),
* 所以列表栏与详情栏**各自有四个圆角**,中间的缝里透出壁纸。
*
* 我们这边列表在 `Navigation` 的 navBar 里、详情在 content 里,
* 系统只给一条分割线 ⇒ 内部两栏是直角。实测详情栏白区左缘
* 在 y=145 与 y=2195 都是 `x=1152`(完全垂直,无圆角)。
* 这里给左栏补上,与右栏那处成对。
*/
.borderRadius(this.bgActive ? Theme.glassRadius : 0)
.clip(this.bgActive)
/*
* 悬浮的圆形加号(用户点名要的形状):56 圆、品牌色、右下角。
@ -1760,7 +1797,7 @@ struct ContactsTab {
@Builder
DestinationBuilder(name: string, param: Object) {
if (name === MAIL_DETAIL_ROUTE) {
MailDetailDestination({ navReserve: this.navReserve })
MailDetailDestination({ navReserve: this.navReserve, bgActive: this.bgActive })
}
}