- Working date widget - Update at midnight or on date change - `src/widgets/datewidget.rs` module
29 lines
763 B
Plaintext
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();
|
|
}
|
|
}
|
|
}
|
|
}
|