p2pool: fix input

This commit is contained in:
hinto.janai 2023-12-26 12:00:29 -05:00
parent 4c1e317042
commit 1c831712af
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -64,7 +64,7 @@ impl crate::disk::P2pool {
ui.separator(); ui.separator();
let response = ui.add_sized([width, text_edit], TextEdit::hint_text(TextEdit::singleline(buffer), r#"Type a command (e.g "help" or "status") and press Enter"#)).on_hover_text(P2POOL_INPUT); let response = ui.add_sized([width, text_edit], TextEdit::hint_text(TextEdit::singleline(buffer), r#"Type a command (e.g "help" or "status") and press Enter"#)).on_hover_text(P2POOL_INPUT);
// If the user pressed enter, dump buffer contents into the process STDIN // If the user pressed enter, dump buffer contents into the process STDIN
if response.lost_focus() && ui.input().key_pressed(egui::Key::Enter) { if response.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)) {
response.request_focus(); // Get focus back response.request_focus(); // Get focus back
let buffer = std::mem::take(buffer); // Take buffer let buffer = std::mem::take(buffer); // Take buffer
let mut process = lock!(process); // Lock let mut process = lock!(process); // Lock