MCPcopy Create free account
hub / github.com/encounter/objdiff / rlwinm_decode_window

Function rlwinm_decode_window

objdiff-gui/src/views/rlwinm.rs:10–34  ·  view source on GitHub ↗
(
    ctx: &egui::Context,
    show: &mut bool,
    state: &mut RlwinmDecodeViewState,
    appearance: &Appearance,
)

Source from the content-addressed store, hash-verified

8}
9
10pub fn rlwinm_decode_window(
11 ctx: &egui::Context,
12 show: &mut bool,
13 state: &mut RlwinmDecodeViewState,
14 appearance: &Appearance,
15) {
16 egui::Window::new("Rlwinm Decoder").open(show).show(ctx, |ui| {
17 ui.text_edit_singleline(&mut state.text);
18 ui.add_space(10.0);
19 if let Some(decoded) = rlwinmdec::decode(&state.text) {
20 ui.scope(|ui| {
21 ui.style_mut().override_text_style = Some(TextStyle::Monospace);
22 ui.colored_label(appearance.replace_color, decoded.trim());
23 });
24 if ui.button("Copy").clicked() {
25 ctx.copy_text(decoded);
26 }
27 } else {
28 ui.scope(|ui| {
29 ui.style_mut().override_text_style = Some(TextStyle::Monospace);
30 ui.colored_label(appearance.replace_color, "[invalid]");
31 });
32 }
33 });
34}

Callers 1

updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected