feat: 定位模型重做、聚焦短显、托盘交互与 host spawn 修复
- 定位改为 水平(左/中/右) × 垂直(上/中/下) + 边缘留白,取代四角枚举 - 完成类通知在目标窗口已聚焦时用更短停留(FocusedDurationSeconds) - 托盘左键单击直接打开设置,右键菜单仅保留退出 - 修复 host 拉起用 UseShellExecute=true,脱离钩子 stdout 管道,避免 Claude 卡在 running stop hook
This commit is contained in:
@@ -33,4 +33,9 @@ public sealed class ToastRequest
|
||||
/// 调用方 App 的 exe 路径,用于显示其图标
|
||||
/// </summary>
|
||||
public string? IconPath { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 覆盖停留秒数;为 null 时用设置里的默认值
|
||||
/// </summary>
|
||||
public int? DurationSecondsOverride { get; init; }
|
||||
}
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
namespace Notify.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 屏幕角落,决定 toast 堆叠的起点与方向
|
||||
/// 水平方向:决定 toast 贴左/居中/贴右
|
||||
/// </summary>
|
||||
public enum ToastCorner
|
||||
public enum HEdge
|
||||
{
|
||||
TopLeft,
|
||||
TopRight,
|
||||
BottomLeft,
|
||||
BottomRight,
|
||||
Left,
|
||||
Center,
|
||||
Right,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 垂直方向:决定 toast 贴上/居中/贴下,并决定堆叠方向
|
||||
/// </summary>
|
||||
public enum VEdge
|
||||
{
|
||||
Top,
|
||||
Center,
|
||||
Bottom,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22,9 +31,24 @@ public sealed class ToastSettings
|
||||
public int DurationSeconds { get; set; } = 4;
|
||||
|
||||
/// <summary>
|
||||
/// 出现的屏幕角落
|
||||
/// 目标窗口已在前台时的停留秒数(你正盯着看,弹一下即可)
|
||||
/// </summary>
|
||||
public ToastCorner Corner { get; set; } = ToastCorner.BottomRight;
|
||||
public int FocusedDurationSeconds { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 水平方向
|
||||
/// </summary>
|
||||
public HEdge Horizontal { get; set; } = HEdge.Right;
|
||||
|
||||
/// <summary>
|
||||
/// 垂直方向
|
||||
/// </summary>
|
||||
public VEdge Vertical { get; set; } = VEdge.Bottom;
|
||||
|
||||
/// <summary>
|
||||
/// 与屏幕边缘的留白(DIP)
|
||||
/// </summary>
|
||||
public int Margin { get; set; } = 12;
|
||||
|
||||
/// <summary>
|
||||
/// 不透明度 0–1
|
||||
|
||||
Reference in New Issue
Block a user