diff --git a/images/xvb.png b/images/xvb.png new file mode 100644 index 00000000..eafdb750 Binary files /dev/null and b/images/xvb.png differ diff --git a/src/constants.rs b/src/constants.rs index 3fda878a..37d48284 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -52,6 +52,7 @@ pub const DISTRO_NO_UPDATE: &str = r#"This [Gupax] was compiled for use as a Lin pub const BYTES_ICON: &[u8] = include_bytes!("../images/icons/icon@2x.png"); #[cfg(not(target_os = "macos"))] pub const BYTES_ICON: &[u8] = include_bytes!("../images/icons/icon.png"); +pub const BYTES_XVB: &[u8] = include_bytes!("../images/xvb.png"); pub const BYTES_BANNER: &[u8] = include_bytes!("../images/banner.png"); pub const HORIZONTAL: &str = "--------------------------------------------"; pub const HORI_CONSOLE: &str = "---------------------------------------------------------------------------------------------------------------------------"; diff --git a/src/main.rs b/src/main.rs index aa170ed7..1ae81f79 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2507,7 +2507,7 @@ path_xmr: {:#?}\n ui.set_max_height(max_height); // Display [Gupax] banner let link_width = width/14.0; - ui.add_sized(Vec2::new(width, height*3.0), Image::from_bytes("bytes:/banner.png", BYTES_BANNER)); + ui.add_sized(Vec2::new(width, height*3.0), Image::from_bytes("bytes://banner.png", BYTES_BANNER)); ui.add_sized([width, height], Label::new("is a GUI for mining")); ui.add_sized([link_width, height], Hyperlink::from_label_and_url("[Monero]", "https://www.github.com/monero-project/monero")); ui.add_sized([width, height], Label::new("on")); diff --git a/src/xvb.rs b/src/xvb.rs index ccd1862d..030837d9 100644 --- a/src/xvb.rs +++ b/src/xvb.rs @@ -1,4 +1,25 @@ +use egui::{Hyperlink, Image}; + +use crate::constants::{BYTES_XVB, SPACE}; + impl crate::disk::Xvb { #[inline(always)] // called once - pub fn show(_width: f32, _height: f32, _ctx: &egui::Context, _ui: &mut egui::Ui) {} + pub fn show(width: f32, height: f32, _ctx: &egui::Context, ui: &mut egui::Ui) { + let website_height = height / 10.0; + let width = width - SPACE; + // ui.add_sized( + // [width, website_height], + // Hyperlink::from_label_and_url("XMRvsBeast", "https://xmrvsbeast.com"), + // ); + ui.vertical_centered(|ui| { + ui.add_sized( + [width, website_height], + Image::from_bytes("bytes:/xvb.png", BYTES_XVB), + ); + ui.add_sized( + [width / 8.0, website_height], + Hyperlink::from_label_and_url("XMRvsBeast", "https://xmrvsbeast.com"), + ); + }); + } }