ui: fix logo paddings, colors, do not recreate wallets panel on visibility change

This commit is contained in:
ardocrat 2024-05-31 06:35:53 +03:00
parent 538ff37056
commit 768f081e5b
3 changed files with 26 additions and 33 deletions

View file

@ -94,7 +94,7 @@ impl ConnectionsContent {
if saved_chain_type != AppConfig::chain_type() { if saved_chain_type != AppConfig::chain_type() {
ExternalConnection::start_ext_conn_availability_check(); ExternalConnection::start_ext_conn_availability_check();
} }
ui.add_space(5.0); ui.add_space(6.0);
// Show integrated node info content. // Show integrated node info content.
Self::integrated_node_item_ui(ui); Self::integrated_node_item_ui(ui);

View file

@ -636,7 +636,10 @@ impl View {
egui::include_image!("../../../img/logo.png") egui::include_image!("../../../img/logo.png")
}; };
// Show application logo and name. // Show application logo and name.
egui::Image::new(logo).fit_to_exact_size(egui::vec2(180.0, 180.0)).ui(ui); ui.scope(|ui| {
ui.set_opacity(0.9);
egui::Image::new(logo).fit_to_exact_size(egui::vec2(182.0, 182.0)).ui(ui);
});
ui.add_space(-12.0); ui.add_space(-12.0);
ui.label(RichText::new("GRIM") ui.label(RichText::new("GRIM")
.size(24.0) .size(24.0)
@ -645,7 +648,7 @@ impl View {
ui.add_space(-2.0); ui.add_space(-2.0);
ui.label(RichText::new(built_info::PKG_VERSION) ui.label(RichText::new(built_info::PKG_VERSION)
.size(16.0) .size(16.0)
.color(Colors::white_or_black(true)) .color(Colors::title(false))
); );
} }

View file

@ -195,36 +195,26 @@ impl WalletsContent {
}); });
}); });
if !list_hidden { egui::CentralPanel::default()
egui::CentralPanel::default() .frame(egui::Frame {
.frame(egui::Frame { stroke: View::item_stroke(),
stroke: View::item_stroke(), fill: Colors::fill_deep(),
fill: Colors::fill_deep(), inner_margin: Margin {
inner_margin: Margin { left: View::far_left_inset_margin(ui) + 4.0,
left: if list_hidden { right: View::far_right_inset_margin(ui) + 4.0,
0.0 top: 4.0,
} else { bottom: View::get_bottom_inset() + 4.0,
View::far_left_inset_margin(ui) + 4.0 },
}, ..Default::default()
right: if list_hidden { })
0.0 .show_inside(ui, |ui| {
} else { // Update ui after 1 sec at single panel mode.
View::far_right_inset_margin(ui) + 4.0 if !dual_panel {
}, ui.ctx().request_repaint_after(Duration::from_millis(1000));
top: 4.0, }
bottom: View::get_bottom_inset() + 4.0, // Show list of wallets.
}, self.wallet_list_ui(ui, cb);
..Default::default() });
})
.show_inside(ui, |ui| {
// Update ui after 1 sec at single panel mode.
if !dual_panel {
ui.ctx().request_repaint_after(Duration::from_millis(1000));
}
// Show list of wallets.
self.wallet_list_ui(ui, cb);
});
}
} }
/// Draw [`TitlePanel`] content. /// Draw [`TitlePanel`] content.