- Remove placeholder colors from right-side widgets - Set actual colors to give a glassy look
36 lines
1002 B
Plaintext
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();
|
|
}
|
|
}
|
|
}
|
|
}
|