desktop: Add much more info to About dialog

This commit is contained in:
Nathan Adams 2023-05-22 22:13:50 +02:00
parent 01e33d82c9
commit 7d7edec08c
4 changed files with 62 additions and 5 deletions

1
Cargo.lock generated
View File

@ -3719,6 +3719,7 @@ dependencies = [
"anyhow", "anyhow",
"arboard", "arboard",
"bytemuck", "bytemuck",
"chrono",
"clap", "clap",
"cpal", "cpal",
"dirs", "dirs",

View File

@ -34,6 +34,7 @@ unic-langid = "0.9.1"
sys-locale = "0.3.0" sys-locale = "0.3.0"
wgpu = { version = "0.16.0" } wgpu = { version = "0.16.0" }
futures = "0.3.28" futures = "0.3.28"
chrono = { version = "0.4", default-features = false, features = [] }
# Deliberately held back to match tracy client used by profiling crate # Deliberately held back to match tracy client used by profiling crate
tracing-tracy = { version = "=0.10.0", optional = true } tracing-tracy = { version = "=0.10.0", optional = true }

View File

@ -5,9 +5,11 @@ use vergen::EmitBuilder;
fn main() -> Result<(), Box<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
// Emit version info, and "rerun-if-changed" for relevant files, including build.rs // Emit version info, and "rerun-if-changed" for relevant files, including build.rs
EmitBuilder::builder() EmitBuilder::builder()
.all_build() .build_timestamp()
.all_cargo() .cargo_features()
.all_git() .git_sha(false)
.git_commit_timestamp()
.git_commit_date()
.emit()?; .emit()?;
// Embed resource file w/ icon on windows // Embed resource file w/ icon on windows

View File

@ -2,6 +2,7 @@ mod controller;
mod movie; mod movie;
use crate::custom_event::RuffleEvent; use crate::custom_event::RuffleEvent;
use chrono::DateTime;
use egui::*; use egui::*;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use winit::event_loop::EventLoopProxy; use winit::event_loop::EventLoopProxy;
@ -160,9 +161,61 @@ impl RuffleGui {
ui.label( ui.label(
RichText::new("Ruffle") RichText::new("Ruffle")
.color(Color32::from_rgb(0xFF, 0xAD, 0x33)) .color(Color32::from_rgb(0xFF, 0xAD, 0x33))
.size(24.0), .size(32.0),
); );
ui.label(crate::RUFFLE_VERSION); Grid::new("about_ruffle_version_info")
.striped(true)
.show(ui, |ui| {
ui.label("Version");
ui.label(env!("CARGO_PKG_VERSION"));
ui.end_row();
ui.label("Channel");
ui.label(env!("CFG_RELEASE_CHANNEL"));
ui.end_row();
ui.label("Build Time");
ui.label(
DateTime::parse_from_rfc3339(env!("VERGEN_BUILD_TIMESTAMP"))
.map(|t| t.format("%c").to_string())
.unwrap_or_else(|_| env!("VERGEN_BUILD_TIMESTAMP").to_string()),
);
ui.end_row();
ui.label("Commit ref");
ui.hyperlink_to(
env!("VERGEN_GIT_SHA"),
format!(
"https://github.com/ruffle-rs/ruffle/commit/{}",
env!("VERGEN_GIT_SHA")
),
);
ui.end_row();
ui.label("Commit date");
ui.label(
DateTime::parse_from_rfc3339(env!("VERGEN_GIT_COMMIT_TIMESTAMP"))
.map(|t| t.format("%c").to_string())
.unwrap_or_else(|_| {
env!("VERGEN_GIT_COMMIT_TIMESTAMP").to_string()
}),
);
ui.end_row();
ui.label("Build Features");
ui.horizontal_wrapped(|ui| {
ui.label(env!("VERGEN_CARGO_FEATURES").replace(',', ", "));
});
ui.end_row();
});
ui.horizontal(|ui| {
ui.hyperlink_to("Website", "https://ruffle.rs");
ui.hyperlink_to("Github", "https://github.com/ruffle-rs/ruffle/");
ui.hyperlink_to("Discord", "https://discord.gg/ruffle");
ui.hyperlink_to("Sponsor", "https://opencollective.com/ruffle/");
ui.shrink_width_to_current();
});
}) })
}); });
} }