From 7b6c51ce61b016e3079667b57135e3787fe9a213 Mon Sep 17 00:00:00 2001 From: Brage Fuglseth Date: Sun, 24 Dec 2023 14:35:24 +0100 Subject: [PATCH] entry: Fix cursor flashing --- src/chord_name_entry.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/chord_name_entry.rs b/src/chord_name_entry.rs index 92ba8e2..af101bf 100644 --- a/src/chord_name_entry.rs +++ b/src/chord_name_entry.rs @@ -85,10 +85,8 @@ mod imp { self.entry.connect_activate( glib::clone!(@weak revealer, @weak self as entry_wrapper => move |_| { - revealer.set_visible(false); - revealer.set_reveal_child(false); - let prettified_name = prettify_chord_name(&entry_wrapper.entry.text()); + entry_wrapper.programatically_changed.set(true); entry_wrapper.obj().overwrite_text(&prettified_name); entry_wrapper.entry.set_position(-1); }), @@ -144,8 +142,8 @@ impl FretboardChordNameEntry { let imp = self.imp(); let text = prettify_chord_name(&text); imp.entry_buffer.replace(text.clone()); - imp.entry.set_text(&text); self.calculate_enharmonic_equivalent(&text); + imp.entry.set_text(&text); } pub fn calculate_enharmonic_equivalent(&self, chord_name: &str) {