From 9eebe0c7914b895b4043db3e5b0c919c1f4cf868 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 16 Aug 2023 05:15:35 +0300 Subject: [PATCH] ui: fix wallet balance content margin, fix panels stroke, update translations --- locales/en.yml | 2 +- locales/ru.yml | 2 +- src/gui/views/wallets/content.rs | 2 +- src/gui/views/wallets/wallet/content.rs | 17 +++++++++++------ src/gui/views/wallets/wallet/receive.rs | 2 +- src/gui/views/wallets/wallet/send.rs | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index d2675a4..0cf8dbb 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -2,7 +2,7 @@ copy: Copy paste: Paste continue: Continue complete: Complete -loading_error: Loading error +error: Error retry: Retry close: Close change: Change diff --git a/locales/ru.yml b/locales/ru.yml index 1c6f66e..3ad937a 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -2,7 +2,7 @@ copy: Копировать paste: Вставить continue: Продолжить complete: Завершить -loading_error: Ошибка загрузки +error: Ошибка retry: Повторить close: Закрыть change: Изменить diff --git a/src/gui/views/wallets/content.rs b/src/gui/views/wallets/content.rs index 7b858af..b563b34 100644 --- a/src/gui/views/wallets/content.rs +++ b/src/gui/views/wallets/content.rs @@ -444,7 +444,7 @@ impl WalletsContent { // Setup wallet status text. let status_text = if wallet.is_open() { if wallet.sync_error() { - format!("{} {}", WARNING_CIRCLE, t!("loading_error")) + format!("{} {}", WARNING_CIRCLE, t!("error")) } else if wallet.is_closing() { format!("{} {}", SPINNER, t!("wallets.closing")) } else if wallet.is_repairing() { diff --git a/src/gui/views/wallets/wallet/content.rs b/src/gui/views/wallets/wallet/content.rs index 2a28644..9d7c92d 100644 --- a/src/gui/views/wallets/wallet/content.rs +++ b/src/gui/views/wallets/wallet/content.rs @@ -60,7 +60,13 @@ impl WalletContent { left: View::far_left_inset_margin(ui) + 4.0, right: View::get_right_inset() + 4.0, top: 4.0, - bottom: View::get_bottom_inset() + 4.0, + bottom: 0.0, + }, + outer_margin: Margin { + left: 0.0, + right: 0.0, + top: 0.0, + bottom: -1.0, }, ..Default::default() }) @@ -117,9 +123,9 @@ impl WalletContent { /// Draw wallet account balance. fn account_balance_ui(ui: &mut egui::Ui, data: &WalletData, account: &Option) { let mut rect = ui.available_rect_before_wrap(); - rect.set_height(76.0); + rect.set_height(75.0); // Draw round background. - let rounding = View::item_rounding(0, 1, false); + let rounding = View::item_rounding(0, 2, false); ui.painter().rect(rect, rounding, Colors::BUTTON, View::ITEM_STROKE); ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| { @@ -131,7 +137,7 @@ impl WalletContent { ui.style_mut().visuals.widgets.active.rounding = Rounding::same(8.0); // Draw button to add new account. - View::item_button(ui, View::item_rounding(0, 1, true), PLUS, None, || { + View::item_button(ui, View::item_rounding(0, 2, true), PLUS, None, || { //TODO add account modal. }); @@ -156,9 +162,8 @@ impl WalletContent { Some(name) => name.to_owned() }; let account_text = format!("{} {}", FILE_ARCHIVE, account_name); - ui.add_space(-1.0); + ui.add_space(-2.0); View::ellipsize_text(ui, account_text, 15.0, Colors::TEXT); - ui.add_space(1.0); // Show confirmed height. let height_text = format!("{} {}", PACKAGE, data.info.last_confirmed_height); diff --git a/src/gui/views/wallets/wallet/receive.rs b/src/gui/views/wallets/wallet/receive.rs index 80be65c..dbbbb6c 100644 --- a/src/gui/views/wallets/wallet/receive.rs +++ b/src/gui/views/wallets/wallet/receive.rs @@ -42,7 +42,7 @@ impl WalletTab for WalletReceive { // Show receiving content panel. egui::CentralPanel::default() .frame(egui::Frame { - stroke: View::DEFAULT_STROKE, + stroke: View::ITEM_STROKE, fill: Colors::WHITE, inner_margin: Margin { left: View::far_left_inset_margin(ui) + 4.0, diff --git a/src/gui/views/wallets/wallet/send.rs b/src/gui/views/wallets/wallet/send.rs index 824485e..b3b260a 100644 --- a/src/gui/views/wallets/wallet/send.rs +++ b/src/gui/views/wallets/wallet/send.rs @@ -41,7 +41,7 @@ impl WalletTab for WalletSend { // Show sending content panel. egui::CentralPanel::default() .frame(egui::Frame { - stroke: View::DEFAULT_STROKE, + stroke: View::ITEM_STROKE, fill: Colors::WHITE, inner_margin: Margin { left: View::far_left_inset_margin(ui) + 4.0,