Some checks failed
Security Scan / security (push) Failing after 28s
Notification: RevokePermission, RegisterCategory, action broadcasts Dock: SetProgressBar, Bounce/StopBounce, ActionProgressChanged Webview: QueryZoom, TaskSetZoom, TaskSetURL, TaskPrint (with PDF export) MCP: 4 new event tools (emit, on, off, list) Environment: HasFocusFollowsMouse query ContextMenu: Update, Destroy, GetAll, OnShutdown cleanup Core upgraded to v0.8.0-alpha.1 (added alongside existing v0.3.3 — full module path migration pending). All 17 packages build and test clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
// pkg/dock/platform.go
|
|
package dock
|
|
|
|
// BounceType controls how the dock icon attracts attention.
|
|
// bounce := dock.BounceInformational — single bounce
|
|
// bounce := dock.BounceCritical — continuous bounce until focused
|
|
type BounceType int
|
|
|
|
const (
|
|
// BounceInformational performs a single bounce to indicate a background event.
|
|
BounceInformational BounceType = iota
|
|
// BounceCritical bounces continuously until the application becomes active.
|
|
BounceCritical
|
|
)
|
|
|
|
// Platform abstracts the dock/taskbar backend (Wails v3).
|
|
// macOS: dock icon show/hide, badge, progress bar, bounce.
|
|
// Windows: taskbar badge + progress bar (show/hide and bounce not supported).
|
|
// Linux: not supported — adapter returns nil for all operations.
|
|
type Platform interface {
|
|
ShowIcon() error
|
|
HideIcon() error
|
|
SetBadge(label string) error
|
|
RemoveBadge() error
|
|
IsVisible() bool
|
|
// SetProgressBar sets a progress indicator on the dock/taskbar icon.
|
|
// progress is clamped to [0.0, 1.0]. Pass -1.0 to hide the indicator.
|
|
SetProgressBar(progress float64) error
|
|
// Bounce requests user attention by animating the dock icon.
|
|
// Returns a request ID that can be passed to StopBounce.
|
|
Bounce(bounceType BounceType) (int, error)
|
|
// StopBounce cancels a pending attention request by its ID.
|
|
StopBounce(requestID int) error
|
|
}
|