11// #![windows_subsystem = "windows"]
22use eframe:: egui;
33use anyhow:: Result ;
4- use egui:: Color32 ;
4+ use egui:: { Color32 , TextEdit } ;
55use itertools:: Itertools ;
66use nfd2:: Response ;
77use pathdiff:: diff_paths;
@@ -23,7 +23,7 @@ struct AppState {
2323impl AppState {
2424 fn new ( cc : & eframe:: CreationContext < ' _ > , file : String , cwd : PathBuf ) -> Self {
2525 // Customize egui here with cc.egui_ctx.set_fonts and cc.egui_ctx.set_visuals.
26- cc. egui_ctx . set_pixels_per_point ( 1.5 ) ;
26+ cc. egui_ctx . set_zoom_factor ( 1.5 ) ;
2727 // Restore app state using cc.storage (requires the "persistence" feature).
2828 // Use the cc.gl (a glow::Context) to create graphics shaders and buffers that you can use
2929 // for e.g. egui::PaintCallback.
@@ -51,6 +51,9 @@ impl AppState {
5151
5252impl eframe:: App for AppState {
5353 fn update ( & mut self , ctx : & egui:: Context , _frame : & mut eframe:: Frame ) {
54+ let mut style = ( * ctx. style ( ) ) . clone ( ) ;
55+ style. spacing . text_edit_width = 650. ;
56+ ctx. set_style ( style) ;
5457 egui:: CentralPanel :: default ( ) . show ( ctx, |ui| {
5558 ui. horizontal ( |ui| {
5659 ui. vertical ( |ui| {
@@ -152,7 +155,13 @@ fn main() -> Result<()> {
152155 }
153156 file_path. file_name ( ) . unwrap ( ) . to_string_lossy ( ) . to_string ( )
154157 } ;
155- let native_options = eframe:: NativeOptions :: default ( ) ;
158+ let native_options = eframe:: NativeOptions {
159+ viewport : egui:: ViewportBuilder {
160+ maximized : Some ( true ) ,
161+ ..Default :: default ( )
162+ } ,
163+ ..Default :: default ( )
164+ } ;
156165 eframe:: run_native (
157166 "Simple Renamer" , native_options,
158167 Box :: new ( |cc| Ok ( Box :: new ( AppState :: new ( cc, file, cwd) ) ) )
0 commit comments