From eaefb76ce725802d9ad0e63935023bafefbbc258 Mon Sep 17 00:00:00 2001 From: candle Date: Sat, 26 Jul 2025 11:52:10 -0400 Subject: [PATCH] formatting --- src/ui/constants.rs | 2 +- src/ui/preferences_window.rs | 8 ++++---- src/ui/shortcuts_window.rs | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ui/constants.rs b/src/ui/constants.rs index c8dd319..e980900 100644 --- a/src/ui/constants.rs +++ b/src/ui/constants.rs @@ -23,4 +23,4 @@ pub const DEFAULT_FONT_SIZE_STR: &str = "14"; pub const PREVIEW_AREA_MAX_HEIGHT: f32 = 150.0; -pub const INNER_MARGIN: i8 = 8; \ No newline at end of file +pub const INNER_MARGIN: i8 = 8; diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs index b2f94d6..9f40ed6 100644 --- a/src/ui/preferences_window.rs +++ b/src/ui/preferences_window.rs @@ -5,10 +5,10 @@ use eframe::egui; pub(crate) fn preferences_window(app: &mut TextEditor, ctx: &egui::Context) { let visuals = &ctx.style().visuals; let screen_rect = ctx.screen_rect(); - let window_width = (screen_rect.width() * WINDOW_WIDTH_RATIO) - .clamp(WINDOW_MIN_WIDTH, WINDOW_MAX_WIDTH); - let window_height = (screen_rect.height() * WINDOW_HEIGHT_RATIO) - .clamp(WINDOW_MIN_HEIGHT, WINDOW_MAX_HEIGHT); + let window_width = + (screen_rect.width() * WINDOW_WIDTH_RATIO).clamp(WINDOW_MIN_WIDTH, WINDOW_MAX_WIDTH); + let window_height = + (screen_rect.height() * WINDOW_HEIGHT_RATIO).clamp(WINDOW_MIN_HEIGHT, WINDOW_MAX_HEIGHT); let max_size = egui::Vec2::new(window_width, window_height); egui::Window::new("Preferences") diff --git a/src/ui/shortcuts_window.rs b/src/ui/shortcuts_window.rs index d4ee8b4..560baf3 100644 --- a/src/ui/shortcuts_window.rs +++ b/src/ui/shortcuts_window.rs @@ -4,7 +4,11 @@ use eframe::egui; fn render_shortcuts_content(ui: &mut egui::Ui) { ui.vertical_centered(|ui| { - ui.label(egui::RichText::new("Navigation").size(UI_HEADER_SIZE).strong()); + ui.label( + egui::RichText::new("Navigation") + .size(UI_HEADER_SIZE) + .strong(), + ); ui.label(egui::RichText::new("Ctrl + N: New").size(UI_TEXT_SIZE)); ui.label(egui::RichText::new("Ctrl + O: Open").size(UI_TEXT_SIZE)); ui.label(egui::RichText::new("Ctrl + S: Save").size(UI_TEXT_SIZE)); @@ -31,7 +35,9 @@ fn render_shortcuts_content(ui: &mut egui::Ui) { ui.separator(); ui.label(egui::RichText::new("Views").size(UI_HEADER_SIZE).strong()); ui.label(egui::RichText::new("Ctrl + L: Toggle Line Numbers").size(UI_TEXT_SIZE)); - ui.label(egui::RichText::new("Ctrl + Shift + L: Change Line Number Side").size(UI_TEXT_SIZE)); + ui.label( + egui::RichText::new("Ctrl + Shift + L: Change Line Number Side").size(UI_TEXT_SIZE), + ); ui.label(egui::RichText::new("Ctrl + K: Toggle Word Wrap").size(UI_TEXT_SIZE)); ui.label(egui::RichText::new("Ctrl + H: Toggle Auto Hide Toolbar").size(UI_TEXT_SIZE)); ui.label(egui::RichText::new("Ctrl + P: Preferences").size(UI_TEXT_SIZE)); @@ -54,8 +60,10 @@ pub(crate) fn shortcuts_window(app: &mut TextEditor, ctx: &egui::Context) { let visuals = &ctx.style().visuals; let screen_rect = ctx.screen_rect(); - let window_width = (screen_rect.width() * WINDOW_WIDTH_RATIO).clamp(WINDOW_MIN_WIDTH, WINDOW_MAX_WIDTH); - let window_height = (screen_rect.height() * WINDOW_HEIGHT_RATIO).clamp(WINDOW_MIN_HEIGHT, WINDOW_MAX_HEIGHT); + let window_width = + (screen_rect.width() * WINDOW_WIDTH_RATIO).clamp(WINDOW_MIN_WIDTH, WINDOW_MAX_WIDTH); + let window_height = + (screen_rect.height() * WINDOW_HEIGHT_RATIO).clamp(WINDOW_MIN_HEIGHT, WINDOW_MAX_HEIGHT); egui::Window::new("Shortcuts") .collapsible(false)