chocobar-x11/ui/time-widget.slint
Candifloss 47efaa2d08 Dummy widget: Time widget
- Time widget module
- Configure layout and callback
- Dummy: Not real time yet
2025-11-19 16:16:38 +05:30

29 lines
752 B
Plaintext

export component TimeWidget {
in-out property <string> time_text;
callback open_program(); // Callback to execute things from Rust, because Slint can't
Rectangle {
background: touch_area.pressed ? #555 : touch_area.has-hover ? #444 : #333; // Bg color based on click & hover
border-radius: 3px;
HorizontalLayout {
padding-right: 3px;
padding-left: 3px;
Text {
text: time_text;
color: white;
vertical-alignment: center;
}
}
// Area to sense click and hover
touch_area:= TouchArea {
clicked => {
open_program();
}
}
}
}