Skip to content

Commit 7105f90

Browse files
committed
fmt: formatting
1 parent b567ca7 commit 7105f90

File tree

8 files changed

+43
-51
lines changed

8 files changed

+43
-51
lines changed

src/app_state.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
use std::fs;
2-
use std::path::PathBuf;
3-
use std::sync::Arc;
1+
use crate::{
2+
transparency::create_rules_window,
3+
util::Config,
4+
win_utils::{self, create_percentage_window},
5+
window_config::{find_parent_from_child_class, WindowConfig},
6+
TransparencyRule,
7+
};
8+
use std::{fs, path::PathBuf, sync::Arc};
49
use tokio::sync::{broadcast, RwLock};
510

6-
use crate::transparency::create_rules_window;
7-
use crate::util::Config;
8-
use crate::win_utils::{self, create_percentage_window};
9-
use crate::window_config::find_parent_from_child_class;
10-
use crate::window_config::WindowConfig;
11-
use crate::TransparencyRule;
12-
1311
#[derive(Clone)]
1412
pub struct AppState {
1513
config_tx: broadcast::Sender<Config>,

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#![windows_subsystem = "windows"]
22
#![feature(let_chains)]
33
use anyhow::Result;
4+
use app_state::AppState;
5+
use monitor::monitor_windows;
46
use std::sync::Arc;
57
use tokio::sync::mpsc::{self, UnboundedReceiver, UnboundedSender};
6-
8+
use tray::{setup_tray, STARTUP_ID};
9+
use util::{load_config, Message};
10+
use win_utils::{change_startup, get_startup_state};
711
mod app_state;
812
mod monitor;
913
mod transparency;
1014
mod tray;
1115
mod util;
1216
mod win_utils;
1317
mod window_config;
14-
use app_state::AppState;
15-
use monitor::monitor_windows;
16-
use tray::{setup_tray, STARTUP_ID};
17-
use util::{load_config, Message};
18-
use win_utils::{change_startup, get_startup_state};
18+
1919
slint::include_modules!();
2020

2121
#[cfg(target_os = "windows")]

src/monitor.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use crate::{app_state::AppState, util::Config, win_utils::make_window_transparent};
2-
32
use core::time::Duration;
4-
use std::{os::raw::c_void, sync::Arc};
5-
6-
use std::collections::HashMap;
3+
use std::{collections::HashMap, os::raw::c_void, sync::Arc};
74
use windows::Win32::{Foundation::HWND, UI::WindowsAndMessaging::IsWindow};
85
#[derive(Eq, PartialEq, Clone, Debug)]
96
struct WindowHandleState {

src/transparency.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use std::{rc::Rc, sync::Arc};
2-
31
use crate::{app_state::AppState, RulesStorage, RulesWindow, TransparencyRule};
4-
52
use slint::{ComponentHandle, Model, VecModel};
3+
use std::{rc::Rc, sync::Arc};
64

75
/*
86
Creates the rules window, this is so the user can see what rules are currently active.

src/tray.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::get_startup_state;
2-
use crate::util::Message;
1+
use crate::{get_startup_state, util::Message};
32
use tokio::sync::mpsc::UnboundedSender;
43
use tray_item::{IconSource, TIError, TrayItem};
54

src/util.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
use crate::ConfigWindow;
2-
use anyhow::anyhow;
3-
use anyhow::Error;
1+
use crate::{window_config::WindowConfig, ConfigWindow};
2+
use anyhow::{anyhow, Error};
43
use directories::ProjectDirs;
54
use serde::{Deserialize, Serialize};
65
use slint::ComponentHandle;
7-
use std::collections::HashMap;
8-
use std::fs::{self, create_dir_all};
9-
use std::path::PathBuf;
10-
use std::sync::{Arc, Mutex};
11-
use windows::core::{w, PCWSTR};
12-
use windows::Win32::UI::Shell::ShellExecuteW;
13-
14-
use crate::window_config::WindowConfig;
6+
use std::{
7+
collections::HashMap,
8+
fs::{self, create_dir_all},
9+
path::PathBuf,
10+
sync::{Arc, Mutex},
11+
};
12+
use windows::{
13+
core::{w, PCWSTR},
14+
Win32::UI::Shell::ShellExecuteW,
15+
};
1516

1617
#[derive(Clone)]
1718
pub enum Message {

src/win_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
22
app_state::AppState, window_config::WindowConfig, MouseInfo, PercentageInput, PercentageWindow,
33
};
4-
54
use anyhow::{anyhow, Result};
65
use core::time::Duration;
76
use crossbeam_channel::{bounded, Receiver, Sender};

src/window_config.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
use core::ffi::c_void;
2-
use std::path::Path;
3-
41
use crate::{
52
win_utils::{convert_to_full, convert_to_human, make_window_transparent, WindowInfo},
63
TransparencyRule,
74
};
5+
use core::ffi::c_void;
86
use serde::{Deserialize, Serialize};
9-
use windows::core::PCWSTR;
10-
11-
use windows::Win32::{
12-
Foundation::{CloseHandle, BOOL, HWND, LPARAM, MAX_PATH},
13-
System::{
14-
ProcessStatus::GetProcessImageFileNameA,
15-
Threading::{OpenProcess, PROCESS_QUERY_LIMITED_INFORMATION},
16-
},
17-
UI::WindowsAndMessaging::{
18-
EnumChildWindows, EnumWindows, FindWindowExW, FindWindowW, GetClassNameW, GetParent,
19-
GetWindowThreadProcessId,
7+
use std::path::Path;
8+
use windows::{
9+
core::PCWSTR,
10+
Win32::{
11+
Foundation::{CloseHandle, BOOL, HWND, LPARAM, MAX_PATH},
12+
System::{
13+
ProcessStatus::GetProcessImageFileNameA,
14+
Threading::{OpenProcess, PROCESS_QUERY_LIMITED_INFORMATION},
15+
},
16+
UI::WindowsAndMessaging::{
17+
EnumChildWindows, EnumWindows, FindWindowExW, FindWindowW, GetClassNameW, GetParent,
18+
GetWindowThreadProcessId,
19+
},
2020
},
2121
};
2222

0 commit comments

Comments
 (0)