2024-10-16 11:40:45 +02:00
|
|
|
import { Palette } from "Palette.slint";
|
|
|
|
import { VText } from "Text.slint";
|
|
|
|
|
|
|
|
export component VTag inherits Rectangle {
|
|
|
|
|
|
|
|
in property text <=> text-component.text;
|
2025-06-26 10:11:53 +02:00
|
|
|
in property<color> text-color;
|
2024-10-16 11:40:45 +02:00
|
|
|
in property size <=> text-component.font-size;
|
|
|
|
in property background-color <=> self.background;
|
|
|
|
|
|
|
|
callback clicked;
|
|
|
|
|
2025-06-26 10:11:53 +02:00
|
|
|
background: Palette.card-background;
|
|
|
|
border-radius: 8phx;
|
|
|
|
clip: true;
|
|
|
|
border-color: text-color;
|
|
|
|
border-width: 1phx;
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background: root.text-color;
|
|
|
|
opacity: 0.05;
|
|
|
|
}
|
2024-10-16 11:40:45 +02:00
|
|
|
|
|
|
|
ta := TouchArea {
|
|
|
|
mouse-cursor: pointer;
|
|
|
|
clicked => {
|
|
|
|
root.clicked();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VerticalLayout {
|
|
|
|
padding-left: 8px;
|
|
|
|
padding-right: 8px;
|
|
|
|
alignment: center;
|
|
|
|
text-component := VText {
|
|
|
|
horizontal-alignment: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|