// On-screen confirmation shown when a shortcut fires. Created as a non-activating, // click-through, always-on-top window (see src/ui/toast.rs) so it never steals focus // from a game or fullscreen app. import { Theme } from "theme.slint"; import { SpeakerIcon } from "widgets.slint"; export component Toast inherits Window { title: "HushKey notification"; no-frame: true; always-on-top: true; background: transparent; width: 300px; height: 76px; in property dark: true; in property headline; in property detail; in property muted; in property error; in-out property shown; init => { Theme.dark = root.dark; } changed dark => { Theme.dark = root.dark; } panel := Rectangle { x: 10px; y: root.shown ? 8px : 14px; width: parent.width - 20px; height: parent.height - 20px; border-radius: 16px; background: Theme.dark ? #1a1d25f5 : #fffffff7; border-width: 1px; border-color: Theme.border; drop-shadow-blur: 10px; drop-shadow-color: #00000059; drop-shadow-offset-y: 3px; opacity: root.shown ? 1 : 0; animate opacity { duration: 170ms; easing: ease-out; } animate y { duration: 220ms; easing: ease-out; } HorizontalLayout { padding-left: 12px; padding-right: 16px; spacing: 12px; alignment: start; Rectangle { width: 36px; height: 36px; y: (parent.height - self.height) / 2; border-radius: 18px; background: root.error ? Theme.surface-sunken : (root.muted ? Theme.danger-soft : #34c98a2e); SpeakerIcon { muted: root.muted || root.error; color: root.error ? Theme.text-muted : (root.muted ? Theme.danger : Theme.success); } } VerticalLayout { alignment: center; spacing: 1px; Text { text: root.headline; font-size: 14px; font-weight: 650; color: Theme.text; overflow: elide; } Text { text: root.detail; font-size: 12px; color: Theme.text-muted; overflow: elide; } } } } }