ui: fix qr paddings, wallets, connections strokes

This commit is contained in:
ardocrat 2024-05-30 12:47:30 +03:00
parent e099b5da8e
commit 530f402d11
7 changed files with 17 additions and 17 deletions

View file

@ -101,12 +101,8 @@ impl NetworkContent {
// Show connections content. // Show connections content.
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: if show_connections{ stroke: if show_connections {
if Root::is_dual_panel_mode(ui) { View::item_stroke()
View::default_stroke()
} else {
Stroke::NONE
}
} else { } else {
Stroke::NONE Stroke::NONE
}, },

View file

@ -164,6 +164,7 @@ impl QrCodeContent {
if !sharing { if !sharing {
// Show button to share QR. // Show button to share QR.
let share_txt = format!("{} {}", IMAGES_SQUARE, t!("share")); let share_txt = format!("{} {}", IMAGES_SQUARE, t!("share"));
ui.add_space(4.0);
View::action_button(ui, share_txt, || { View::action_button(ui, share_txt, || {
{ {
let mut w_state = self.qr_image_state.write(); let mut w_state = self.qr_image_state.write();

View file

@ -199,7 +199,7 @@ impl WalletsContent {
if !list_hidden { if !list_hidden {
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: View::default_stroke(), stroke: View::item_stroke(),
fill: Colors::fill_deep(), fill: Colors::fill_deep(),
inner_margin: Margin { inner_margin: Margin {
left: if list_hidden { left: if list_hidden {
@ -340,6 +340,9 @@ impl WalletsContent {
.auto_shrink([false; 2]) .auto_shrink([false; 2])
.show(ui, |ui| { .show(ui, |ui| {
ui.vertical_centered(|ui| { ui.vertical_centered(|ui| {
if !dual_panel {
ui.add_space(1.0);
}
// Setup wallet list width. // Setup wallet list width.
let max_width = if !dual_panel { let max_width = if !dual_panel {
Root::SIDE_PANEL_WIDTH * 1.3 Root::SIDE_PANEL_WIDTH * 1.3
@ -350,9 +353,6 @@ impl WalletsContent {
let mut list = self.wallets.list().clone(); let mut list = self.wallets.list().clone();
// Remove deleted wallet from the list. // Remove deleted wallet from the list.
list.retain(|w| !w.is_deleted()); list.retain(|w| !w.is_deleted());
if !dual_panel {
ui.add_space(1.0);
}
for wallet in &list { for wallet in &list {
// Check if wallet reopen is needed. // Check if wallet reopen is needed.
if !wallet.is_open() && wallet.reopen_needed() { if !wallet.is_open() && wallet.reopen_needed() {

View file

@ -81,6 +81,8 @@ impl WalletContent {
// Show modal content for this ui container. // Show modal content for this ui container.
self.modal_content_ui(ui, wallet, cb); self.modal_content_ui(ui, wallet, cb);
let dual_panel = Root::is_dual_panel_mode(ui);
let data = wallet.get_data(); let data = wallet.get_data();
let data_empty = data.is_none(); let data_empty = data.is_none();
@ -102,7 +104,7 @@ impl WalletContent {
left: 0.0, left: 0.0,
right: 0.0, right: 0.0,
top: 0.0, top: 0.0,
bottom: if !Root::is_dual_panel_mode(ui) { bottom: if !dual_panel {
0.0 0.0
} else { } else {
-1.0 -1.0
@ -112,6 +114,9 @@ impl WalletContent {
}) })
.show_animated_inside(ui, show_balance, |ui| { .show_animated_inside(ui, show_balance, |ui| {
ui.vertical_centered(|ui| { ui.vertical_centered(|ui| {
if !dual_panel {
ui.add_space(1.0);
}
// Draw account info. // Draw account info.
View::max_width_ui(ui, Root::SIDE_PANEL_WIDTH * 1.3, |ui| { View::max_width_ui(ui, Root::SIDE_PANEL_WIDTH * 1.3, |ui| {
self.account_ui(ui, wallet, data.unwrap(), cb); self.account_ui(ui, wallet, data.unwrap(), cb);
@ -143,6 +148,7 @@ impl WalletContent {
// Show tab content panel. // Show tab content panel.
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::white_or_black(false), fill: Colors::white_or_black(false),
..Default::default() ..Default::default()
}) })
@ -396,7 +402,7 @@ impl WalletContent {
}); });
ui.add_space(2.0); ui.add_space(2.0);
View::horizontal_line(ui, Colors::item_stroke()); View::horizontal_line(ui, Colors::item_stroke());
ui.add_space(6.0); ui.add_space(10.0);
// Show copy button. // Show copy button.
ui.vertical_centered(|ui| { ui.vertical_centered(|ui| {
@ -407,7 +413,7 @@ impl WalletContent {
modal.close(); modal.close();
}); });
}); });
ui.add_space(6.0); ui.add_space(10.0);
View::horizontal_line(ui, Colors::item_stroke()); View::horizontal_line(ui, Colors::item_stroke());
ui.add_space(6.0); ui.add_space(6.0);
} else if let Some(result) = self.camera_content.qr_scan_result() { } else if let Some(result) = self.camera_content.qr_scan_result() {

View file

@ -129,7 +129,6 @@ impl WalletTab for WalletMessages {
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::white_or_black(false), fill: Colors::white_or_black(false),
inner_margin: Margin { inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0, left: View::far_left_inset_margin(ui) + 4.0,

View file

@ -90,7 +90,6 @@ impl WalletTab for WalletTransport {
// Show transport content panel. // Show transport content panel.
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::white_or_black(false), fill: Colors::white_or_black(false),
inner_margin: Margin { inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0, left: View::far_left_inset_margin(ui) + 4.0,

View file

@ -106,10 +106,9 @@ impl WalletTab for WalletTransactions {
// Show modal content for this ui container. // Show modal content for this ui container.
self.modal_content_ui(ui, wallet, cb); self.modal_content_ui(ui, wallet, cb);
// Show wallet transactions panel. // Show wallet transactions content.
egui::CentralPanel::default() egui::CentralPanel::default()
.frame(egui::Frame { .frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::button(), fill: Colors::button(),
inner_margin: Margin { inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0, left: View::far_left_inset_margin(ui) + 4.0,