chocobar-x11/ui/date-widget.slint
Candifloss 6ac513f301 Basic color styles
- Remove placeholder colors from right-side widgets
- Set actual colors to give a glassy look
2025-11-23 22:01:25 +05:30

36 lines
1002 B
Plaintext

export component DateWidget {
in-out property <string> date_text;
// Colors
in property <color> icon_color: #ffffff;
in property <color> bg_normal: #00000000;
in property <color> bg_hover: #ffffff10;
in property <color> bg_clicked: #ffffff30;
callback show_calendar(); // Callback to execute things from Rust, because Slint can't
Rectangle {
background: touch_area.pressed ? bg_clicked
: touch_area.has-hover ? bg_hover
: bg_normal; // Bg color based on click & hover
border-radius: 3px;
HorizontalLayout {
padding-right: 3px;
padding-left: 3px;
Text {
text: date_text;
color: white;
vertical-alignment: center;
}
}
// Area to sense click and hover
touch_area:= TouchArea {
clicked => {
show_calendar();
}
}
}
}