//! Native clipboard smoke test: `cargo run --example clipboard_probe`. //! Focus starts in the ordinary field. Paste a non-sensitive test string with //! Ctrl+V; Tab moves through password and multiline inputs. //! Set VNOX_CLIPBOARD_EXPECT to report equality without logging clipboard data. slint::slint! { import { LineEdit, TextEdit, VerticalBox } from "std-widgets.slint"; export component ClipboardProbe inherits Window { title: "VNOX Clipboard Probe"; width: 440px; height: 260px; callback changed(string, string); init => { ordinary.focus(); } VerticalBox { ordinary := LineEdit { placeholder-text: "Ordinary input"; edited(value) => { root.changed("ordinary", value); } } LineEdit { placeholder-text: "Password input"; input-type: password; edited(value) => { root.changed("password", value); } } TextEdit { edited => { root.changed("multiline", self.text); } } } } } fn main() -> Result<(), slint::PlatformError> { let window = ClipboardProbe::new()?; let expected = std::env::var("VNOX_CLIPBOARD_EXPECT").ok(); window.on_changed(move |field, text| { let matches = expected .as_deref() .map(|expected| expected == text.as_str()); println!( "field={field} chars={} matches_expected={matches:?}", text.chars().count() ); }); window.run() }