Revert native_dialog to 0.6

This commit is contained in:
Rémi BERTHO 2023-11-06 22:14:45 +01:00
parent 3f366c4e31
commit b6b1b8eeed
Signed by: dalan
GPG Key ID: EE3B917931C07B64
3 changed files with 707 additions and 594 deletions

1296
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ anyhow = "1.0"
log = "0.4"
simplelog = "0.12"
wry = "0.34"
native-dialog = "0.7"
native-dialog = "0.6"
rust-embed = "8"
directories = "5"
clap = "4"

View File

@ -82,18 +82,19 @@ fn main() -> Result<()> {
const MAX_IMG_SIZE: u32 = 20_000_000;
info!("Image size {} * {}", width, height);
let img_data_path = if height * width > MAX_IMG_SIZE {
// @todo utilisation de rfd au lieu de message_dialog
// @todo Option pas de resize / taille en ligne de commande
// @todo Option pas de resize / taille dans une config (confy)
// @todo Demande ensergistre laction la première fois
// @todo Option always en ligne de commnade
// @todo Icon
// @todo no dialog with v0.7
let ratio = (height * width) as f64 / MAX_IMG_SIZE as f64;
let new_height = (height as f64 / ratio.sqrt()) as u32;
let new_width = (width as f64 / ratio.sqrt()) as u32;
if MessageDialog::new()
.set_title("Resize")
.set_type(native_dialog::MessageType::Info)
.set_text(&format!(
"Resize the file to {} × {}",
new_width, new_height