From 90b0b14b49c796c50e71fe83f58d200a8e67d814 Mon Sep 17 00:00:00 2001 From: creating2morrow Date: Tue, 2 Jan 2024 07:47:58 -0500 Subject: [PATCH] modify i2p connectivity styling --- neveko-core/src/monero.rs | 2 +- neveko-gui/src/apps/home.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/neveko-core/src/monero.rs b/neveko-core/src/monero.rs index d06db4a..7269958 100644 --- a/neveko-core/src/monero.rs +++ b/neveko-core/src/monero.rs @@ -1455,7 +1455,7 @@ pub async fn get_block(height: u64) -> reqres::XmrDaemonGetBlockResponse { } } -/// Performs the xmr daemon 'get_block' method for remone daemon +/// Performs the xmr daemon 'get_block' method for remote daemon pub async fn p_get_block(height: u64) -> Result> { info!("fetching proxy block at height: {}", height); let host = utils::get_i2p_http_proxy(); diff --git a/neveko-gui/src/apps/home.rs b/neveko-gui/src/apps/home.rs index 5ce76f7..a2c8036 100644 --- a/neveko-gui/src/apps/home.rs +++ b/neveko-gui/src/apps/home.rs @@ -1,6 +1,7 @@ #![deny(clippy::all)] #![forbid(unsafe_code)] +use egui::{RichText, Color32}; use eframe::egui; use image::Luma; use neveko_core::*; @@ -403,8 +404,12 @@ impl eframe::App for HomeApp { } } let mut str_i2p_status = String::from("offline"); + let mut hover_txt = String::from("http proxy tunnel is closed"); + let mut color = Color32::from_rgb(255, 0, 0); if self.s_i2p_status == i2p::ProxyStatus::Open { str_i2p_status = String::from("online"); + color = Color32::from_rgb(0, 255, 0); + hover_txt = String::from("http proxy tunnel is open but connectivity is not guaranteed"); } if self.connections.is_i2p_advanced { str_i2p_status = String::from("remote proxy"); @@ -413,7 +418,12 @@ impl eframe::App for HomeApp { self.logo_i2p.show(ui); ui.horizontal(|ui| { let i2p_address = i2p::get_destination(None); - ui.label(format!("- status: {}\n- address: {}", str_i2p_status, i2p_address)); + ui.label( + RichText::new(format!("- status: {}\n- address: {}", str_i2p_status, i2p_address)) + .size(16.0) + .color(color), + ).on_hover_text(hover_txt); + }); }); ui.horizontal(|ui| {