slint/component-sets/material/ui/components/tooltip.slint
2025-06-03 06:59:57 +02:00

33 lines
922 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { MaterialText } from "./material_text.slint";
import { MaterialPalette } from "../styling/material_palette.slint";
import { Typography } from "../styling/typography.slint";
export component ToolTip {
in property <string> text;
z: 10000;
background_layer := Rectangle {
border_radius: 4px;
background: MaterialPalette.inverse_surface;
layout := HorizontalLayout {
max_width: 200px;
padding_top: 4px;
padding_bottom: 4px;
padding_left: 8px;
padding_right: 8px;
MaterialText {
text: root.text;
vertical_alignment: center;
color: MaterialPalette.inverse_on_surface;
style: Typography.body_small;
wrap: word-wrap;
}
}
}
}