From c2584b5d0183804327b7f9d95396b8d1ed4b5f7e Mon Sep 17 00:00:00 2001 From: futile Date: Tue, 9 Sep 2025 14:07:46 +0100 Subject: [PATCH] reimplement "update checking" in the form of a simple button that goes to latest release --- src/gui/app.rs | 27 ++++++++++++++++++--------- src/gui/run.rs | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/gui/app.rs b/src/gui/app.rs index 34d52c3..ebc7e55 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -221,19 +221,28 @@ impl App { ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 0.0; ui.label("with "); - ui.style_mut().visuals.hyperlink_color = colours::RED; - ui.hyperlink_to("❤", "https://codeberg.org/futile/gta-tools"); + ui.scope(|ui| { + ui.style_mut().visuals.hyperlink_color = colours::RED; + ui.hyperlink_to("❤", "https://codeberg.org/futile/gta-tools"); + }); ui.label(" from "); - ui.style_mut().visuals.hyperlink_color = - catppuccin_egui::Theme::from(self.settings.theme).text; ui.hyperlink_to("futile", "https://futile.eu"); }); ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { - ui.label(format!( - "v{} {}", - env!("CARGO_PKG_VERSION"), - if cfg!(debug_assertions) { "(dev)" } else { "" } - )); + if cfg!(debug_assertions) { + ui.label("(dev)"); + } + ui.label(format!("v{}", env!("CARGO_PKG_VERSION"))); + ui.scope(|ui| { + ui.style_mut().spacing.button_padding = egui::Vec2::new(3.0, 0.0); + let button = ui + .button("⬇") + .on_hover_text("Go to current latest version."); + if button.clicked() { + let _ = + open::that("https://codeberg.org/futile/gta-tools/releases/latest"); + } + }); }); }); ui.add(egui::Image::new(egui::include_image!( diff --git a/src/gui/run.rs b/src/gui/run.rs index 7ead6a4..3e32f82 100644 --- a/src/gui/run.rs +++ b/src/gui/run.rs @@ -33,6 +33,7 @@ fn app_creator( cc.egui_ctx.all_styles_mut(|style| { style.spacing.item_spacing = egui::vec2(4.0, 4.0); style.interaction.selectable_labels = false; + style.visuals.hyperlink_color = catppuccin_egui::Theme::from(app.settings.theme).text; }); // load any extra fonts that we need let mut fonts = egui::FontDefinitions::default();