fix: wallet list bottom padding
This commit is contained in:
parent
f86988eab6
commit
8e6a91470f
2 changed files with 34 additions and 36 deletions
|
@ -640,7 +640,7 @@ impl View {
|
||||||
ui.set_opacity(0.9);
|
ui.set_opacity(0.9);
|
||||||
egui::Image::new(logo).fit_to_exact_size(egui::vec2(182.0, 182.0)).ui(ui);
|
egui::Image::new(logo).fit_to_exact_size(egui::vec2(182.0, 182.0)).ui(ui);
|
||||||
});
|
});
|
||||||
ui.add_space(-12.0);
|
ui.add_space(-11.0);
|
||||||
ui.label(RichText::new("GRIM")
|
ui.label(RichText::new("GRIM")
|
||||||
.size(24.0)
|
.size(24.0)
|
||||||
.color(Colors::white_or_black(true))
|
.color(Colors::white_or_black(true))
|
||||||
|
|
|
@ -205,8 +205,8 @@ impl WalletsContent {
|
||||||
inner_margin: Margin {
|
inner_margin: Margin {
|
||||||
left: View::far_left_inset_margin(ui) + 4.0,
|
left: View::far_left_inset_margin(ui) + 4.0,
|
||||||
right: View::far_right_inset_margin(ui) + 4.0,
|
right: View::far_right_inset_margin(ui) + 4.0,
|
||||||
top: 4.0,
|
top: 3.0,
|
||||||
bottom: View::get_bottom_inset() + 4.0,
|
bottom: 4.0,
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
@ -325,44 +325,42 @@ impl WalletsContent {
|
||||||
fn wallet_list_ui(&mut self,
|
fn wallet_list_ui(&mut self,
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
cb: &dyn PlatformCallbacks) {
|
cb: &dyn PlatformCallbacks) {
|
||||||
ui.scope(|ui| {
|
ScrollArea::vertical()
|
||||||
ScrollArea::vertical()
|
.id_source("wallet_list")
|
||||||
.id_source("wallet_list")
|
.scroll_bar_visibility(ScrollBarVisibility::AlwaysHidden)
|
||||||
.scroll_bar_visibility(ScrollBarVisibility::AlwaysHidden)
|
.auto_shrink([false; 2])
|
||||||
.auto_shrink([false; 2])
|
.show(ui, |ui| {
|
||||||
.show(ui, |ui| {
|
ui.vertical_centered(|ui| {
|
||||||
ui.vertical_centered(|ui| {
|
View::max_width_ui(ui, Root::SIDE_PANEL_WIDTH * 1.3, |ui| {
|
||||||
View::max_width_ui(ui, Root::SIDE_PANEL_WIDTH * 1.3, |ui| {
|
// Show application logo and name.
|
||||||
// Show application logo and name.
|
View::app_logo_name_version(ui);
|
||||||
View::app_logo_name_version(ui);
|
ui.add_space(15.0);
|
||||||
ui.add_space(15.0);
|
|
||||||
|
|
||||||
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| {
|
list.retain(|w| {
|
||||||
let deleted = w.is_deleted();
|
let deleted = w.is_deleted();
|
||||||
if deleted {
|
if deleted {
|
||||||
self.wallets.select(None);
|
self.wallets.select(None);
|
||||||
self.wallets.remove(w.get_config().id);
|
self.wallets.remove(w.get_config().id);
|
||||||
ui.ctx().request_repaint();
|
ui.ctx().request_repaint();
|
||||||
}
|
|
||||||
!deleted
|
|
||||||
});
|
|
||||||
for wallet in &list {
|
|
||||||
// Check if wallet reopen is needed.
|
|
||||||
if !wallet.is_open() && wallet.reopen_needed() {
|
|
||||||
wallet.set_reopen(false);
|
|
||||||
self.wallets.select(Some(wallet.get_config().id));
|
|
||||||
self.show_open_wallet_modal(cb);
|
|
||||||
}
|
|
||||||
// Draw wallet list item.
|
|
||||||
self.wallet_item_ui(ui, wallet, cb);
|
|
||||||
ui.add_space(5.0);
|
|
||||||
}
|
}
|
||||||
|
!deleted
|
||||||
});
|
});
|
||||||
|
for wallet in &list {
|
||||||
|
// Check if wallet reopen is needed.
|
||||||
|
if !wallet.is_open() && wallet.reopen_needed() {
|
||||||
|
wallet.set_reopen(false);
|
||||||
|
self.wallets.select(Some(wallet.get_config().id));
|
||||||
|
self.show_open_wallet_modal(cb);
|
||||||
|
}
|
||||||
|
// Draw wallet list item.
|
||||||
|
self.wallet_item_ui(ui, wallet, cb);
|
||||||
|
ui.add_space(5.0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draw wallet list item.
|
/// Draw wallet list item.
|
||||||
|
|
Loading…
Reference in a new issue