export component TimeWidget { in-out property 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(); } } } }