wallets: status before connection at list item

This commit is contained in:
ardocrat 2024-06-04 16:10:25 +03:00
parent a5dcb341a7
commit 929d452245

View file

@ -418,7 +418,7 @@ impl WalletsContent {
let layout_size = ui.available_size(); let layout_size = ui.available_size();
ui.allocate_ui_with_layout(layout_size, Layout::left_to_right(Align::Center), |ui| { ui.allocate_ui_with_layout(layout_size, Layout::left_to_right(Align::Center), |ui| {
ui.add_space(7.0); ui.add_space(6.0);
ui.vertical(|ui| { ui.vertical(|ui| {
ui.add_space(3.0); ui.add_space(3.0);
// Setup wallet name text. // Setup wallet name text.
@ -432,15 +432,6 @@ impl WalletsContent {
View::ellipsize_text(ui, config.name, 18.0, name_color); View::ellipsize_text(ui, config.name, 18.0, name_color);
}); });
// Setup wallet connection text.
let conn_text = if let Some(conn) = wallet.get_current_ext_conn() {
format!("{} {}", GLOBE_SIMPLE, conn.url)
} else {
format!("{} {}", COMPUTER_TOWER, t!("network.node"))
};
View::ellipsize_text(ui, conn_text, 15.0, Colors::text(false));
ui.add_space(1.0);
// Setup wallet status text. // Setup wallet status text.
let status_text = if wallet.is_open() { let status_text = if wallet.is_open() {
if wallet.sync_error() { if wallet.sync_error() {
@ -473,7 +464,16 @@ impl WalletsContent {
} else { } else {
format!("{} {}", FOLDER_LOCK, t!("wallets.locked")) format!("{} {}", FOLDER_LOCK, t!("wallets.locked"))
}; };
ui.label(RichText::new(status_text).size(15.0).color(Colors::gray())); View::ellipsize_text(ui, status_text, 15.0, Colors::text(false));
ui.add_space(1.0);
// Setup wallet connection text.
let conn_text = if let Some(conn) = wallet.get_current_ext_conn() {
format!("{} {}", GLOBE_SIMPLE, conn.url)
} else {
format!("{} {}", COMPUTER_TOWER, t!("network.node"))
};
ui.label(RichText::new(conn_text).size(15.0).color(Colors::gray()));
ui.add_space(3.0); ui.add_space(3.0);
}); });
}); });