reimplement "update checking" in the form of a simple button that goes to latest release

This commit is contained in:
2025-09-09 14:07:46 +01:00
parent 3322f9582f
commit c2584b5d01
2 changed files with 19 additions and 9 deletions
+18 -9
View File
@@ -221,19 +221,28 @@ impl App {
ui.horizontal(|ui| { ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 0.0; ui.spacing_mut().item_spacing.x = 0.0;
ui.label("with "); ui.label("with ");
ui.style_mut().visuals.hyperlink_color = colours::RED; ui.scope(|ui| {
ui.hyperlink_to("", "https://codeberg.org/futile/gta-tools"); ui.style_mut().visuals.hyperlink_color = colours::RED;
ui.hyperlink_to("", "https://codeberg.org/futile/gta-tools");
});
ui.label(" from "); 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.hyperlink_to("futile", "https://futile.eu");
}); });
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
ui.label(format!( if cfg!(debug_assertions) {
"v{} {}", ui.label("(dev)");
env!("CARGO_PKG_VERSION"), }
if cfg!(debug_assertions) { "(dev)" } else { "" } 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!( ui.add(egui::Image::new(egui::include_image!(
+1
View File
@@ -33,6 +33,7 @@ fn app_creator(
cc.egui_ctx.all_styles_mut(|style| { cc.egui_ctx.all_styles_mut(|style| {
style.spacing.item_spacing = egui::vec2(4.0, 4.0); style.spacing.item_spacing = egui::vec2(4.0, 4.0);
style.interaction.selectable_labels = false; style.interaction.selectable_labels = false;
style.visuals.hyperlink_color = catppuccin_egui::Theme::from(app.settings.theme).text;
}); });
// load any extra fonts that we need // load any extra fonts that we need
let mut fonts = egui::FontDefinitions::default(); let mut fonts = egui::FontDefinitions::default();