import { LineEdit , HorizontalBox, Button , VerticalBox, ComboBox} from "std-widgets.slint"; export component MainWindow inherits Window { title: "Baze64 - Encode & Decode base64"; min-width: 350px; min-height: 200px; callback encode_plaintext <=> plaintext.accepted; callback decode_base64 <=> base64.accepted; public function set_plaintext(text: string) { plaintext.text = text; } public function set_base64(text: string) { base64.text = text; } public function get_current_alphabet() -> int { return alphabet.current-index; } VerticalBox { HorizontalBox { VerticalBox { plaintext := LineEdit { accessible-role: AccessibleRole.text; accessible-label: "Plaintext input"; placeholder-text: "Plaintext"; } Button { accessible-role: button; accessible-label: "Copy plaintext"; text: "Copy"; clicked => { plaintext.select-all(); plaintext.copy(); } } } VerticalBox { base64 := LineEdit { accessible-role: button; accessible-label: "Base64 input"; placeholder-text: "Base64"; } Button { accessible-role: button; accessible-label: "Copy base64 text"; text: "Copy"; clicked => { base64.select-all(); base64.copy(); } } } } HorizontalBox { Text { text: "Base64 alphabet:"; vertical-alignment: center; } alphabet := ComboBox { accessible-role: combobox; accessible-label: "Base64 alphabet"; model: ["Standard", "URL safe"]; current-index: 0; } } Button { accessible-role: button; accessible-label: "Clear all text fields"; text: "Clear all"; clicked => { plaintext.text = ""; base64.text = ""; } } } }