Skip to content

Commit

Permalink
run fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Oct 17, 2024
1 parent ab351f4 commit ec92dfe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions src/gui.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use gtk::{prelude::*, Application, ApplicationWindow, Button, FlowBox, Image, ScrolledWindow, gio};
use gtk::{
gio, prelude::*, Application, ApplicationWindow, Button, FlowBox, Image, ScrolledWindow,
};
use shellexpand;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fs;
use std::io::Read;
use std::path::PathBuf;
use std::rc::Rc;
use shellexpand;
use std::io::Read;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};

const CONFIG_FILE: &str = "~/.config/hyprwall/config.ini";
Expand Down Expand Up @@ -84,7 +86,11 @@ pub fn build_ui(app: &Application) {
window.present();
}

fn choose_folder(window: &ApplicationWindow, flowbox: &Rc<RefCell<FlowBox>>, cache: &Arc<Mutex<ImageCache>>) {
fn choose_folder(
window: &ApplicationWindow,
flowbox: &Rc<RefCell<FlowBox>>,
cache: &Arc<Mutex<ImageCache>>,
) {
let dialog = gtk::FileChooserDialog::new(
Some("Change wallpaper folder"),
Some(window),
Expand Down Expand Up @@ -127,7 +133,10 @@ fn load_images(folder: &PathBuf, flowbox: &Rc<RefCell<FlowBox>>, cache: &Arc<Mut
if let Ok(file_type) = entry.file_type() {
if file_type.is_file() {
if let Some(path) = entry.path().to_str() {
if path.ends_with(".png") || path.ends_with(".jpg") || path.ends_with(".jpeg") {
if path.ends_with(".png")
|| path.ends_with(".jpg")
|| path.ends_with(".jpeg")
{
let image = if let Some(cached_image) = cache.get(path) {
cached_image
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mod gui;

use gtk::{prelude::*, Application};
use std::process::Command;
use std::sync::Once;
use lazy_static::lazy_static;
use parking_lot::Mutex;
use std::process::Command;
use std::sync::Once;

lazy_static! {
static ref MONITORS: Mutex<Vec<String>> = Mutex::new(Vec::new());
Expand Down

0 comments on commit ec92dfe

Please sign in to comment.