Skip to content

Commit

Permalink
better default filename
Browse files Browse the repository at this point in the history
  • Loading branch information
bryevdv committed Jan 11, 2024
1 parent 634b956 commit 3be2ff1
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 2 deletions.
119 changes: 119 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ eframe = { version = "0.22.0", default-features = false, features = [
image = { version = "0.24", default-features = false, features = ["png"] }
log = "0.4"
rfd = "0.11.0"
chrono = "0.4.31"

serde = { version = "1", features = ["derive"] }
ciborium = { version = "0.2" }
Expand Down
7 changes: 5 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ use std::time::Duration;
#[cfg(not(target_arch = "wasm32"))]
use std::time::Instant;

use chrono::prelude::Local;
use egui::{
Align2, ColorImage, Color32, NumExt, Pos2, Rect, RichText, ScrollArea, Slider, Stroke, TextStyle, Vec2,
Align2, Color32, ColorImage, NumExt, Pos2, Rect, RichText, ScrollArea, Slider, Stroke,
TextStyle, Vec2,
};
use egui_extras::{Column, TableBuilder};
#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -2285,7 +2287,8 @@ impl eframe::App for ProfApp {
}

if let Some(screenshot) = self.screenshot.take() {
if let Some(mut path) = rfd::FileDialog::new().save_file() {
let filename = format!("Legion Prof {}", Local::now().format("%F-%H-%M-%S"));
if let Some(mut path) = rfd::FileDialog::new().set_file_name(&filename).save_file() {

Check failure on line 2291 in src/app.rs

View workflow job for this annotation

GitHub Actions / Check wasm32

failed to resolve: could not find `FileDialog` in `rfd`
path.set_extension("png");
image::save_buffer(
&path,
Expand Down

0 comments on commit 3be2ff1

Please sign in to comment.