code: Reformat with Rust 2024 edition
This commit is contained in:
parent
2a8a13fd01
commit
4439499cda
15 changed files with 30 additions and 29 deletions
|
|
@ -19,6 +19,6 @@ mod glycin_proxy;
|
|||
mod svg;
|
||||
|
||||
pub use glycin_proxy::Glycin;
|
||||
pub use svg::{Svg, RSVG_MAX_SIZE};
|
||||
pub use svg::{RSVG_MAX_SIZE, Svg};
|
||||
|
||||
use super::{DecoderUpdate, UpdateSender};
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ use async_channel as mpsc;
|
|||
use gtk::prelude::*;
|
||||
|
||||
use super::*;
|
||||
use crate::decoder::tiling::SharedFrameBuffer;
|
||||
use crate::decoder::TileRequest;
|
||||
use crate::decoder::tiling::SharedFrameBuffer;
|
||||
use crate::deps::*;
|
||||
use crate::metadata::Metadata;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ impl OperationsSnapshot {
|
|||
if let Err(err) = operation_result {
|
||||
match err {
|
||||
OperationError::EmptyNode => {
|
||||
return Err(EditingError::EmptyNode(operation.clone()))
|
||||
return Err(EditingError::EmptyNode(operation.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ use std::time::Instant;
|
|||
use anyhow::Context;
|
||||
use gio::prelude::*;
|
||||
use gio::subclass::prelude::*;
|
||||
use glib::subclass::Signal;
|
||||
use glib::GString;
|
||||
use glib::subclass::Signal;
|
||||
use indexmap::IndexMap;
|
||||
|
||||
use crate::deps::*;
|
||||
|
|
@ -124,9 +124,11 @@ mod imp {
|
|||
impl ObjectImpl for LpFileModel {
|
||||
fn signals() -> &'static [Signal] {
|
||||
static SIGNALS: LazyLock<Vec<Signal>> = LazyLock::new(|| {
|
||||
vec![Signal::builder("changed")
|
||||
.param_types([glib::Type::VARIANT])
|
||||
.build()]
|
||||
vec![
|
||||
Signal::builder("changed")
|
||||
.param_types([glib::Type::VARIANT])
|
||||
.build(),
|
||||
]
|
||||
});
|
||||
SIGNALS.as_ref()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use std::fmt::{Debug, Write};
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use anyhow::{anyhow, bail, Context};
|
||||
use anyhow::{Context, anyhow, bail};
|
||||
use gio::prelude::*;
|
||||
|
||||
use crate::deps::*;
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ use glycin::{Operation, Operations};
|
|||
|
||||
use crate::deps::*;
|
||||
use crate::editing::preview::EditingError;
|
||||
use crate::util::ErrorType;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::root::ParentWindow;
|
||||
use crate::util::ErrorType;
|
||||
use crate::widgets::edit::LpEditCropSelection;
|
||||
use crate::widgets::LpImage;
|
||||
use crate::widgets::edit::LpEditCropSelection;
|
||||
|
||||
/// Aspect ratio modes that can be selected
|
||||
#[derive(Debug, Clone, Copy, Default, glib::Enum, glib::Variant)]
|
||||
|
|
|
|||
|
|
@ -377,11 +377,7 @@ mod imp {
|
|||
aspect_ratio,
|
||||
);
|
||||
|
||||
if u.area() > v.area() {
|
||||
u
|
||||
} else {
|
||||
v
|
||||
}
|
||||
if u.area() > v.area() { u } else { v }
|
||||
}
|
||||
} else {
|
||||
imp.new_crop_area_aspect_free(&resize, coord)
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ use adw::prelude::*;
|
|||
use adw::subclass::prelude::*;
|
||||
use glycin::Operations;
|
||||
|
||||
use super::edit::LpEditCrop;
|
||||
use super::LpImage;
|
||||
use super::edit::LpEditCrop;
|
||||
use crate::deps::*;
|
||||
use crate::util::ErrorType;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::root::ParentWindow;
|
||||
use crate::util::ErrorType;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ use adw::subclass::prelude::*;
|
|||
use gtk::CompositeTemplate;
|
||||
|
||||
use crate::deps::*;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::ErrorType;
|
||||
use crate::util::gettext::*;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ use glib::subclass::Signal;
|
|||
use glib::{Properties, SignalGroup};
|
||||
use gufo_common::orientation::Orientation;
|
||||
|
||||
use crate::decoder::{self, tiling, Decoder, DecoderUpdate};
|
||||
use crate::decoder::{self, Decoder, DecoderUpdate, tiling};
|
||||
use crate::deps::*;
|
||||
use crate::metadata::Metadata;
|
||||
use crate::util::Gesture;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ impl imp::LpImage {
|
|||
self.file.replace(Some(new_file.clone()));
|
||||
self.reload_file_info().await;
|
||||
|
||||
// Reload if file extension changed since other decoding path might be responsible
|
||||
// now
|
||||
// Reload if file extension changed since other decoding path might be
|
||||
// responsible now
|
||||
if old_filename_ext != new_filename_ext {
|
||||
obj.load(new_file).await;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,9 @@ impl WidgetImpl for imp::LpImage {
|
|||
log::trace!("Small monitor detected: Using {SMALL_OCCUPY_SCREEN} screen area");
|
||||
SMALL_OCCUPY_SCREEN
|
||||
} else {
|
||||
log::trace!("Sufficiently large monitor detected: Using {DEFAULT_OCCUPY_SCREEN} screen area");
|
||||
log::trace!(
|
||||
"Sufficiently large monitor detected: Using {DEFAULT_OCCUPY_SCREEN} screen area"
|
||||
);
|
||||
DEFAULT_OCCUPY_SCREEN
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@
|
|||
//! This widget also handles showing the context menu.
|
||||
|
||||
use adw::subclass::prelude::*;
|
||||
use glib::{clone, Properties};
|
||||
use gtk::prelude::*;
|
||||
use glib::{Properties, clone};
|
||||
use gtk::CompositeTemplate;
|
||||
use gtk::prelude::*;
|
||||
|
||||
use super::LpErrorDetails;
|
||||
use crate::decoder::DecoderError;
|
||||
use crate::deps::*;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::ErrorType;
|
||||
use crate::util::gettext::*;
|
||||
use crate::widgets::LpImage;
|
||||
|
||||
mod imp {
|
||||
|
|
@ -225,7 +225,8 @@ impl LpImagePage {
|
|||
// Translators: {} is replaced with a version number
|
||||
let message = gettext_f(
|
||||
"No image loaders available. Maybe the “glycin-loaders” package with compatibility version “{}” is not installed.",
|
||||
[ format!("{}+", glycin::COMPAT_VERSION)]);
|
||||
[format!("{}+", glycin::COMPAT_VERSION)],
|
||||
);
|
||||
|
||||
imp.error_page.set_description(Some(&message));
|
||||
imp.stack.set_visible_child(&*imp.error_page);
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ use std::marker::PhantomData;
|
|||
use adw::prelude::*;
|
||||
use adw::subclass::prelude::*;
|
||||
use anyhow::Context;
|
||||
use ashpd::desktop::{wallpaper, ResponseError};
|
||||
use ashpd::desktop::{ResponseError, wallpaper};
|
||||
use ashpd::{Error, WindowIdentifier};
|
||||
use glib::translate::IntoGlib;
|
||||
use glib::{clone, Properties};
|
||||
use glib::{Properties, clone};
|
||||
use gtk::CompositeTemplate;
|
||||
|
||||
use crate::decoder::DecoderError;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ use std::cell::{OnceCell, RefCell};
|
|||
|
||||
use adw::prelude::*;
|
||||
use adw::subclass::prelude::*;
|
||||
use glib::translate::IntoGlib;
|
||||
use glib::Properties;
|
||||
use glib::translate::IntoGlib;
|
||||
use gtk::CompositeTemplate;
|
||||
|
||||
use crate::deps::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue