chocobar-x11/ui/date-widget.slint
Candifloss 48a116c547 Add DateWidget
- Working date widget
- Update at midnight or on date change
- `src/widgets/datewidget.rs` module
2025-11-20 19:41:19 +05:30

29 lines
763 B
Plaintext

export component DateWidget {
in-out property <string> date_text;
callback show_calendar(); // Callback to execute things from Rust, because Slint can't
Rectangle {
background: touch_area.pressed ? #704a4a : touch_area.has-hover ? #4d8a7a : #6f6291; // 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();
}
}
}
}