ui: fix dot input at transport amount, colored buttons at messages, animated wallet balance panel, hide soft keyboard on tx info modal close, fix translations

This commit is contained in:
ardocrat
2024-05-29 12:26:45 +03:00
parent 1cefb90071
commit 3a91ba6923
7 changed files with 19 additions and 13 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ impl RecoverySetup {
ui.add_space(12.0);
View::horizontal_line(ui, Colors::ITEM_STROKE);
ui.add_space(6.0);
ui.label(RichText::new(t!("wallets.delete_desc")).size(16.0).color(Colors::TEXT));
ui.label(RichText::new(t!("wallets.delete_desc")).size(16.0).color(Colors::RED));
ui.add_space(6.0);
// Draw button to delete the wallet.
+4 -3
View File
@@ -72,6 +72,7 @@ const ACCOUNT_LIST_MODAL: &'static str = "account_list_modal";
const QR_CODE_SCAN_MODAL: &'static str = "qr_code_scan_modal";
impl WalletContent {
/// Draw wallet content.
pub fn ui(&mut self,
ui: &mut egui::Ui,
frame: &mut eframe::Frame,
@@ -83,11 +84,11 @@ impl WalletContent {
let data = wallet.get_data();
let data_empty = data.is_none();
// Show wallet balance panel not on Settings tab, when wallet is not repairing,
// there is no error and data is not empty.
// Show wallet balance panel not on Settings tab with selected non-repairing
// wallet, when there is no error and data is not empty.
let show_balance = self.current_tab.get_type() != WalletTabType::Settings && !data_empty
&& !wallet.sync_error() && !wallet.is_repairing();
egui::TopBottomPanel::top("wallet_balance")
egui::TopBottomPanel::top(Id::from("wallet_balance").with(wallet.identifier()))
.frame(egui::Frame {
fill: Colors::FILL,
stroke: View::DEFAULT_STROKE,
+2 -2
View File
@@ -253,7 +253,7 @@ impl WalletMessages {
columns[0].vertical_centered_justified(|ui| {
// Draw sending request creation button.
let send_text = format!("{} {}", UPLOAD_SIMPLE, t!("wallets.send"));
View::button(ui, send_text, Colors::BUTTON, || {
View::colored_text_button(ui, send_text, Colors::RED, Colors::BUTTON, || {
self.show_request_modal(false, cb);
});
});
@@ -271,7 +271,7 @@ impl WalletMessages {
/// Draw invoice request creation button.
fn receive_button_ui(&mut self, ui: &mut egui::Ui, cb: &dyn PlatformCallbacks) {
let receive_text = format!("{} {}", DOWNLOAD_SIMPLE, t!("wallets.receive"));
View::button(ui, receive_text, Colors::BUTTON, || {
View::colored_text_button(ui, receive_text, Colors::GREEN, Colors::BUTTON, || {
self.show_request_modal(true, cb);
});
}
+4 -1
View File
@@ -671,6 +671,7 @@ impl WalletTransport {
modal: &Modal,
cb: &dyn PlatformCallbacks) {
ui.add_space(6.0);
let has_send_err = self.has_tor_send_error();
let sending = self.tor_sending();
if !has_send_err && !sending {
@@ -690,7 +691,7 @@ impl WalletTransport {
cb.show_keyboard();
} else {
self.address_scan_content.ui(ui, cb);
ui.add_space(12.0);
ui.add_space(6.0);
// Setup spacing between buttons.
ui.spacing_mut().item_spacing = egui::Vec2::new(6.0, 0.0);
@@ -740,6 +741,8 @@ impl WalletTransport {
// Check value if input was changed.
if amount_edit_before != self.amount_edit {
if !self.amount_edit.is_empty() {
// Trim text, replace "," by "." and parse amount.
self.amount_edit = self.amount_edit.trim().replace(",", ".");
match amount_from_hr_string(self.amount_edit.as_str()) {
Ok(a) => {
if !self.amount_edit.contains(".") {
+2
View File
@@ -529,6 +529,7 @@ impl WalletTransactions {
.filter(|tx| tx.data.id == tx_id)
.collect::<Vec<&WalletTransaction>>();
if txs.is_empty() {
cb.hide_keyboard();
modal.close();
return;
}
@@ -693,6 +694,7 @@ impl WalletTransactions {
modal: &Modal,
cb: &dyn PlatformCallbacks) {
if self.tx_info_slate.is_none() {
cb.hide_keyboard();
modal.close();
return;
}