Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a69960f
feat(debug-toast): 添加测试弹窗功能及相关本地化字符串
sysfox Aug 7, 2026
96e6798
feat(toast): 限制弹窗宽高,点击展示完整内容
sysfox Aug 7, 2026
b715dd0
feat(toast): 新弹窗叠置于旧弹窗上方
sysfox Aug 7, 2026
699c30d
feat(setup): 调试选项支持连续触发多条弹窗
sysfox Aug 7, 2026
783588a
fix(toast): 内容限 3 行省略,收窄最大宽度
sysfox Aug 7, 2026
e2fdd64
feat(toast): 弹窗按 Z 轴叠置,露出上沿可数数量
sysfox Aug 7, 2026
d25a1bf
feat(toast): 入场回弹落位与图标按压,叠置栈补位改为整体层动
sysfox Aug 7, 2026
0fd1193
feat(toast): 工具箱质感——楔形色标、下沉进度轨道、信息类型降噪
sysfox Aug 7, 2026
0a0fa31
fix(toast): 修复短文本弹窗初始过宽并逐步收窄的宽度回归
sysfox Aug 7, 2026
c7b021e
feat(toast): 文本上限提至 6 行,悬停暂停加载条,加强回弹动效
sysfox Aug 7, 2026
34031c9
feat(toast): 信息类弹窗用主题色,详情弹窗图标与类型联动
sysfox Aug 7, 2026
c4ebabc
fix(toast): 消失提速,隐藏过程中悬停不再卡半透明
sysfox Aug 8, 2026
59f22f9
feat(toast): 详情弹窗标题与图标同色,新增复制按钮
sysfox Aug 8, 2026
6e7204f
feat(toast): 叠置时旧弹窗淡化处理,最新全亮
sysfox Aug 8, 2026
2a6c8c7
feat(toast): 详情弹窗复制按钮移至底部左侧,文本限高改 2 行,放大关闭按钮
sysfox Aug 8, 2026
3118088
feat(toast): 渐隐旧弹窗加毛玻璃模糊,越旧越模糊越淡
sysfox Aug 8, 2026
3529af8
feat(toast): 详情弹窗复制按钮移回右侧按钮组
sysfox Aug 8, 2026
3594d85
fix(toast): 隐藏倒计时标志在取消路径下复位,避免 IsHiding 误判阻塞淡化/悬停
sysfox Aug 8, 2026
c1bd81c
refactor(toast): 移除模糊效果,简化淡化动画逻辑
sysfox Aug 9, 2026
b6686fc
feat(toast): 优化弹窗透明度管理,确保旧弹窗逐级淡化,提升视觉层次感
sysfox Aug 9, 2026
d2b244e
refactor(toast): 调整弹窗布局逻辑,优化弹窗间距和可见性管理
sysfox Aug 9, 2026
2ab35e1
revert(toast): 撤销 MyMsg 改动,已迁移至 feat/toast-detail-upstream
sysfox Aug 9, 2026
67174cf
feat(toast): 添加调试日志以跟踪弹窗显示和移除事件
sysfox Aug 11, 2026
2bef282
refactor(toast): 移除调试弹窗相关代码,简化界面和逻辑
sysfox Aug 12, 2026
91da4ac
Merge branch 'dev' into dev
sysfox Sep 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PCL.Core/App/Localization/Languages/en-US.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<sys:String x:Key="Common.Action.Cancel">Cancel</sys:String>
<sys:String x:Key="Common.Action.Close">Close</sys:String>
<sys:String x:Key="Common.Action.Confirm">OK</sys:String>
<sys:String x:Key="Main.Toast.Detail.Title">Toast details</sys:String>
<sys:String x:Key="Main.Toast.Detail.ToolTip">Click to view full content</sys:String>
<sys:String x:Key="Common.Action.Continue">Continue</sys:String>
<sys:String x:Key="Common.Action.Copy">Copy</sys:String>
<sys:String x:Key="Common.Action.Decline">Decline</sys:String>
Expand Down Expand Up @@ -2898,6 +2900,14 @@
<sys:String x:Key="Setup.Misc.Debug.SkipCopy">Do not copy files from other folders while downloading</sys:String>
<sys:String x:Key="Setup.Misc.Debug.SkipCopy.ToolTip">When downloading, do not copy identical files that already exist in other Minecraft folders; re-download them instead.&#xA;Only recommended for testing download speed.</sys:String>
<sys:String x:Key="Setup.Misc.Debug.Title">Debug options</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type">Toast type</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Info">Info</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Success">Success</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Error">Error</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Warning">Warning</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Content">Toast content</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Show">Show test toast</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.ShowBatch">Show a burst of toasts</sys:String>

<!-- Setup.Misc.Network -->

Expand Down
10 changes: 10 additions & 0 deletions PCL.Core/App/Localization/Languages/zh-CN.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<sys:String x:Key="Common.Action.Cancel">取消</sys:String>
<sys:String x:Key="Common.Action.Close">关闭</sys:String>
<sys:String x:Key="Common.Action.Confirm">确定</sys:String>
<sys:String x:Key="Main.Toast.Detail.Title">提示详情</sys:String>
<sys:String x:Key="Main.Toast.Detail.ToolTip">点击查看完整内容</sys:String>
<sys:String x:Key="Common.Action.Continue">继续</sys:String>
<sys:String x:Key="Common.Action.Copy">复制</sys:String>
<sys:String x:Key="Common.Action.Decline">拒绝</sys:String>
Expand Down Expand Up @@ -2898,6 +2900,14 @@
<sys:String x:Key="Setup.Misc.Debug.SkipCopy">禁止在下载时从其他文件夹复制文件</sys:String>
<sys:String x:Key="Setup.Misc.Debug.SkipCopy.ToolTip">在下载时不直接复制其他 MC 文件夹中已经存在的相同文件,而是重新下载文件。&#xA;只建议在测试下载速度时开启。</sys:String>
<sys:String x:Key="Setup.Misc.Debug.Title">调试选项</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type">弹窗类型</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Info">信息</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Success">成功</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Error">错误</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Type.Warning">警告</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Content">弹窗内容</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.Show">弹出测试弹窗</sys:String>
<sys:String x:Key="Setup.Misc.Debug.TestToast.ShowBatch">连续触发多条</sys:String>

<!-- Setup.Misc.Network -->

Expand Down
11 changes: 9 additions & 2 deletions Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Grid x:Class="PCL.MyMsgText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:svgIcon="clr-namespace:PCL.Core.UI.Controls.SvgIcon;assembly=PCL.Core"
xmlns:my="clr-namespace:PCL"
RenderTransformOrigin="0,0.5" UseLayoutRounding="True" SnapsToDevicePixels="True" MinWidth="400"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="25">
Expand All @@ -23,8 +24,11 @@
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" FontSize="23" TextTrimming="None" Foreground="{DynamicResource ColorBrush2}"
HorizontalAlignment="Left" Name="LabTitle" Margin="7,-1,70,9" Text="测试标题文本"
<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 👍 / 👎.

VerticalAlignment="Top" SnapsToDevicePixels="False" UseLayoutRounding="False" />
<Rectangle x:Name="ShapeLine" Grid.Row="1" Height="2" Fill="{Binding Foreground, ElementName=LabTitle}" />
<my:MyScrollViewer Grid.Row="3" VerticalAlignment="Top" x:Name="PanCaption" Margin="0,0,0,17"
Expand All @@ -37,6 +41,9 @@
</my:MyScrollViewer>
<StackPanel Grid.Row="4" Name="PanBtn" VerticalAlignment="Top" HorizontalAlignment="Right"
Margin="150,0,8,0" Orientation="Horizontal">
<my:MyButton ColorType="Normal" Text="{DynamicResource Common.Action.Copy}" Click="BtnCopy_Click"
x:Name="BtnCopy" Margin="12,0,0,0"
TextPadding="7" SnapsToDevicePixels="False" Padding="5,0" UseLayoutRounding="False" />
<my:MyButton ColorType="Normal" x:FieldModifier="public" Text="测试按钮1" Click="Btn1_Click" x:Name="Btn1"
Margin="12,0,0,0"
TextPadding="7" SnapsToDevicePixels="False" Padding="5,0" UseLayoutRounding="False" />
Expand Down
31 changes: 30 additions & 1 deletion Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using PCL.Core.UI.Controls;

using PCL.Core.App.Localization;
Expand All @@ -23,10 +24,31 @@ public MyMsgText(ModMain.MyMsgBoxConverter converter)
myConverter = converter;
LabTitle.Text = converter.Title;
LabCaption.Text = converter.Text;
ConfigurePrimaryButton(converter.Button1, converter.IsWarn);
ConfigurePrimaryButton(converter.Button1, converter.IsWarn || converter.HintType == HintType.Error);
ConfigureSecondaryButton(Btn2, converter.Button2);
ConfigureSecondaryButton(Btn3, converter.Button3);
ShapeLine.StrokeThickness = ModBase.GetWPFSize(1d);
// 按提示类型设置标题图标与颜色(与 MyToast 的图标映射一致);仅 toast 联动弹窗(指定了 HintType)让标题跟随类型色
if (converter.HintType is { } hintType)
{
ToastTypeIcon.Icon = hintType switch
{
HintType.Success => "lucide/circle-check",
HintType.Error => "lucide/circle-minus",
HintType.Warning => "lucide/triangle-alert",
_ => "lucide/info"
};
var hintBrush = hintType switch
{
HintType.Success => new SolidColorBrush(new ModBase.MyColor().FromHSL2(145d, 75d, 60d)),
HintType.Error => new SolidColorBrush(new ModBase.MyColor().FromHSL2(355d, 75d, 60d)),
HintType.Warning => new SolidColorBrush(new ModBase.MyColor().FromHSL2(40d, 75d, 60d)),
_ => (Brush)System.Windows.Application.Current.Resources["ColorBrush2"]
};
ToastTypeIcon.IconBrush = hintBrush;
// 标题与分割线颜色跟随图标(类型色),与 MyToast 的类型映射一致;ShapeLine 的 binding 自动跟随
LabTitle.Foreground = hintBrush;
}
}

catch (Exception ex)
Expand Down Expand Up @@ -176,6 +198,13 @@ public void Btn3_Click(object sender, MouseButtonEventArgs e)
}
}

public void BtnCopy_Click(object? sender = null, MouseButtonEventArgs? e = null)
{
if (myConverter.IsExited)
return;
ModBase.ClipboardSet(myConverter.Text);
}

private void Drag(object sender, MouseButtonEventArgs e)
{
try
Expand Down
23 changes: 14 additions & 9 deletions Plain Craft Launcher 2/Controls/MyToast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CornerRadius="8" BorderThickness="0"
UseLayoutRounding="True" SnapsToDevicePixels="True">
<Border.Effect>
<DropShadowEffect BlurRadius="16" Opacity="0.2" ShadowDepth="4" Direction="270" Color="#000000" />
<DropShadowEffect BlurRadius="12" Opacity="0.16" ShadowDepth="2" Direction="270" Color="#000000" />
</Border.Effect>
<Grid x:Name="RootGrid" SizeChanged="RootGrid_SizeChanged">
<Grid.RowDefinitions>
Expand All @@ -28,18 +28,23 @@

<TextBlock x:Name="TitleText" Grid.Column="1" VerticalAlignment="Center"
FontSize="13" FontWeight="Bold"
TextWrapping="Wrap" LineHeight="16" MaxHeight="32"
TextTrimming="CharacterEllipsis" />

<local:MyIconButton Grid.Column="2" x:Name="BtnClose" Width="20" Height="20"
<local:MyIconButton Grid.Column="2" x:Name="BtnClose" Width="26" Height="26"
Margin="8,0,0,0" SvgIcon="lucide/x" Theme="Custom" />
</Grid>

<Rectangle x:Name="ProgressBar" Height="3" Grid.Row="1"
HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
RenderTransformOrigin="0,0.5">
<Rectangle.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Rectangle.RenderTransform>
</Rectangle>
<!-- 下沉轨道 + 时间线填充:一条彩色时间线骑在暗槽上 -->
<Grid Grid.Row="1">
<Rectangle x:Name="ProgressTrack" Height="3" VerticalAlignment="Bottom" />
<Rectangle x:Name="ProgressBar" Height="3" VerticalAlignment="Bottom"
HorizontalAlignment="Stretch"
RenderTransformOrigin="0,0.5">
<Rectangle.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Rectangle.RenderTransform>
</Rectangle>
</Grid>
</Grid>
</Border>
Loading