ui: fix network content paddings and panel width

This commit is contained in:
ardocrat 2023-08-11 04:23:06 +03:00
parent 1261e3ef30
commit 588fb31fa5
3 changed files with 7 additions and 5 deletions

View file

@ -84,6 +84,8 @@ impl ConnectionsContent {
// Draw modal content for current ui container. // Draw modal content for current ui container.
self.current_modal_ui(ui, frame, cb); self.current_modal_ui(ui, frame, cb);
ui.add_space(2.0);
// Show network type selection. // Show network type selection.
let saved_chain_type = AppConfig::chain_type(); let saved_chain_type = AppConfig::chain_type();
NodeSetup::chain_type_ui(ui); NodeSetup::chain_type_ui(ui);
@ -184,7 +186,7 @@ impl ConnectionsContent {
cb: &dyn PlatformCallbacks) { cb: &dyn PlatformCallbacks) {
// Setup layout size. // Setup layout size.
let mut rect = ui.available_rect_before_wrap(); let mut rect = ui.available_rect_before_wrap();
rect.set_height(53.0); rect.set_height(52.0);
// Draw round background. // Draw round background.
let bg_rect = rect.clone(); let bg_rect = rect.clone();
@ -306,7 +308,7 @@ impl ConnectionsContent {
// Show error when specified URL is not valid. // Show error when specified URL is not valid.
if self.ext_node_url_error { if self.ext_node_url_error {
ui.add_space(12.0); ui.add_space(2.0);
ui.label(RichText::new(t!("wallets.invalid_url")) ui.label(RichText::new(t!("wallets.invalid_url"))
.size(17.0) .size(17.0)
.color(Colors::RED)); .color(Colors::RED));

View file

@ -134,7 +134,7 @@ impl NetworkContent {
let mut rect = ui.available_rect_before_wrap(); let mut rect = ui.available_rect_before_wrap();
let mut width = ui.available_width(); let mut width = ui.available_width();
if !Root::is_dual_panel_mode(frame) { if !Root::is_dual_panel_mode(frame) {
width = f32::min(width, Root::SIDE_PANEL_WIDTH * 1.3) width = f32::min(width, Root::SIDE_PANEL_WIDTH * 1.4)
} }
rect.set_width(width); rect.set_width(width);

View file

@ -105,10 +105,11 @@ impl NodeSetup {
View::sub_title(ui, format!("{} {}", COMPUTER_TOWER, t!("network_settings.server"))); View::sub_title(ui, format!("{} {}", COMPUTER_TOWER, t!("network_settings.server")));
View::horizontal_line(ui, Colors::STROKE); View::horizontal_line(ui, Colors::STROKE);
ui.add_space(4.0); ui.add_space(6.0);
// Show chain type setup. // Show chain type setup.
Self::chain_type_ui(ui); Self::chain_type_ui(ui);
ui.add_space(2.0);
// Show loading indicator or controls to stop/start/restart node. // Show loading indicator or controls to stop/start/restart node.
if Node::is_stopping() || Node::is_restarting() || Node::is_starting() { if Node::is_stopping() || Node::is_restarting() || Node::is_starting() {
@ -221,7 +222,6 @@ impl NodeSetup {
/// Draw [`ChainTypes`] setup content. /// Draw [`ChainTypes`] setup content.
pub fn chain_type_ui(ui: &mut egui::Ui) { pub fn chain_type_ui(ui: &mut egui::Ui) {
ui.add_space(1.0);
ui.vertical_centered(|ui| { ui.vertical_centered(|ui| {
ui.label(RichText::new(t!("network.type")).size(16.0).color(Colors::GRAY)); ui.label(RichText::new(t!("network.type")).size(16.0).color(Colors::GRAY));
}); });