Menus, dialogs and toasts draw on an own full-window layer so they can play exit motion; gallery pages show them open for screenshots. Co-Authored-By: Claude Opus 5.5 <[email protected]>
35 lines
976 B
Text
35 lines
976 B
Text
import { Theme } from "../theme.slint";
|
|
import { Motion } from "../motion.slint";
|
|
|
|
// The small label an icon-only control shows after hovering for `Motion.tooltip-delay`
|
|
// (StateLayer's `tooltip`). It fades in; it leaves at once with its popup.
|
|
export component Tooltip inherits Rectangle {
|
|
in property <string> text;
|
|
|
|
property <bool> shown;
|
|
init => {
|
|
self.shown = true;
|
|
}
|
|
|
|
background: Theme.inverse-surface;
|
|
border-radius: Theme.corner-xs;
|
|
height: 24px;
|
|
opacity: root.shown ? 1 : 0;
|
|
animate opacity {
|
|
duration: Motion.time(Motion.short3);
|
|
easing: Motion.standard;
|
|
}
|
|
|
|
HorizontalLayout {
|
|
padding-left: Theme.space-2;
|
|
padding-right: Theme.space-2;
|
|
|
|
Text {
|
|
text: root.text;
|
|
color: Theme.inverse-on-surface;
|
|
font-size: Theme.body-small.size;
|
|
font-weight: Theme.body-small.weight;
|
|
vertical-alignment: center;
|
|
}
|
|
}
|
|
}
|