mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-30 03:27:22 +00:00
33 lines
922 B
Text
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;
|
|
}
|
|
}
|
|
}
|
|
}
|