diff --git a/node-gui/src/main.rs b/node-gui/src/main.rs index 863a323ec..dc2cb3599 100644 --- a/node-gui/src/main.rs +++ b/node-gui/src/main.rs @@ -23,7 +23,7 @@ use std::env; use common::time_getter::TimeGetter; use iced::advanced::graphics::core::window; -use iced::widget::{column, container, row, text, tooltip, Text}; +use iced::widget::{column, row, text, tooltip, Text}; use iced::{executor, Element, Length, Settings, Task, Theme}; use iced::{font, Subscription}; use iced_aw::widgets::spinner::Spinner; @@ -57,6 +57,7 @@ pub fn main() -> iced::Result { antialiasing: true, ..Settings::default() }) + .font(iced_fonts::REQUIRED_FONT_BYTES) .run_with(initialize) } @@ -303,6 +304,7 @@ fn view(state: &MintlayerNodeGUI) -> Element { tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ iced::widget::button(text("Testnet")).on_press(InitNetwork::Testnet), @@ -313,13 +315,14 @@ fn view(state: &MintlayerNodeGUI) -> Element { tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], ] .align_x(iced::Alignment::Center) .spacing(5); let res: Element = - container(error_box).center_x(Length::Fill).center_y(Length::Fill).into(); + iced::widget::container(error_box).center(Length::Fill).into(); res.map(Message::InitNetwork) } @@ -336,6 +339,7 @@ fn view(state: &MintlayerNodeGUI) -> Element { tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ iced::widget::button(text("Cold")).on_press(WalletMode::Cold), @@ -346,19 +350,20 @@ fn view(state: &MintlayerNodeGUI) -> Element { tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], ] .align_x(iced::Alignment::Center) .spacing(5); let res: Element = - container(error_box).center_x(Length::Fill).center_y(Length::Fill).into(); + iced::widget::container(error_box).center(Length::Fill).into(); res.map(Message::InitWalletMode) } MintlayerNodeGUI::Loading(_) => { - container(Spinner::new().width(Length::Fill).height(Length::Fill)).into() + iced::widget::container(Spinner::new().width(Length::Fill).height(Length::Fill)).into() } MintlayerNodeGUI::Loaded(_backend_sender, w) => w.view().map(Message::MainWindowMessage), @@ -373,8 +378,7 @@ fn view(state: &MintlayerNodeGUI) -> Element { .align_x(iced::Alignment::Center) .spacing(5); - let res: Element<()> = - container(error_box).center_x(Length::Fill).center_y(Length::Fill).into(); + let res: Element<()> = iced::widget::container(error_box).center(Length::Fill).into(); res.map(|_| Message::ShuttingDownFinished) } diff --git a/node-gui/src/main_window/main_widget/tabs/summary.rs b/node-gui/src/main_window/main_widget/tabs/summary.rs index 761995b1d..3aecfaa41 100644 --- a/node-gui/src/main_window/main_widget/tabs/summary.rs +++ b/node-gui/src/main_window/main_widget/tabs/summary.rs @@ -71,7 +71,8 @@ impl Tab for SummaryTab { NETWORK_TOOLTIP, tooltip::Position::Bottom, ) - .gap(10), + .gap(10) + .style(iced::widget::container::bordered_box), ), ) .push( diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs b/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs index 5e7936696..d76244599 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs @@ -14,7 +14,7 @@ // limitations under the License. use iced::{ - widget::{button, column, container, row, tooltip, Text}, + widget::{button, column, row, tooltip, Text}, Element, }; use iced_aw::{Grid, GridRow}; @@ -29,7 +29,7 @@ pub fn view_addresses( account: &AccountInfo, still_syncing: Option, ) -> Element<'static, WalletMessage> { - let field = |text: String| container(Text::new(text)).padding(5); + let field = |text: String| iced::widget::container(Text::new(text)).padding(5); let addresses = account .addresses .iter() @@ -57,6 +57,7 @@ pub fn view_addresses( tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], ] .into() diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/console.rs b/node-gui/src/main_window/main_widget/tabs/wallet/console.rs index 6eee9bd90..933ff7291 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/console.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/console.rs @@ -77,6 +77,7 @@ pub fn view_console( tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], ] .into() diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs b/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs index cf20c5e1c..0ec7f3893 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs @@ -16,7 +16,7 @@ use std::collections::BTreeMap; use iced::{ - widget::{button, column, container, row, text_input, tooltip, tooltip::Position, Text}, + widget::{button, column, row, text_input, tooltip, tooltip::Position, Text}, Element, Length, }; use iced_aw::{Grid, GridRow}; @@ -61,7 +61,7 @@ pub fn view_delegation( delegate_staking_amounts: &BTreeMap, still_syncing: Option, ) -> Element<'static, WalletMessage> { - let field = |text: String| container(Text::new(text)).padding(5); + let field = |text: String| iced::widget::container(Text::new(text)).padding(5); let delegation_balance_grid = { // We print the table only if there are delegations @@ -96,19 +96,22 @@ pub fn view_delegation( GridRow::new() .push(row![ tooltip( - container(Text::new(delegation_address.to_short_string()).font( - iced::font::Font { - family: iced::font::Family::Monospace, - weight: Default::default(), - stretch: Default::default(), - style: iced::font::Style::Normal, - } - )) + iced::widget::container( + Text::new(delegation_address.to_short_string()).font( + iced::font::Font { + family: iced::font::Family::Monospace, + weight: Default::default(), + stretch: Default::default(), + style: iced::font::Style::Normal, + } + ) + ) .padding(5), Text::new(delegation_address.to_string()), Position::Bottom, ) - .gap(5), + .gap(5) + .style(iced::widget::container::bordered_box), button( Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string()) .font(iced_fonts::BOOTSTRAP_FONT), @@ -121,19 +124,22 @@ pub fn view_delegation( ]) .push(row![ tooltip( - container(Text::new(pool_address.to_short_string()).font( - iced::font::Font { - family: iced::font::Family::Monospace, - weight: Default::default(), - stretch: Default::default(), - style: iced::font::Style::Normal, - } - )) + iced::widget::container( + Text::new(pool_address.to_short_string()).font( + iced::font::Font { + family: iced::font::Family::Monospace, + weight: Default::default(), + stretch: Default::default(), + style: iced::font::Style::Normal, + } + ) + ) .padding(5), Text::new(pool_address.to_string()), Position::Bottom, ) - .gap(5), + .gap(5) + .style(iced::widget::container::bordered_box), button( Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string()) .font(iced_fonts::BOOTSTRAP_FONT), @@ -184,6 +190,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], // ----- Create delegation row![ @@ -203,6 +210,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ text_input("Delegation address", delegation_address) @@ -221,6 +229,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ iced::widget::button(Text::new("Create delegation")) @@ -233,6 +242,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], iced::widget::horizontal_rule(10), // ----- Send delegation to address @@ -253,6 +263,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ text_input("Amount to send", send_delegation_amount) @@ -271,6 +282,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ text_input("Delegation address", send_delegation_id) @@ -289,6 +301,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ iced::widget::button(Text::new("Withdraw from delegation")) @@ -301,6 +314,7 @@ pub fn view_delegation( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], iced::widget::horizontal_rule(10), // ----- Delegation balance grid diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs b/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs index 6dae672ee..f2f5aff50 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs @@ -101,6 +101,7 @@ pub fn view_left_panel( tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ]; button(label) @@ -154,7 +155,7 @@ pub fn view_left_panel( column![ text(file_name).size(25), row![ - pick_list.width(100), + pick_list, button(Text::new("+")) .style(iced::widget::button::success) .on_press(WalletMessage::NewAccount), @@ -165,6 +166,7 @@ pub fn view_left_panel( tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ] .align_y(Alignment::Center) .spacing(10) diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs b/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs index 71e52f5ba..30506ffda 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs @@ -14,7 +14,7 @@ // limitations under the License. use iced::{ - widget::{button, column, container, row, text_input, tooltip, tooltip::Position, Text}, + widget::{button, column, row, text_input, tooltip, tooltip::Position, Text}, Alignment, Element, Length, }; use iced_aw::{Grid, GridRow}; @@ -78,7 +78,7 @@ pub fn view_stake( decommission_pool_address: &str, still_syncing: Option, ) -> Element<'static, WalletMessage> { - let field = |text: String| container(Text::new(text)).padding(5); + let field = |text: String| iced::widget::container(Text::new(text)).padding(5); let staking_balance_grid = { // We print the table only if there are staking pools @@ -103,19 +103,22 @@ pub fn view_stake( GridRow::new() .push(row!( tooltip( - container(Text::new(pool_id_address.to_short_string()).font( - iced::font::Font { - family: iced::font::Family::Monospace, - weight: Default::default(), - stretch: Default::default(), - style: iced::font::Style::Normal, - } - )) + iced::widget::container( + Text::new(pool_id_address.to_short_string()).font( + iced::font::Font { + family: iced::font::Family::Monospace, + weight: Default::default(), + stretch: Default::default(), + style: iced::font::Style::Normal, + } + ) + ) .padding(5), Text::new(pool_id_address.to_string()), Position::Bottom, ) - .gap(5), + .gap(5) + .style(iced::widget::container::bordered_box), button( Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string()) .font(iced_fonts::BOOTSTRAP_FONT), @@ -159,6 +162,7 @@ pub fn view_stake( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ] } else { row![] @@ -184,13 +188,17 @@ pub fn view_stake( Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT), MIN_PLEDGE_AMOUNT_TOOLTIP_TEXT, Position::Bottom) - .gap(10)], + .gap(10) + .style(iced::widget::container::bordered_box), + ], row![Text::new(maturity_period_text).size(13), tooltip( Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT), MATURITY_PERIOD_TOOLTIP_TEXT, Position::Bottom) - .gap(10)], + .gap(10) + .style(iced::widget::container::bordered_box), + ], row![ text_input("Pledge amount for the new staking pool", stake_amount) .on_input(|value| { @@ -206,6 +214,7 @@ pub fn view_stake( PLEDGE_AMOUNT_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ @@ -223,6 +232,7 @@ pub fn view_stake( COST_PER_BLOCK_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ @@ -240,6 +250,7 @@ pub fn view_stake( MARGIN_PER_THOUSAND_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ @@ -257,6 +268,7 @@ pub fn view_stake( DECOMMISSION_ADDRESS_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ @@ -269,6 +281,7 @@ pub fn view_stake( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], staking_enabled_row.spacing(10).align_y(Alignment::Center), @@ -290,6 +303,7 @@ pub fn view_stake( DECOMMISSION_POOL_ADDRESS_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ text_input("Address that will receive the proceeds from the staking pool", decommission_pool_address) @@ -306,6 +320,7 @@ pub fn view_stake( DECOMMISSION_COINS_DESTINATION_ADDRESS_TOOLTIP_TEXT, Position::Bottom) .gap(10) + .style(iced::widget::container::bordered_box), ], row![ iced::widget::button(Text::new("Decommission staking pool")) @@ -318,6 +333,7 @@ pub fn view_stake( Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], ] .spacing(10) diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs b/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs index c0cf1dd0e..a59a2bb91 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs @@ -65,6 +65,7 @@ pub fn view_top_panel( tooltip::Position::Bottom ) .gap(10) + .style(iced::widget::container::bordered_box), ], } .align_y(Alignment::Center) diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs b/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs index 6e9278157..5e55657d7 100644 --- a/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs +++ b/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs @@ -14,7 +14,7 @@ // limitations under the License. use iced::{ - widget::{button, container, row, tooltip, tooltip::Position, Column, Text}, + widget::{button, row, tooltip, tooltip::Position, Column, Text}, Alignment, Element, Length, }; use iced_aw::{Grid, GridRow}; @@ -30,7 +30,7 @@ pub fn view_transactions( chain_config: &ChainConfig, account: &AccountInfo, ) -> Element<'static, WalletMessage> { - let field = |text: String| container(Text::new(text)).padding(5); + let field = |text: String| iced::widget::container(Text::new(text)).padding(5); let mut transactions = Column::new(); let current_transaction_list = &account.transaction_list; @@ -59,17 +59,20 @@ pub fn view_transactions( .push(field(format!("{}", current_transaction_list.skip + index))) .push(row![ tooltip( - container(Text::new(tx.txid.to_string()).font(iced::font::Font { - family: iced::font::Family::Monospace, - weight: Default::default(), - stretch: Default::default(), - style: iced::font::Style::Normal, - })) + iced::widget::container(Text::new(tx.txid.to_string()).font( + iced::font::Font { + family: iced::font::Family::Monospace, + weight: Default::default(), + stretch: Default::default(), + style: iced::font::Style::Normal, + } + )) .padding(5), Text::new(full_tx_id_str.clone()), Position::Bottom, ) - .gap(5), + .gap(5) + .style(iced::widget::container::bordered_box), button( Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string()) .font(iced_fonts::BOOTSTRAP_FONT), diff --git a/node-gui/src/main_window/mod.rs b/node-gui/src/main_window/mod.rs index da9bbe028..c3df0104e 100644 --- a/node-gui/src/main_window/mod.rs +++ b/node-gui/src/main_window/mod.rs @@ -21,7 +21,10 @@ use common::{ primitives::{per_thousand::PerThousand, semver::SemVer, user_agent::UserAgent, Amount}, }; use iced::{ - widget::{center, Stack, Text}, + widget::{ + button::{Button, Style}, + center, text, Stack, Text, + }, Element, Length, Task, }; use logging::log; @@ -219,6 +222,7 @@ pub enum MainWindowMessage { CopyToClipboard(String), ClosePopup, CloseDialog, + IgnoreEvent, } impl MainWindow { @@ -411,12 +415,12 @@ impl MainWindow { let wallet_type = wallet_info.wallet_type; self.node_state.wallets.insert(wallet_id, wallet_info); - Task::perform(async {}, move |_| { - MainWindowMessage::MainWidgetMessage(MainWidgetMessage::WalletAdded { + Task::done(MainWindowMessage::MainWidgetMessage( + MainWidgetMessage::WalletAdded { wallet_id, wallet_type, - }) - }) + }, + )) } BackendEvent::OpenWallet(Err(error)) | BackendEvent::ImportWallet(Err(error)) => { @@ -726,6 +730,17 @@ impl MainWindow { import, wallet_type, } => { + self.active_dialog = match import { + ImportOrCreate::Create => ActiveDialog::WalletCreate { + generated_mnemonic: mnemonic.clone(), + wallet_type, + state: ImportState::new_importing(String::new()), + }, + ImportOrCreate::Import => ActiveDialog::WalletRecover { + wallet_type, + state: ImportState::new_importing(mnemonic.to_string()), + }, + }; self.file_dialog_active = false; backend_sender.send(BackendRequest::RecoverWallet { mnemonic, @@ -771,6 +786,13 @@ impl MainWindow { wallet_id, password, } => { + self.active_dialog = ActiveDialog::WalletUnlock { + wallet_id, + state: UnlockState { + password: password.clone(), + unlocking: true, + }, + }; backend_sender.send(BackendRequest::UpdateEncryption { wallet_id, action: EncryptionAction::Unlock(password), @@ -803,6 +825,8 @@ impl MainWindow { self.active_dialog = ActiveDialog::None; Task::none() } + + MainWindowMessage::IgnoreEvent => Task::none(), } } @@ -816,6 +840,19 @@ impl MainWindow { iced::widget::Column::new().height(70), ]; + let overlay = || { + Button::new(text("")) + .width(Length::Fill) + .height(Length::Fill) + .style(|_theme, _status| Style { + background: Some(iced::Background::Color(iced::Color::TRANSPARENT)), + text_color: iced::Color::BLACK, + ..Style::default() + }) + .on_press(MainWindowMessage::IgnoreEvent) + .into() + }; + let show_dialog = self.active_dialog != ActiveDialog::None; let dialog = show_dialog .then(move || -> Element { @@ -832,11 +869,7 @@ impl MainWindow { Some(generated_mnemonic.clone()), state.clone(), MainWindowMessage::ImportWalletMnemonic { - mnemonic: if state.entered_mnemonic.is_empty() { - generated_mnemonic.to_string() - } else { - state.entered_mnemonic.clone() - }, + mnemonic: generated_mnemonic.to_string(), import: ImportOrCreate::Create, wallet_type, }, @@ -845,6 +878,7 @@ impl MainWindow { state: state.with_changed_mnemonic(mnemonic), }, MainWindowMessage::CloseDialog, + MainWindowMessage::CopyToClipboard(generated_mnemonic.to_string()), ) .into() } @@ -864,6 +898,7 @@ impl MainWindow { state: state.with_changed_mnemonic(mnemonic), }, MainWindowMessage::CloseDialog, + MainWindowMessage::CopyToClipboard(state.entered_mnemonic.clone()), ) .into() } @@ -940,7 +975,7 @@ impl MainWindow { } } }) - .map(|d| center(d).into()); + .map(|d| [overlay(), center(d).into()]); let popup_opt = self.popups.last(); let show_popup = popup_opt.is_some() || self.file_dialog_active; @@ -954,11 +989,16 @@ impl MainWindow { (_, None) => Text::new("Nothing to show").into(), } }) - .map(|d| center(d).into()); - - Stack::with_children([main_content.into()].into_iter().chain(dialog).chain(popup)) - .width(Length::Fill) - .height(Length::Fill) - .into() + .map(|d| [overlay(), center(d).into()]); + + Stack::with_children( + [main_content.into()] + .into_iter() + .chain(dialog.into_iter().flatten()) + .chain(popup.into_iter().flatten()), + ) + .width(Length::Fill) + .height(Length::Fill) + .into() } } diff --git a/node-gui/src/widgets/wallet_mnemonic.rs b/node-gui/src/widgets/wallet_mnemonic.rs index ac1947416..241d83e57 100644 --- a/node-gui/src/widgets/wallet_mnemonic.rs +++ b/node-gui/src/widgets/wallet_mnemonic.rs @@ -15,8 +15,8 @@ use iced::{ alignment::Horizontal, - widget::{container, text, text_input, Button, Text}, - Length, + widget::{container, text, text_input, Button, Row, Text}, + Element, Length, }; use iced_aw::Card; @@ -26,6 +26,7 @@ pub fn wallet_mnemonic_dialog<'a, Message, F>( on_import: Message, on_mnemonic_change: F, on_close: Message, + on_copy_to_clipboard: Message, ) -> Card<'a, Message> where Message: Clone + 'a, @@ -50,13 +51,31 @@ where ) .foot(container(text("Loading...")).center_x(Length::Fill)) } else { - Card::new( - Text::new(action_text), - iced::widget::column![text_input("Mnemonic", &mnemonic) + let body: Element<_> = if generated_mnemonic_opt.is_none() { + text_input("Mnemonic", &mnemonic) + // only enable edit if there is not pre-generated mnemonic .on_input(on_mnemonic_change) - .padding(15)], - ) - .foot(container(button).center_x(Length::Fill)) + .padding(15) + .into() + } else { + Row::new() + .push(text(mnemonic)) + .push( + Button::new( + Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string()) + .font(iced_fonts::BOOTSTRAP_FONT), + ) + .style(iced::widget::button::text) + // .width(20) + // .height(20) + .on_press(on_copy_to_clipboard), + ) + .spacing(10) + .padding(15) + .into() + }; + + Card::new(Text::new(action_text), body).foot(container(button).center_x(Length::Fill)) } .max_width(600.0) .on_close(on_close) @@ -69,6 +88,13 @@ pub struct ImportState { } impl ImportState { + pub fn new_importing(entered_mnemonic: String) -> Self { + Self { + entered_mnemonic, + importing: true, + } + } + pub fn with_changed_mnemonic(&self, new_mnemonic: String) -> Self { Self { entered_mnemonic: new_mnemonic, diff --git a/node-gui/src/widgets/wallet_unlock.rs b/node-gui/src/widgets/wallet_unlock.rs index 98eeb51c7..4bfa7c48f 100644 --- a/node-gui/src/widgets/wallet_unlock.rs +++ b/node-gui/src/widgets/wallet_unlock.rs @@ -43,7 +43,7 @@ where let password = text_input("Password", &state.password) .secure(true) - .on_input_maybe(state.unlocking.then_some(on_edit_password)); + .on_input_maybe((!state.unlocking).then_some(on_edit_password)); Card::new( Text::new("Unlock"),