diff --git a/src/gui/app.rs b/src/gui/app.rs index 955a86f..581045f 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -105,7 +105,7 @@ impl App { sw: 0.0, se: 0.0, }, - fill: Colors::TRANSPARENT, + fill: Colors::yellow(), stroke: Stroke { width: 1.0, color: egui::Color32::from_gray(200) @@ -126,7 +126,7 @@ impl App { let content_stroke = RectShape { rect: content_stroke_rect, rounding: Rounding::ZERO, - fill: Colors::TRANSPARENT, + fill: Colors::fill(), stroke: Stroke { width: 1.0, color: Colors::stroke() diff --git a/src/gui/views/network/content.rs b/src/gui/views/network/content.rs index cd29b9b..54dd3ca 100644 --- a/src/gui/views/network/content.rs +++ b/src/gui/views/network/content.rs @@ -79,19 +79,11 @@ impl NetworkContent { .resizable(false) .exact_width(ui.available_width()) .frame(egui::Frame { - outer_margin: if !show_connections { - Margin { - left: -0.5, - right: if !dual_panel { - -0.5 - } else { - 0.0 - }, - top: 0.0, - bottom: 0.0, - } - } else { - Margin::ZERO + outer_margin: Margin { + left: -0.5, + right: -0.5, + top: 0.0, + bottom: 0.0, }, ..Default::default() }) @@ -116,59 +108,61 @@ impl NetworkContent { // Show connections content. egui::CentralPanel::default() .frame(egui::Frame { - stroke: View::item_stroke(), outer_margin: if show_connections { Margin { left: -0.5, - right: if !dual_panel { - -0.5 - } else { - 0.0 - }, + right: -0.5, top: 0.0, bottom: -0.5, } } else { Margin::ZERO }, - inner_margin: Margin { - left: if show_connections { - View::get_left_inset() + 4.0 - } else { - 0.0 - }, - right: if show_connections { - View::far_right_inset_margin(ui) + 4.0 - } else { - 0.0 - }, - top: 3.0, - bottom: if View::is_desktop() && show_connections { - 6.0 - } else { - 4.0 - }, - }, - fill: Colors::button(), ..Default::default() }) .show_inside(ui, |ui| { - ScrollArea::vertical() - .id_source("connections_content") - .scroll_bar_visibility(ScrollBarVisibility::AlwaysHidden) - .auto_shrink([false; 2]) - .show(ui, |ui| { - ui.add_space(1.0); - ui.vertical_centered(|ui| { - let max_width = if !dual_panel { - Root::SIDE_PANEL_WIDTH * 1.3 + egui::CentralPanel::default() + .frame(egui::Frame { + stroke: View::item_stroke(), + inner_margin: Margin { + left: if show_connections { + View::get_left_inset() + 4.0 } else { - ui.available_width() - }; - View::max_width_ui(ui, max_width, |ui| { - self.connections.ui(ui, cb); + 0.0 + }, + right: if show_connections { + View::far_right_inset_margin(ui) + 4.0 + } else { + 0.0 + }, + top: 3.0, + bottom: if View::is_desktop() && show_connections { + 6.0 + } else { + 4.0 + }, + }, + fill: Colors::fill(), + ..Default::default() + }) + .show_inside(ui, |ui| { + ScrollArea::vertical() + .id_source("connections_content") + .scroll_bar_visibility(ScrollBarVisibility::AlwaysHidden) + .auto_shrink([false; 2]) + .show(ui, |ui| { + ui.add_space(1.0); + ui.vertical_centered(|ui| { + let max_width = if !dual_panel { + Root::SIDE_PANEL_WIDTH * 1.3 + } else { + ui.available_width() + }; + View::max_width_ui(ui, max_width, |ui| { + self.connections.ui(ui, cb); + }); + }); }); - }); }); }); diff --git a/src/gui/views/root.rs b/src/gui/views/root.rs index e7fa303..0e7701a 100644 --- a/src/gui/views/root.rs +++ b/src/gui/views/root.rs @@ -111,23 +111,19 @@ impl Root { let (is_panel_open, panel_width) = Self::network_panel_state_width(ui, dual_panel); // Show network content. - if is_panel_open { - egui::SidePanel::left("network_panel") - .resizable(false) - .exact_width(panel_width) - .frame(egui::Frame { - fill: Colors::fill(), - ..Default::default() - }) - .show_inside(ui, |ui| { - self.network.ui(ui, cb); - }); - } + egui::SidePanel::left("network_panel") + .resizable(false) + .exact_width(panel_width) + .frame(egui::Frame { + ..Default::default() + }) + .show_animated_inside(ui, is_panel_open, |ui| { + self.network.ui(ui, cb); + }); // Show wallets content. egui::CentralPanel::default() .frame(egui::Frame { - fill: Colors::fill(), ..Default::default() }) .show_inside(ui, |ui| { diff --git a/src/gui/views/wallets/content.rs b/src/gui/views/wallets/content.rs index 6bffb42..eb7ae97 100644 --- a/src/gui/views/wallets/content.rs +++ b/src/gui/views/wallets/content.rs @@ -206,20 +206,6 @@ impl WalletsContent { egui::Frame::default() } else { egui::Frame { - outer_margin: Margin { - left: if !root_dual_panel { - -0.5 - } else { - 0.0 - }, - right: if !wallet_panel_opened { - -0.5 - } else { - 0.0 - }, - top: 0.0, - bottom: 0.0, - }, stroke: View::item_stroke(), fill: Colors::fill_deep(), inner_margin: Margin { @@ -228,6 +214,16 @@ impl WalletsContent { top: 3.0, bottom: 4.0, }, + outer_margin: Margin { + left: 0.0, + right: if !wallet_panel_opened { + -0.5 + } else { + 0.0 + }, + top: 0.0, + bottom: 0.0, + }, ..Default::default() } }) diff --git a/src/gui/views/wallets/creation/creation.rs b/src/gui/views/wallets/creation/creation.rs index 91681c5..e3651b8 100644 --- a/src/gui/views/wallets/creation/creation.rs +++ b/src/gui/views/wallets/creation/creation.rs @@ -79,20 +79,6 @@ impl WalletCreation { top: 4.0, bottom: View::get_bottom_inset(), }, - outer_margin: if View::is_desktop() { - Margin { - left: if !Root::is_dual_panel_mode(ui) { - -0.5 - } else { - 0.0 - }, - right: -0.5, - top: 0.0, - bottom: -0.5, - } - } else { - Margin::ZERO - }, ..Default::default() }) .show_inside(ui, |ui| { diff --git a/src/gui/views/wallets/wallet/content.rs b/src/gui/views/wallets/wallet/content.rs index c8e6b0c..6a90ec6 100644 --- a/src/gui/views/wallets/wallet/content.rs +++ b/src/gui/views/wallets/wallet/content.rs @@ -103,11 +103,7 @@ impl WalletContent { bottom: 0.0, }, outer_margin: Margin { - left: if !dual_panel { - -0.5 - } else { - 0.0 - }, + left: -0.5, right: -0.5, top: 0.0, bottom: if dual_panel { @@ -156,11 +152,7 @@ impl WalletContent { egui::CentralPanel::default() .frame(egui::Frame { outer_margin: Margin { - left: if !dual_panel { - -0.5 - } else { - 0.0 - }, + left: -0.5, right: -0.5, top: 0.0, bottom: 0.0, diff --git a/src/main.rs b/src/main.rs index e25795a..457ba0d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![windows_subsystem = "windows"] + +use egui::os::OperatingSystem; + pub fn main() { #[allow(dead_code)] #[cfg(not(target_os = "android"))] @@ -74,17 +78,27 @@ fn real_main() { viewport, ..Default::default() }; - options.renderer = eframe::Renderer::Wgpu; + + // Use Glow renderer for Windows. + let is_windows = OperatingSystem::from_target_os() == OperatingSystem::Windows; + options.renderer = if is_windows { + eframe::Renderer::Glow + } else { + eframe::Renderer::Wgpu + }; match grim::start(options.clone(), grim::app_creator(App::new(platform.clone()))) { Ok(_) => {} - Err(_) => { - // Start with Glow renderer on error. + Err(e) => { + if is_windows { + panic!("{}", e); + } + // Start with another renderer on error. options.renderer = eframe::Renderer::Glow; match grim::start(options, grim::app_creator(App::new(platform))) { Ok(_) => {} - Err(_) => { - panic!("Impossible to render"); + Err(e) => { + panic!("{}", e); } } }