diff --git a/src/bin/gui/main.rs b/src/bin/gui/main.rs index 850e48d..0820ffb 100644 --- a/src/bin/gui/main.rs +++ b/src/bin/gui/main.rs @@ -1,7 +1,7 @@ // #![windows_subsystem = "windows"] use eframe::egui; use anyhow::Result; -use egui::Color32; +use egui::{Color32, TextEdit}; use itertools::Itertools; use nfd2::Response; use pathdiff::diff_paths; @@ -23,7 +23,7 @@ struct AppState { impl AppState { fn new(cc: &eframe::CreationContext<'_>, file: String, cwd: PathBuf) -> Self { // Customize egui here with cc.egui_ctx.set_fonts and cc.egui_ctx.set_visuals. - cc.egui_ctx.set_pixels_per_point(1.5); + cc.egui_ctx.set_zoom_factor(1.5); // Restore app state using cc.storage (requires the "persistence" feature). // Use the cc.gl (a glow::Context) to create graphics shaders and buffers that you can use // for e.g. egui::PaintCallback. @@ -51,6 +51,9 @@ impl AppState { impl eframe::App for AppState { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + let mut style = (*ctx.style()).clone(); + style.spacing.text_edit_width = 650.; + ctx.set_style(style); egui::CentralPanel::default().show(ctx, |ui| { ui.horizontal(|ui| { ui.vertical(|ui| { @@ -152,7 +155,13 @@ fn main() -> Result<()> { } file_path.file_name().unwrap().to_string_lossy().to_string() }; - let native_options = eframe::NativeOptions::default(); + let native_options = eframe::NativeOptions { + viewport: egui::ViewportBuilder { + maximized: Some(true), + ..Default::default() + }, + ..Default::default() + }; eframe::run_native( "Simple Renamer", native_options, Box::new(|cc| Ok(Box::new(AppState::new(cc, file, cwd))))