commit 51d49c7d0c6f71e636f444b815f0832b75130c3f
parent 168cfffb5c062da0b9ae30c935a8d4abe959abf8
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Mon, 7 Oct 2024 15:33:52 +1000
toast: support extra styling features
These correspond to the fields added in the template.
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/toast.go b/toast.go
@@ -70,6 +70,12 @@ type Notification struct {
// An optional path to an image on the OS to display to the left of the title & message.
Icon string
+ // An optional crop style for the Icon.
+ IconCrop CropStyle
+
+ // An optional path to an image to display as a bold hero image.
+ HeroIcon string
+
// A color to show as the icon background.
IconBackgroundColor string
@@ -101,6 +107,15 @@ type Notification struct {
ActivationExe string
}
+// CropStyle specifies the hint-crop attribute for an image.
+type CropStyle = string
+
+const (
+ CropStyleEmpty CropStyle = ""
+ CropStyleSquare CropStyle = "square"
+ CropStyleCircle CropStyle = "circle"
+)
+
// UserData contains user supplied data from the notification, such as text input
// or a selection.
type UserData = wintoast.UserData
@@ -140,6 +155,7 @@ type Action struct {
Type ActivationType
Content string
Arguments string
+ InputID string // optional ID of any related input, affects styling.
}
// Push the notification to the Windows Runtime via the COM API.