diff --git a/src/gui/views/content.rs b/src/gui/views/content.rs index 6135b8d5..cfaa346c 100644 --- a/src/gui/views/content.rs +++ b/src/gui/views/content.rs @@ -31,9 +31,6 @@ use crate::{AppConfig, Settings}; lazy_static! { /// Global state to check if [`NetworkContent`] panel is open. static ref NETWORK_PANEL_OPEN: AtomicBool = AtomicBool::new(false); - - /// Global state to check if [`NetworkContent`] panel is open. - static ref SETTINGS_PANEL_OPEN: AtomicBool = AtomicBool::new(false); } /// Contains main ui content, handles side panel state. diff --git a/src/gui/views/input/edit.rs b/src/gui/views/input/edit.rs index 937398a6..c95a8ecf 100644 --- a/src/gui/views/input/edit.rs +++ b/src/gui/views/input/edit.rs @@ -23,27 +23,29 @@ use crate::gui::views::{KeyboardEvent, View}; /// Text input content. pub struct TextEdit { /// View identifier. - pub id: egui::Id, + id: egui::Id, /// Check if horizontal centering is needed. - pub h_center: bool, + h_center: bool, /// Check if focus is needed. - pub focus: bool, + focus: bool, /// Check if focus request was passed. focus_request: bool, /// Hide letters and draw button to show/hide letters. - pub password: bool, + password: bool, /// Show copy button. - pub copy: bool, + copy: bool, /// Show paste button. - pub paste: bool, + paste: bool, /// Show button to scan QR code into text. - pub scan_qr: bool, + scan_qr: bool, /// Callback when scan button was pressed. pub scan_pressed: bool, /// Callback when Enter key was pressed. pub enter_pressed: bool, /// Flag to enter only numbers. - pub numeric: bool, + numeric: bool, + /// Flag to not show soft keyboard. + no_soft_keyboard: bool, } impl TextEdit { @@ -63,6 +65,7 @@ impl TextEdit { scan_pressed: false, enter_pressed: false, numeric: false, + no_soft_keyboard: false, } } @@ -161,7 +164,9 @@ impl TextEdit { if self.enter_pressed { KeyboardContent::unshift(); } - KeyboardContent::default().window_ui(self.numeric, ui.ctx()); + if !self.no_soft_keyboard { + KeyboardContent::default().window_ui(self.numeric, ui.ctx()); + } } }); }); @@ -302,4 +307,10 @@ impl TextEdit { self.scan_pressed = false; self } + + /// Do not show soft keyboard for input. + pub fn no_soft_keyboard(mut self) -> Self { + self.no_soft_keyboard = true; + self + } } \ No newline at end of file diff --git a/src/gui/views/modal.rs b/src/gui/views/modal.rs index 697ceef7..2d36a10c 100755 --- a/src/gui/views/modal.rs +++ b/src/gui/views/modal.rs @@ -248,12 +248,12 @@ impl Modal { } self.content_ui(ui, add_content); }).unwrap().response.layer_id; - - // Always show main content window above background window. - ctx.move_to_top(layer_id); // Setup first draw flag. if Self::first_draw() { + // Always show main content window above background window. + ctx.move_to_top(layer_id); + let r_state = MODAL_STATE.read(); let modal = r_state.modal.as_ref().unwrap(); modal.first_draw.store(false, Ordering::Relaxed); diff --git a/src/gui/views/wallets/wallet/transport/settings.rs b/src/gui/views/wallets/wallet/transport/settings.rs index c90542f2..6534b93a 100644 --- a/src/gui/views/wallets/wallet/transport/settings.rs +++ b/src/gui/views/wallets/wallet/transport/settings.rs @@ -160,6 +160,7 @@ impl TransportSettingsModal { .with(wallet.get_config().id) .with("_bin_edit"); let mut bin_edit = TextEdit::new(bin_edit_id) + .no_soft_keyboard() .paste() .focus(false); let bin_edit_before = self.bridge_bin_path_edit.clone(); @@ -178,6 +179,7 @@ impl TransportSettingsModal { .with(wallet.get_config().id) .with("_conn_edit"); let mut conn_edit = TextEdit::new(conn_edit_id) + .no_soft_keyboard() .paste() .focus(false) .scan_qr();