commit 9c52d53929fd1a8d8ea54a4777022af9a8221753
parent d6faf9262fe99079bb0686c5f111fec31e89c335
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Wed, 15 Mar 2023 14:54:36 +0800
toast: add fields and adjust docs
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/toast.go b/toast.go
@@ -58,10 +58,14 @@ type Notification struct {
// An optional path to an image on the OS to display to the left of the title & message.
Icon string
- // The type of notification level action (like toast.Action)
+ // A color to show as the icon background.
+ IconBackgroundColor string
+
+ // Action to take when the notification is as a whole activated.
ActivationType ActivationType
- // The activation/action arguments (invoked when the user clicks the notification)
+ // The activation/action arguments (invoked when the user clicks the notification).
+ // This is returned to the callback when activated.
ActivationArguments string
// Optional text input to display before the actions.
@@ -73,10 +77,10 @@ type Notification struct {
// The audio to play when displaying the toast
Audio toastAudio
- // Whether to loop the audio (default false)
+ // Whether to loop the audio (default false).
Loop bool
- // How long the toast should show up for (short/long)
+ // How long the toast should show up for (short/long).
Duration toastDuration
// This is an absolute path to an executable that will launched by the
@@ -139,6 +143,9 @@ func (n *Notification) applyDefaults() {
if n.Audio == "" {
n.Audio = Default
}
+ if n.IconBackgroundColor == "" {
+ n.IconBackgroundColor = "FFFFFFFF"
+ }
}
func (n *Notification) buildXML() (string, error) {