diff --git a/locales/en.yml b/locales/en.yml index 4ee0638..f19bb82 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -3,7 +3,7 @@ screen_accounts: network: self: Network node: Integrated node - metrics: Chain metrics + metrics: Metrics mining: Mining settings: Node settings enable_node: Enable node @@ -47,7 +47,7 @@ network_node: size: Size (GB) peers: Peers network_metrics: - loading: Chain metrics will be available after the synchronization + loading: Metrics will be available after the synchronization emission: Emission inflation: Inflation supply: Supply diff --git a/locales/ru.yml b/locales/ru.yml index 307f6e8..213ec9a 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -3,7 +3,7 @@ screen_accounts: network: self: Сеть node: Встроенный узел - metrics: Показатели цепи + metrics: Показатели mining: Майнинг settings: Настройки узла enable_node: Включить узел @@ -47,7 +47,7 @@ network_node: size: Размер (ГБ) peers: Пиры network_metrics: - loading: Показатели цепи будут доступны после синхронизации + loading: Показатели будут доступны после синхронизации emission: Эмиссия inflation: Инфляция supply: Предложение diff --git a/src/gui/views/network/container.rs b/src/gui/views/network/container.rs index 557bbea..5813d59 100644 --- a/src/gui/views/network/container.rs +++ b/src/gui/views/network/container.rs @@ -149,7 +149,12 @@ impl NetworkContainer { egui::CentralPanel::default() .frame(egui::Frame { stroke: View::DEFAULT_STROKE, - inner_margin: Margin::same(4.0), + inner_margin: Margin { + left: 4.0, + right: 4.0, + top: 3.0, + bottom: 4.0, + }, fill: Colors::WHITE, ..Default::default() }) @@ -229,15 +234,16 @@ impl NetworkContainer { fn title_text_ui(&self, builder: StripBuilder) { builder .size(Size::remainder()) - .size(Size::exact(32.0)) + .size(Size::exact(30.0)) .vertical(|mut strip| { strip.cell(|ui| { - ui.add_space(2.0); + ui.add_space(3.0); ui.vertical_centered(|ui| { ui.label(RichText::new(self.current_tab.get_type().name().to_uppercase()) .size(18.0) .color(Colors::TITLE)); }); + ui.add_space(1.0); }); strip.cell(|ui| { ui.centered_and_justified(|ui| { diff --git a/src/gui/views/views.rs b/src/gui/views/views.rs index 6c4b598..8c9d307 100644 --- a/src/gui/views/views.rs +++ b/src/gui/views/views.rs @@ -78,9 +78,15 @@ impl View { /// Title button with transparent background fill color, contains only icon. pub fn title_button(ui: &mut egui::Ui, icon: &str, action: impl FnOnce()) { ui.scope(|ui| { - // Disable stroke around title buttons on hover + // Disable stroke around title buttons on click. ui.style_mut().visuals.widgets.active.bg_stroke = Stroke::NONE; + // Disable rounding on hover. + ui.style_mut().visuals.widgets.hovered.rounding = Rounding::none(); + // Disable stroke color on hover. + ui.style_mut().visuals.widgets.hovered.bg_stroke = Self::DEFAULT_STROKE; + // Setup text. let wt = RichText::new(icon.to_string()).size(24.0).color(Colors::TITLE); + // Draw button. let br = Button::new(wt) .fill(Colors::TRANSPARENT) .ui(ui); diff --git a/src/lib.rs b/src/lib.rs index 92389d4..3616cc1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,6 +21,7 @@ use winit::platform::android::activity::AndroidApp; pub use settings::{AppConfig, Settings}; use crate::gui::{App, PlatformApp}; +use crate::gui::platform::PlatformCallbacks; use crate::node::Node; i18n!("locales"); @@ -59,7 +60,7 @@ fn android_main(app: AndroidApp) { } pub fn app_creator(app: PlatformApp) -> eframe::AppCreator - where PlatformApp: eframe::App { + where PlatformApp: eframe::App, T: PlatformCallbacks { Box::new(|cc| { App::setup_visuals(&cc.egui_ctx); App::setup_fonts(&cc.egui_ctx); @@ -71,6 +72,7 @@ pub fn app_creator(app: PlatformApp) -> eframe::AppCreator pub fn start(mut options: eframe::NativeOptions, app_creator: eframe::AppCreator) { options.default_theme = eframe::Theme::Light; options.renderer = eframe::Renderer::Wgpu; + options.initial_window_size = Some(egui::Vec2::new(1200.0, 720.0)); setup_i18n();