Skip to content

fix: 重构toast,修改UI设计并修复无宽度限制的问题 - #3515

Open
sysfox wants to merge 18 commits into
PCL-Community:devfrom
sysfox:dev
Open

fix: 重构toast,修改UI设计并修复无宽度限制的问题#3515
sysfox wants to merge 18 commits into
PCL-Community:devfrom
sysfox:dev

Conversation

@sysfox

@sysfox sysfox commented Aug 8, 2026

Copy link
Copy Markdown

概括

本次更新重构 Toast 提示系统:

  1. 支持多弹窗 Z 轴叠置、回弹入场、悬停暂停与拖拽关闭;
  2. 信息类型改用主题色,图标、标题与详情弹窗按类型联动同色;
  3. 详情弹窗新增复制按钮;旧弹窗渐隐并加毛玻璃模糊,层级更清晰。
image image image image

注意

Important

包含debug用组件,确认合并前请@我删除相关无用代码

Summary by Sourcery

重构 toast 通知系统,以改进布局、堆叠方式和视觉层级,并让详情对话框与 toast 类型保持一致。

New Features:

  • 新增可点击的 toast 详情对话框,具有按类型定制的标题,并支持复制到剪贴板。
  • 引入悬停暂停行为:当鼠标悬停在 toast 上时,会暂停自动关闭计时器,并在进度条上提供可视化反馈。
  • 在启动器设置页面中提供调试 UI 控件,用于触发单个或批量的 toast 通知。

Bug Fixes:

  • 限制 toast 的最大宽度,防止在大尺寸窗口上出现过于宽大的通知。

Enhancements:

  • 重新设计 toast 的进入、强调和消失动画,包括图标的微交互动效以及拖拽关闭行为。
  • 实现堆叠式 toast 布局,采用底部对齐、z-index 排序、不透明度调暗以及模糊效果,以强化视觉层级关系。
  • 更新 toast 与对话框的颜色映射:信息类消息使用主题色,其他类型使用饱和的状态色,同时保持图标、标题和重点强调颜色的一致性。
  • 调整内部的 toast 管理逻辑,使最新的 toast 显示在底部,较旧的 toast 从上方“露头”,并在移除时自动重新排布。
Original summary in English

Summary by Sourcery

Refactor the toast notification system to improve layout, stacking, and visual hierarchy while aligning detail dialogs with toast types.

New Features:

  • Add clickable toast detail dialogs with type-specific titles and copy-to-clipboard support.
  • Introduce hover-to-pause behavior for toast auto-dismiss timers with visual feedback on the progress bar.
  • Provide debug UI controls for triggering single and batched toast notifications from the launcher settings page.

Bug Fixes:

  • Limit toast width to a reasonable maximum to prevent overly wide notifications on large windows.

Enhancements:

  • Redesign toast entrance, emphasis, and dismissal animations including icon micro-interactions and drag-to-dismiss behavior.
  • Implement stacked toast layout with bottom anchoring, z-index ordering, opacity dimming, and blur effects to clarify visual hierarchy.
  • Update toast and dialog color mapping so information messages use theme colors while other types use saturated status colors, keeping icons, titles, and accents consistent.
  • Adjust internal toast management so newest toasts appear at the bottom, older ones peek above, and removal triggers automatic reflow.

sysfox added 17 commits August 8, 2026 01:16
- TitleText MaxHeight 48→96,约 6 行
- 鼠标悬停 toast 时冻结进度条并停住隐藏倒计时,移出后按剩余时间续走;与拖拽互斥
- 重复触发强调动画改为三段回弹(-14/+18/-4),净位移归零
- Info 类型图标、楔形条、底部加载条改用主题色 ColorBrush2(动态跟随主题切换)
- MyMsgBoxConverter 新增 HintType 字段,新增 MyMsgBoxByHintType 入口
- 点击 toast 展开的详情弹窗按提示类型显示图标与配色(Info 主题色,Error 标题与按钮变红)
- 滑出 200→150ms、淡出 150→110ms,消失更利落
- 新增 _hideStartsAtTick 记录倒计时终点:进入滑出阶段后悬停不再暂停,
  杜绝停掉半途隐藏导致卡半透明、永不消失;MouseLeave 异常路径直接放行消失
- 标题与分割线颜色跟随图标(toast 类型色),仅 HintType 非空时生效;普通警告弹窗的红色标题不受影响
- 按钮区新增复制按钮,点击把正文写入剪贴板(复用 Common.Action.Copy)
- 按叠置次序淡化:最新 1.0,旧弹窗递减至 55% 下限,200ms 过渡
- 入场中/拖拽中/隐藏滑出中的弹窗淡化系统不介入,避免 Opacity 动画冲突
- 入场结束经 NotifyToastShown 复位并重新分层;Emphasize/拖拽中断入场时复位 IsEntering,防止淡化被永久跳过
- 复制按钮从底部右侧按钮组独立到左下,确认/取消按钮组保持右侧
- toast 文本 MaxHeight 96→32(2 行),长文本点击展开看详情
- 关闭按钮 20→26px,图标随按钮自适应放大
- RootGrid 挂 BlurEffect 模糊卡片内容,背景迁移到 RootGrid 一起模糊(8px 圆角裁剪)
- 模糊与淡化同组联动:最新清晰,旧弹窗 BlurRadius 按叠置次序 5+i*4.5 递增、封顶 14
- ResetDimBlur 统一复位时机:隐藏滑出/拖拽/强调前清零,防止残留模糊
@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels Aug 8, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

审阅者指南

重构 Toast 通知系统,以支持叠放布局、鼠标悬停暂停、拖拽关闭,以及与详情对话框的联动,同时更新视觉设计并添加调试/测试钩子。

Toast 叠放与变暗生命周期的时序图

sequenceDiagram
    participant Timer
    participant HintService
    participant PanHint
    participant MyToast

    Timer->>HintService: Tick()
    HintService->>PanHint: Children.Insert(0, toast)
    HintService->>MyToast: Show()
    MyToast->>HintService: NotifyToastShown(this)
    HintService->>HintService: RearrangeToasts()

    Note over HintService,MyToast: When limit reached
    Timer->>HintService: Tick()
    HintService->>PanHint: LastOrDefault(t)
    HintService->>MyToast: Dismiss()
    MyToast->>PanHint: Children.Remove(this)
    MyToast->>HintService: OnToastRemoved(this)
    HintService->>HintService: RearrangeToasts()
Loading

文件级变更

变更 详情 文件
重构 Toast 的显示/隐藏、布局和动画行为,以支持叠放式 Toast、悬停暂停,以及拖拽/进入/隐藏的协同。
  • 引入状态标记和计时字段,用于跟踪进入、拖拽及隐藏动画阶段。
  • 限制 Toast 最大宽度,并调整边距、图标缩放动画以及强调型运动曲线。
  • 添加集中式回调,在 Toast 显示或移除时通知 HintService。
  • 优化隐藏和关闭动画,包括模糊重置、不透明度时间控制以及面板子元素移除钩子。
  • 实现基于悬停的自动隐藏进度条与倒计时的暂停与恢复。
Plain Craft Launcher 2/Controls/MyToast.xaml.cs
实现叠放式 Toast 布局管理,根据最新程度处理 Z 轴顺序、垂直偏移、变暗和模糊效果。
  • 跟踪用于 Toast 预览高度和底部边距的布局常量。
  • 将新 Toast 插入容器前端,并在超出容量时选择最旧的 Toast 进行自动关闭。
  • 新增 RearrangeToasts,用于重新定位活动 Toast、设置底部对齐并管理 ZIndex。
  • 按 Toast 分别动画处理不透明度与模糊,以在视觉上弱化较旧消息。
  • 暴露 Toast 移除和 Toast 显示事件的钩子,以触发重新布局。
Plain Craft Launcher 2/Modules/UI/HintService.cs
添加与 Toast 相关的调试/测试界面,可从设置/杂项页面触发单条或批量通知。
  • 添加一个处理函数,用于根据用户输入文本和可选的提示类型触发单个测试 Toast。
  • 添加一个处理函数,用于触发一批测试 Toast,并在多种提示类型间循环。
  • 校验输入文本,对空内容通过提示系统给出警告。
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml
扩展消息框以支持按提示类型驱动的标题图标、颜色和“复制到剪贴板”操作,并新增辅助方法使 Toast 能打开此类对话框。
  • 在 MyMsgBoxConverter 中添加可选 HintType,并在 MyMsgText 中使用它配置标题图标和强调画刷。
  • 将提示类型映射到与 Toast 视觉保持一致的图标字形及基于 HSL 的强调色。
  • 将 LabTitle 和分割线样式绑定到提示强调画刷。
  • 新增“复制”按钮处理函数,用于将标题文本复制到剪贴板。
  • 新增 MyMsgBoxByHintType 辅助方法,以指定提示类型及默认标题/按钮文案来排队文本对话框。
Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs
Plain Craft Launcher 2/Modules/ModMain.cs
Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml
更新 Toast 的 XAML 和主窗体布局,以支持新的视觉元素和叠放行为,并为 Toast 详情对话框集成本地化字符串。
  • 调整 Toast 控件模板,加入强调条、进度轨道、可模糊的 RootGrid 背景以及图标绑定。
  • 更新 FormMain 中 Toast 容器配置,以适配底部对齐的叠放式 Toast。
  • 在语言资源文件中添加 Toast 详情对话框标题和确认按钮文本的本地化字符串。
Plain Craft Launcher 2/Controls/MyToast.xaml
Plain Craft Launcher 2/FormMain.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml

可能关联的问题

  • #重新添加 Toast 通知:此 PR 完整重构并重新实现 Toast 通知系统,满足“重新添加 Toast 通知”这一需求。
  • #(none provided):PR 全面重构 Toast 通知样式与行为,用新的叠放式弹窗替换旧的左下角通知,实现所提设计。

技巧与指令

与 Sourcery 交互

  • 触发新的审阅: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub Issue: 回复审阅评论并请求 Sourcery 从该评论创建 Issue。也可以直接回复审阅评论 @sourcery-ai issue 来创建 Issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写入 @sourcery-ai,即可随时生成标题。也可以在 Pull Request 中评论 @sourcery-ai title 以(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 正文中任意位置写入 @sourcery-ai summary,即可在对应位置随时生成 PR 摘要。也可以在 Pull Request 中评论 @sourcery-ai summary 以(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 批量解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。适用于你已处理所有评论且不再希望看到它们的场景。
  • 批量取消所有 Sourcery 审阅: 在 Pull Request 中评论 @sourcery-ai dismiss,即可取消所有现有的 Sourcery 审阅。特别适合希望从头开始新的审阅的情况——别忘了再评论 @sourcery-ai review 以触发新审阅!

自定义你的体验

前往你的 控制面板

  • 启用或禁用审阅功能,例如 Sourcery 自动生成的 Pull Request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Refactors the toast notification system to support stacked layout, hover-pause, drag-close, and coordinated detail dialogs, while updating visual design and adding debug/testing hooks.

Sequence diagram for toast stacking and dimming lifecycle

sequenceDiagram
    participant Timer
    participant HintService
    participant PanHint
    participant MyToast

    Timer->>HintService: Tick()
    HintService->>PanHint: Children.Insert(0, toast)
    HintService->>MyToast: Show()
    MyToast->>HintService: NotifyToastShown(this)
    HintService->>HintService: RearrangeToasts()

    Note over HintService,MyToast: When limit reached
    Timer->>HintService: Tick()
    HintService->>PanHint: LastOrDefault(t)
    HintService->>MyToast: Dismiss()
    MyToast->>PanHint: Children.Remove(this)
    MyToast->>HintService: OnToastRemoved(this)
    HintService->>HintService: RearrangeToasts()
Loading

File-Level Changes

Change Details Files
Refactor toast show/hide, layout, and animation behavior to support stacked toasts, hover pause, and drag/enter/hide coordination.
  • Introduce state flags and timing fields to track entering, dragging, and hide animation phases.
  • Limit toast max width and adjust margins, icon scale-in animation, and emphasize motion curve.
  • Add centralized callbacks for when a toast is shown or removed to notify the hint service.
  • Refine hide and dismiss animations, including blur reset, opacity timing, and panel child removal hooks.
  • Implement hover-based pause and resume of the auto-hide progress bar and countdown.
Plain Craft Launcher 2/Controls/MyToast.xaml.cs
Implement stacked toast layout management with z-ordering, vertical offsets, dimming, and blur based on recency.
  • Track layout constants for toast peek height and bottom margin.
  • Insert new toasts at the front of the container and choose the oldest toast to auto-dismiss when over capacity.
  • Add RearrangeToasts to reposition active toasts, set bottom anchoring, and manage Z indices.
  • Animate opacity and blur per toast to visually de-emphasize older messages.
  • Expose hooks for toast removal and toast shown events to trigger re-layout.
Plain Craft Launcher 2/Modules/UI/HintService.cs
Add toast-related debug/testing UI for triggering single and batched notifications from the setup/misc page.
  • Introduce a handler to trigger a single test toast based on user-entered text and selectable hint type.
  • Introduce a handler to trigger a batch of test toasts cycling through multiple hint types.
  • Validate input text and surface warnings via the hint system for empty content.
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml
Extend message box to support hint-type-driven header icon, color, and a copy-to-clipboard action, and add a helper to open such dialogs from toasts.
  • Add an optional HintType to the MyMsgBoxConverter and use it to configure header icon and accent brush in MyMsgText.
  • Map hint types to icon glyphs and HSL-derived accent colors consistent with toast visuals.
  • Wire LabTitle and divider line styling to follow the hint accent brush.
  • Add a copy button handler that copies caption text to the clipboard.
  • Introduce MyMsgBoxByHintType helper that queues a text dialog with a hint type and default title/button text.
Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs
Plain Craft Launcher 2/Modules/ModMain.cs
Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml
Update toast XAML and main form layout to support new visual elements and stacking behavior, and integrate localization strings for toast detail dialogs.
  • Adjust toast control template to include accent bar, progress track, blurable RootGrid background, and icon bindings.
  • Update FormMain toast container configuration to work with bottom-aligned stacked toasts.
  • Add localized strings for toast detail dialog title and confirm button text in language resource files.
Plain Craft Launcher 2/Controls/MyToast.xaml
Plain Craft Launcher 2/FormMain.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml

Possibly linked issues

  • #重新添加 Toast 通知: 此PR完整重构并重新实现 Toast 通知系统,满足“重新添加 Toast 通知”这一需求。
  • #(none provided): PR全面重构 Toast 通知样式与行为,用新叠置式弹窗替换旧左下角通知,实现所提设计。

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • _hideStartsAtTick 标志位目前只会被设置,但当隐藏动画被取消时(例如在 EmphasizeDismiss、拖拽开始或鼠标悬停暂停时)从不会被清除,这可能导致 IsHiding 持续错误地为 true,从而阻塞变暗/悬停行为;建议在所有会停止隐藏动画的路径中将 _hideStartsAtTick 重置为 0。
  • PageSetupLauncherMisc 中的 toast 测试处理逻辑和 UI 虽然标记为仅用于调试,但目前仍被编译进主代码;建议将其包裹在明确的调试标志中,或者在合并前移除,以避免在生产构建中暴露内部测试入口。
提供给 AI Agents 的提示
请根据以下代码审查意见进行修改:

## 总体说明
- `_hideStartsAtTick` 标志位目前只会被设置,但当隐藏动画被取消时(例如在 `Emphasize``Dismiss`、拖拽开始或鼠标悬停暂停时)从不会被清除,这可能导致 `IsHiding` 持续错误地为 true,从而阻塞变暗/悬停行为;建议在所有会停止隐藏动画的路径中将 `_hideStartsAtTick` 重置为 0。
- `PageSetupLauncherMisc` 中的 toast 测试处理逻辑和 UI 虽然标记为仅用于调试,但目前仍被编译进主代码;建议将其包裹在明确的调试标志中,或者在合并前移除,以避免在生产构建中暴露内部测试入口。

Sourcery 对开源项目是免费的 —— 如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • The _hideStartsAtTick flag is only ever set and never cleared when hide animations are cancelled (e.g. in Emphasize, Dismiss, drag start, or hover pause), which can cause IsHiding to incorrectly remain true and block dimming/hover behavior; consider resetting _hideStartsAtTick to 0 in all paths that stop the hide animation.
  • The toast test handlers and UI in PageSetupLauncherMisc are marked as debug-only but currently compiled into the main code; consider wrapping these in a clear debug flag or removing them before merge to avoid exposing internal test entry points in production builds.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `_hideStartsAtTick` flag is only ever set and never cleared when hide animations are cancelled (e.g. in `Emphasize`, `Dismiss`, drag start, or hover pause), which can cause `IsHiding` to incorrectly remain true and block dimming/hover behavior; consider resetting `_hideStartsAtTick` to 0 in all paths that stop the hide animation.
- The toast test handlers and UI in `PageSetupLauncherMisc` are marked as debug-only but currently compiled into the main code; consider wrapping these in a clear debug flag or removing them before merge to avoid exposing internal test entry points in production builds.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c9e58cdd4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +27 to +31
<svgIcon:SvgIcon Grid.Row="0" x:Name="ToastTypeIcon" Width="18" Height="18"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="7,4,0,0"
UseOriginalColor="False" StrokeThickness="0" />
<TextBlock Grid.Row="0" FontSize="23" TextTrimming="None"
HorizontalAlignment="Left" Name="LabTitle" Margin="31,-1,70,9" Text="测试标题文本"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve default styling for ordinary dialogs

When existing MyMsgBox(...) calls create a MyMsgText, HintType stays null, so the constructor never assigns ToastTypeIcon.Icon or LabTitle.Foreground. With this unconditional icon slot and the removed ColorBrush2 foreground, ordinary text dialogs now get an empty 18px title gap and the system text brush instead of the previous themed title/divider; keep the default foreground and collapse or omit the icon unless a hint type is supplied.

Useful? React with 👍 / 👎.

Comment on lines +538 to +541
if (_pauseStartedAtTick > 0 && TimeUtils.GetTimeTick() - _pauseStartedAtTick >= _hoverRemainingMs)
{
StartHideAnimation(0);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resume the paused timeout after hover

If a user keeps the pointer over a toast longer than _hoverRemainingMs, this branch hides it immediately on MouseLeave, even though MouseEnter stopped the hide animation and froze the progress bar at the saved remaining width. That makes hover fail to actually pause long enough for users to read a toast—the toast vanishes as soon as they move away instead of resuming the saved remaining time shown by the bar.

Useful? React with 👍 / 👎.

@Chiloven945

Chiloven945 commented Aug 8, 2026

Copy link
Copy Markdown
Member

既然说的是 toast 为什么要修改 MyMsg?

除此之外你使用了大量的模糊效果,首先这会对性能造成影响,除此之外也并没有很好的去凸显信息,视觉上看起来也没有很好地优化。并且不是很理解为什么堆叠的 MyToast 要加模糊效果。

@Chiloven945 Chiloven945 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请严格遵守 技术规范 重新修整你的 PR:

  1. PR 中的所有 Commit 必须要附带有效的、已验证的签名。参考 提交信息规范-提交签名要求 章节与 GPG 签名配置指南
  2. 如果使用了任意 AI 工具,应该在 PR 提交信息或者 Commit 信息内注明使用的模型、工具信息等。参考 项目开发规范-AI 工具使用规范 章节。

@sysfox

sysfox commented Aug 8, 2026

Copy link
Copy Markdown
Author

既然说的是 toast 为什么要修改 MyMsg?

除此之外你使用了大量的模糊效果,首先这会对性能造成影响,除此之外也并没有很好的去凸显信息,视觉上看起来也没有很好地优化。并且不是很理解为什么堆叠的 MyToast 要加模糊效果。

@Chiloven945

  1. 修改Msg是为了添加复制按钮以及确保msg标题的颜色与弹窗类型一致,否则用户点入错误信息后无法复制约等于没用(但这一点没在pr title里体现,是我的问题)
  2. 使用毛玻璃是为了进一步强化新信息与旧消息之间的分界,为了实现重叠效果,用户可能无法分清旧消息和新消息之间的分界线(尤其是在旧消息为两行,而新消息仅一行的情况下会出现视觉上的误解)

关于凸显信息和性能优化上我会再进行进一步处理

@qiMengStars

Copy link
Copy Markdown
Member

使用毛玻璃是为了进一步强化新信息与旧消息之间的分界,为了实现重叠效果,用户可能无法分清旧消息和新消息之间的分界线(尤其是在旧消息为两行,而新消息仅一行的情况下会出现视觉上的误解)

我认为通过遮挡关系和透明度调整,已经能够明确主次地位,多层窗口+毛玻璃看着像散光()
有待进一步考虑

@sysfox

sysfox commented Aug 8, 2026

Copy link
Copy Markdown
Author

使用毛玻璃是为了进一步强化新信息与旧消息之间的分界,为了实现重叠效果,用户可能无法分清旧消息和新消息之间的分界线(尤其是在旧消息为两行,而新消息仅一行的情况下会出现视觉上的误解)

我认为通过遮挡关系和透明度调整,已经能够明确主次地位,多层窗口+毛玻璃看着像散光() 有待进一步考虑

Emmmm,我修改下
但我测试的时候就是出现了旧消息为两行,而新消息仅一行的情况下会出现视觉上的误解的情况才有特地加了这个,我一会儿看看有没有别的视觉方案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L PR 大小评估:大型 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants