mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-24 23:03:57 +01:00
modal: close refactoring
This commit is contained in:
@@ -175,7 +175,7 @@ impl CommonSettings {
|
||||
let on_save = |c: &mut CommonSettings| {
|
||||
if !c.name_edit.is_empty() {
|
||||
wallet.change_name(c.name_edit.clone());
|
||||
modal.close();
|
||||
Modal::close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -203,7 +203,7 @@ impl CommonSettings {
|
||||
columns[0].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("modal.cancel"), Colors::white_or_black(false), || {
|
||||
// Close modal.
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
columns[1].vertical_centered_justified(|ui| {
|
||||
@@ -235,7 +235,7 @@ impl CommonSettings {
|
||||
c.old_pass_edit = "".to_string();
|
||||
c.new_pass_edit = "".to_string();
|
||||
// Close modal.
|
||||
modal.close();
|
||||
Modal::close();
|
||||
}
|
||||
Err(_) => c.wrong_pass = true
|
||||
}
|
||||
@@ -298,7 +298,7 @@ impl CommonSettings {
|
||||
columns[0].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("modal.cancel"), Colors::white_or_black(false), || {
|
||||
// Close modal.
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
columns[1].vertical_centered_justified(|ui| {
|
||||
@@ -320,7 +320,7 @@ impl CommonSettings {
|
||||
let on_save = |c: &mut CommonSettings| {
|
||||
if let Ok(min_conf) = c.min_confirmations_edit.parse::<u64>() {
|
||||
wallet.update_min_confirmations(min_conf);
|
||||
modal.close();
|
||||
Modal::close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -357,7 +357,7 @@ impl CommonSettings {
|
||||
columns[0].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("modal.cancel"), Colors::white_or_black(false), || {
|
||||
// Close modal.
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
columns[1].vertical_centered_justified(|ui| {
|
||||
|
||||
@@ -153,8 +153,8 @@ impl RecoverySettings {
|
||||
});
|
||||
}
|
||||
DELETE_CONFIRMATION_MODAL => {
|
||||
Modal::ui(ui.ctx(), |ui, modal| {
|
||||
self.deletion_modal_ui(ui, wallet, modal);
|
||||
Modal::ui(ui.ctx(), |ui, _| {
|
||||
self.deletion_modal_ui(ui, wallet);
|
||||
});
|
||||
}
|
||||
_ => {}
|
||||
@@ -205,7 +205,7 @@ impl RecoverySettings {
|
||||
ui.vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("close"), Colors::white_or_black(false), || {
|
||||
self.recovery_phrase = None;
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@@ -248,7 +248,7 @@ impl RecoverySettings {
|
||||
columns[0].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("modal.cancel"), Colors::white_or_black(false), || {
|
||||
self.recovery_phrase = None;
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
columns[1].vertical_centered_justified(|ui| {
|
||||
@@ -265,8 +265,7 @@ impl RecoverySettings {
|
||||
/// Draw wallet deletion [`Modal`] content.
|
||||
fn deletion_modal_ui(&mut self,
|
||||
ui: &mut egui::Ui,
|
||||
wallet: &Wallet,
|
||||
modal: &Modal) {
|
||||
wallet: &Wallet) {
|
||||
ui.add_space(8.0);
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.label(RichText::new(t!("wallets.delete_conf"))
|
||||
@@ -283,13 +282,13 @@ impl RecoverySettings {
|
||||
ui.columns(2, |columns| {
|
||||
columns[0].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("modal.cancel"), Colors::white_or_black(false), || {
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
columns[1].vertical_centered_justified(|ui| {
|
||||
View::button(ui, t!("delete"), Colors::white_or_black(false), || {
|
||||
wallet.delete_wallet();
|
||||
modal.close();
|
||||
Modal::close();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user